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