Remove smack command
[platform/core/telephony/tel-plugin-database.git] / packaging / tel-plugin-database.spec
1 %define major 0
2 %define minor 1
3 %define patchlevel 20
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 Requires(post): /sbin/ldconfig
17 Requires(postun): /sbin/ldconfig
18
19 %description
20 Telephony DataBase storage plugin
21
22 %prep
23 %setup -q
24
25 %build
26 versionint=$[%{major} * 1000000 + %{minor} * 1000 + %{patchlevel}]
27 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \
28         -DLIB_INSTALL_DIR=%{_libdir} \
29         -DVERSION=$versionint \
30 %if 0%{?sec_product_feature_telephony_cdma}
31     -DOPERATOR_CDMA=1 \
32 %endif
33
34 make %{?_smp_mflags}
35
36 %post
37 /sbin/ldconfig
38
39 mkdir -p /opt/dbspace
40
41 rm -f /opt/dbspace/.mcc_mnc_oper_list.db
42 sqlite3 /opt/dbspace/.mcc_mnc_oper_list.db < /tmp/mcc_mnc_oper_list.sql
43 rm -f /tmp/mcc_mnc_oper_list.sql
44
45 chmod 600 /opt/dbspace/.mcc_mnc_oper_list.db
46 chown system:system /opt/dbspace/.mcc_mnc_oper_list.db
47 chmod 644 /opt/dbspace/.mcc_mnc_oper_list.db-journal
48 chown system:system /opt/dbspace/.mcc_mnc_oper_list.db-journal
49
50 %if 0%{?sec_product_feature_telephony_cdma}
51         rm -f /opt/dbspace/.mcc_sid_list.db
52         sqlite3 /opt/dbspace/.mcc_sid_list.db < /tmp/mcc_sid_list.sql
53         rm -f /tmp/mcc_sid_list.sql
54         chmod 600 /opt/dbspace/.mcc_sid_list.db
55         chown system:system /opt/dbspace/.mcc_mnc_oper_list.db
56         chmod 644 /opt/dbspace/.mcc_sid_list.db-journal
57         chown system:system /opt/dbspace/.mcc_mnc_oper_list.db-journal
58 %endif
59
60 %postun -p /sbin/ldconfig
61
62 %install
63 %make_install
64 mkdir -p %{buildroot}%{_datadir}/license
65
66 %files
67 %defattr(644,system,system,-)
68 /tmp/mcc_mnc_oper_list.sql
69 %if 0%{?sec_product_feature_telephony_cdma}
70         /tmp/mcc_sid_list.sql
71 %endif
72 #%doc COPYING
73 %{_libdir}/telephony/plugins/db-plugin*
74 %{_datadir}/license/tel-plugin-database