113fa52a9bd341f4b96e62cd30217f4501d720d1
[platform/core/telephony/tel-plugin-database.git] / packaging / tel-plugin-database.spec
1 %define major 0
2 %define minor 1
3 %define patchlevel 46
4
5 Name:           tel-plugin-database
6 Version:        %{major}.%{minor}.%{patchlevel}
7 Release:        1
8 License:        Apache-2.0
9 Summary:        Telephony DataBase storage plugin
10 Group:          System/Libraries
11 Source0:        tel-plugin-database-%{version}.tar.gz
12 BuildRequires:  cmake
13 BuildRequires:  pkgconfig(sqlite3)
14 BuildRequires:  pkgconfig(dlog)
15 BuildRequires:  pkgconfig(glib-2.0)
16 BuildRequires:  pkgconfig(tcore)
17 BuildRequires:  pkgconfig(libtzplatform-config)
18 BuildRequires:  pkgconfig(capi-system-info)
19 Requires:       security-config
20 Requires(post): /sbin/ldconfig
21 Requires(postun): /sbin/ldconfig
22
23 %description
24 Telephony DataBase storage plugin
25
26 %package -n libtfeature
27 Summary:        Telephony Feature Library
28 Group:          Development/Libraries
29
30 %description -n libtfeature
31 Telephony Feature Library
32
33 %package -n libtfeature-devel
34 Summary:        Telephony Feature Library (devel)
35 Group:          Development/Libraries
36 Requires:               libtfeature
37
38 %description -n libtfeature-devel
39 Telephony Feature Library (devel)
40
41 %prep
42 %setup -q
43
44 %build
45 versionint=$[%{major} * 1000000 + %{minor} * 1000 + %{patchlevel}]
46 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \
47         -DLIB_INSTALL_DIR=%{_libdir} \
48         -DVERSION=$versionint \
49 %if 0%{?sec_product_feature_telephony_cdma}
50     -DOPERATOR_CDMA=1 \
51 %endif
52
53 make %{?_smp_mflags}
54
55 %post
56 /sbin/ldconfig
57
58 mkdir -p %TZ_SYS_DB
59
60 rm -f %TZ_SYS_DB/.mcc_mnc_oper_list.db
61 sqlite3 %TZ_SYS_DB/.mcc_mnc_oper_list.db < /tmp/mcc_mnc_oper_list.sql
62 rm -f /tmp/mcc_mnc_oper_list.sql
63
64 chmod 600 %TZ_SYS_DB/.mcc_mnc_oper_list.db
65 chown telephony:telephony %TZ_SYS_DB/.mcc_mnc_oper_list.db
66 chsmack -a System %TZ_SYS_DB/.mcc_mnc_oper_list.db
67 chmod 644 %TZ_SYS_DB/.mcc_mnc_oper_list.db-journal
68 chown telephony:telephony %TZ_SYS_DB/.mcc_mnc_oper_list.db-journal
69 chsmack -a System %TZ_SYS_DB/.mcc_mnc_oper_list.db-journal
70
71 %if 0%{?sec_product_feature_telephony_cdma}
72         rm -f %TZ_SYS_DB/.mcc_sid_list.db
73         sqlite3 %TZ_SYS_DB/.mcc_sid_list.db < /tmp/mcc_sid_list.sql
74         rm -f /tmp/mcc_sid_list.sql
75         chmod 600 %TZ_SYS_DB/.mcc_sid_list.db
76         chown telephony:telephony %TZ_SYS_DB/.mcc_mnc_oper_list.db
77         chsmack -a System %TZ_SYS_DB/.mcc_mnc_oper_list.db
78         chmod 644 %TZ_SYS_DB/.mcc_sid_list.db-journal
79         chown telephony:telephony %TZ_SYS_DB/.mcc_mnc_oper_list.db-journal
80         chsmack -a System %TZ_SYS_DB/.mcc_mnc_oper_list.db-journal
81 %endif
82
83 %postun -p /sbin/ldconfig
84
85 %install
86 %make_install
87
88 %files
89 %manifest %{name}.manifest
90 %defattr(644,root,root,-)
91 /tmp/mcc_mnc_oper_list.sql
92 %if 0%{?sec_product_feature_telephony_cdma}
93         /tmp/mcc_sid_list.sql
94 %endif
95 #%doc COPYING
96 %{_libdir}/telephony/plugins/db-plugin*
97 /opt/data/etc/spn-conf.xml
98
99 %license LICENSE
100
101 %files -n libtfeature
102 %manifest feature/libtfeature.manifest
103 %defattr(644,root,root,-)
104 %{_libdir}/*.so
105
106 %files -n libtfeature-devel
107 %defattr(644,root,root,-)
108 %{_libdir}/pkgconfig/*.pc
109 %{_includedir}/tfeature/*.h