%define major 0
%define minor 1
-%define patchlevel 12
+%define patchlevel 21
Name: tel-plugin-database
Version: %{major}.%{minor}.%{patchlevel}
Release: 1
-License: Apache
+License: Apache-2.0
Summary: Telephony DataBase storage plugin
Group: System/Libraries
Source0: tel-plugin-database-%{version}.tar.gz
versionint=$[%{major} * 1000000 + %{minor} * 1000 + %{patchlevel}]
cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DLIB_INSTALL_DIR=%{_libdir} \
- -DVERSION=$versionint
+ -DVERSION=$versionint \
+%if 0%{?sec_product_feature_telephony_cdma}
+ -DOPERATOR_CDMA=1 \
+%endif
+
make %{?_smp_mflags}
-%post -p /sbin/ldconfig
+%post
+/sbin/ldconfig
+
+mkdir -p /opt/dbspace
+
+rm -f /opt/dbspace/.mcc_mnc_oper_list.db
+sqlite3 /opt/dbspace/.mcc_mnc_oper_list.db < /tmp/mcc_mnc_oper_list.sql
+rm -f /tmp/mcc_mnc_oper_list.sql
+
+chmod 600 /opt/dbspace/.mcc_mnc_oper_list.db
+chown system:system /opt/dbspace/.mcc_mnc_oper_list.db
+chmod 644 /opt/dbspace/.mcc_mnc_oper_list.db-journal
+chown system:system /opt/dbspace/.mcc_mnc_oper_list.db-journal
+
+%if 0%{?sec_product_feature_telephony_cdma}
+ rm -f /opt/dbspace/.mcc_sid_list.db
+ sqlite3 /opt/dbspace/.mcc_sid_list.db < /tmp/mcc_sid_list.sql
+ rm -f /tmp/mcc_sid_list.sql
+ chmod 600 /opt/dbspace/.mcc_sid_list.db
+ chown system:system /opt/dbspace/.mcc_mnc_oper_list.db
+ chmod 644 /opt/dbspace/.mcc_sid_list.db-journal
+ chown system:system /opt/dbspace/.mcc_mnc_oper_list.db-journal
+%endif
%postun -p /sbin/ldconfig
mkdir -p %{buildroot}%{_datadir}/license
%files
-%defattr(-,root,root,-)
+%defattr(644,system,system,-)
+/tmp/mcc_mnc_oper_list.sql
+%if 0%{?sec_product_feature_telephony_cdma}
+ /tmp/mcc_sid_list.sql
+%endif
#%doc COPYING
%{_libdir}/telephony/plugins/db-plugin*
%{_datadir}/license/tel-plugin-database