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