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