Use %license macro in spec file
[platform/core/telephony/tel-plugin-database.git] / packaging / tel-plugin-database.spec
1 %define major 0
2 %define minor 1
3 %define patchlevel 31
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 chsmack -a System %TZ_SYS_DB/.mcc_mnc_oper_list.db
49 chmod 644 %TZ_SYS_DB/.mcc_mnc_oper_list.db-journal
50 chown telephony:telephony %TZ_SYS_DB/.mcc_mnc_oper_list.db-journal
51 chsmack -a System %TZ_SYS_DB/.mcc_mnc_oper_list.db-journal
52
53 %if 0%{?sec_product_feature_telephony_cdma}
54         rm -f %TZ_SYS_DB/.mcc_sid_list.db
55         sqlite3 %TZ_SYS_DB/.mcc_sid_list.db < /tmp/mcc_sid_list.sql
56         rm -f /tmp/mcc_sid_list.sql
57         chmod 600 %TZ_SYS_DB/.mcc_sid_list.db
58         chown telephony:telephony %TZ_SYS_DB/.mcc_mnc_oper_list.db
59         chsmack -a System %TZ_SYS_DB/.mcc_mnc_oper_list.db
60         chmod 644 %TZ_SYS_DB/.mcc_sid_list.db-journal
61         chown telephony:telephony %TZ_SYS_DB/.mcc_mnc_oper_list.db-journal
62         chsmack -a System %TZ_SYS_DB/.mcc_mnc_oper_list.db-journal
63 %endif
64
65 %postun -p /sbin/ldconfig
66
67 %install
68 %make_install
69
70 %files
71 %defattr(644,root,root,-)
72 /tmp/mcc_mnc_oper_list.sql
73 %if 0%{?sec_product_feature_telephony_cdma}
74         /tmp/mcc_sid_list.sql
75 %endif
76 #%doc COPYING
77 %{_libdir}/telephony/plugins/db-plugin*
78 %{_datadir}/upgrade/scripts/500.mcc_mnc_oper_list_upgrade_24_30.sh
79 %license LICENSE