Refactoring structures for monitoring and restrictions
[platform/core/connectivity/stc-manager.git] / packaging / stc-manager.spec
index 4668ee5..d524683 100644 (file)
@@ -1,6 +1,6 @@
 Name:       stc-manager
 Summary:    STC(Smart Traffic Control) manager
-Version:    0.0.26
+Version:    0.0.79
 Release:    0
 Group:      Network & Connectivity/Other
 License:    Apache-2.0
@@ -20,6 +20,7 @@ BuildRequires:  pkgconfig(dlog)
 BuildRequires:  pkgconfig(libtzplatform-config)
 BuildRequires: pkgconfig(vconf)
 BuildRequires:  pkgconfig(capi-system-info)
+BuildRequires:  pkgconfig(openssl)
 
 %if %{?enable_database} == YES
 BuildRequires: pkgconfig(sqlite3)
@@ -28,16 +29,39 @@ BuildRequires:      pkgconfig(sqlite3)
 BuildRequires:  python
 BuildRequires:  python-xml
 
+%if 0%{?gtests:1}
+BuildRequires: pkgconfig(gmock)
+%endif
+
 %description
 A smart traffic control manager to manage traffic counting and bandwidth limitation
 
-%package plugin
-Summary: STC manager plugin
+%package plugin-appstatus
+Summary: STC manager application status plugin
 BuildRequires: pkgconfig(bundle)
 BuildRequires: pkgconfig(syspopup-caller)
 
-%description plugin
-A smart traffic control manager extension for plugin
+%description plugin-appstatus
+A smart traffic control manager extension for application status plugin
+
+%package plugin-exception
+Summary: STC manager exception list plugin
+BuildRequires:  pkgconfig(pkgmgr-info)
+
+%description plugin-exception
+A smart traffic control manager extension for exception list plugin
+
+%package plugin-procfs
+Summary: STC manager exception proc file system plugin
+
+%description plugin-procfs
+A smart traffic control manager extension for proc file system plugin
+
+%package plugin-tether
+Summary: Tethering plugin for data usage of tethering clients
+
+%description plugin-tether
+A smart traffic control manager extension for tethering client data usage plugin
 
 %prep
 %setup -q
@@ -45,9 +69,8 @@ chmod 644 %{SOURCE0}
 
 %build
 
-export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE -D_GNU_SOURCE"
-export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE -D_GNU_SOURCE"
-export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
+export CFLAGS="$CFLAGS -D_GNU_SOURCE"
+export CXXFLAGS="$CXXFLAGS -D_GNU_SOURCE"
 
 %cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \
        -DBIN_DIR=%{_bindir} \
@@ -55,7 +78,9 @@ export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
        -DENABLE_DATABASE=%{enable_database} \
        -DDATABASE_FULL_PATH=%{database_full_path} \
        -DENABLE_STATISTICS=%{enable_statistics} \
-       -DENABLE_RESTRICTION=%{enable_restriction}
+       -DENABLE_RESTRICTION=%{enable_restriction} \
+       -DBUILD_GTESTS=%{?gtests:1}%{!?gtests:0} \
+       -DBUILD_GCOV=%{?gcov:1}%{!?gcov:0}
 
 make %{?_smp_mflags}
 
@@ -68,9 +93,15 @@ rm -rf %{buildroot}
 %if %{?enable_database} == YES
        mkdir -p %{buildroot}/opt/usr/dbspace
        sqlite3 %{buildroot}%{database_full_path} < %{buildroot}/usr/share/traffic_db.sql
+       sqlite3 %{buildroot}%{database_full_path} < %{buildroot}/usr/share/firewall_db.sql
        rm %{buildroot}/usr/share/traffic_db.sql
+       rm %{buildroot}/usr/share/firewall_db.sql
 %endif
 
+#Exceptions file
+mkdir -p %{buildroot}/%{_localstatedir}/lib/stc
+cp data/exceptions %{buildroot}/%{_localstatedir}/lib/stc/exceptions
+
 #Systemd service file
 mkdir -p %{buildroot}%{_libdir}/systemd/system/
 cp resources/systemd/stc-manager.service %{buildroot}%{_libdir}/systemd/system/stc-manager.service
@@ -91,6 +122,9 @@ cp resources/dbus/stc-manager.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/st
 %attr(644,root,root) %{_libdir}/systemd/system/stc-manager.service
 %attr(644,root,root) %{_libdir}/systemd/system/multi-user.target.wants/stc-manager.service
 
+%attr(755,network_fw,network_fw) /%{_localstatedir}/lib/stc
+%attr(600,root,root) /%{_localstatedir}/lib/stc/exceptions
+
 #DBus DAC
 %attr(644,root,root) %{_sysconfdir}/dbus-1/system.d/*
 
@@ -99,7 +133,23 @@ cp resources/dbus/stc-manager.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/st
 %config(noreplace) %attr(660, root, root) %{database_full_path}-journal
 %endif
 
-%files plugin
+%if 0%{?gtests:1}
+%{_bindir}/gtest*
+%endif
+
+%files plugin-appstatus
 %manifest %{name}.manifest
 %attr(644, -,-) %{_datadir}/icons/*.png
-%attr(500,root,root) %{_libdir}/stc-manager-plugin.so
+%attr(500,root,root) %{_libdir}/stc-plugin-appstatus.so
+
+%files plugin-exception
+%manifest %{name}.manifest
+%attr(500,root,root) %{_libdir}/stc-plugin-exception.so
+
+%files plugin-procfs
+%manifest %{name}.manifest
+%attr(500,root,root) %{_libdir}/stc-plugin-procfs.so
+
+%files plugin-tether
+%manifest %{name}.manifest
+%attr(500,root,root) %{_libdir}/stc-plugin-tether.so