2 Summary: STC(Smart Traffic Control) manager
5 Group: Network & Connectivity/Other
7 Source0: %{name}-%{version}.tar.gz
9 %define enable_database YES
10 %define enable_statistics YES
11 %define enable_restriction YES
12 %define database_full_path /opt/usr/dbspace/.stc-manager-datausage.db
15 BuildRequires: pkgconfig(glib-2.0)
16 BuildRequires: pkgconfig(gio-2.0)
17 BuildRequires: pkgconfig(gobject-2.0)
18 BuildRequires: pkgconfig(gio-unix-2.0)
19 BuildRequires: pkgconfig(dlog)
20 BuildRequires: pkgconfig(libtzplatform-config)
21 BuildRequires: pkgconfig(vconf)
22 BuildRequires: pkgconfig(capi-system-info)
23 BuildRequires: pkgconfig(pkgmgr-info)
25 %if %{?enable_database} == YES
26 BuildRequires: pkgconfig(sqlite3)
30 BuildRequires: python-xml
33 A smart traffic control manager to manage traffic counting and bandwidth limitation
36 Summary: STC manager plugin
37 BuildRequires: pkgconfig(bundle)
38 BuildRequires: pkgconfig(syspopup-caller)
41 A smart traffic control manager extension for plugin
49 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE -D_GNU_SOURCE"
50 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE -D_GNU_SOURCE"
51 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
53 %cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \
54 -DBIN_DIR=%{_bindir} \
56 -DENABLE_DATABASE=%{enable_database} \
57 -DDATABASE_FULL_PATH=%{database_full_path} \
58 -DENABLE_STATISTICS=%{enable_statistics} \
59 -DENABLE_RESTRICTION=%{enable_restriction}
68 #database initialization
69 %if %{?enable_database} == YES
70 mkdir -p %{buildroot}/opt/usr/dbspace
71 sqlite3 %{buildroot}%{database_full_path} < %{buildroot}/usr/share/traffic_db.sql
72 rm %{buildroot}/usr/share/traffic_db.sql
76 mkdir -p %{buildroot}/%{_localstatedir}/lib/stc
77 cp data/exceptions %{buildroot}/%{_localstatedir}/lib/stc/exceptions
80 mkdir -p %{buildroot}%{_libdir}/systemd/system/
81 cp resources/systemd/stc-manager.service %{buildroot}%{_libdir}/systemd/system/stc-manager.service
83 mkdir -p %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/
84 ln -s ../stc-manager.service %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/stc-manager.service
86 #DBus DAC (stc-manager.manifest enables DBus SMACK)
87 mkdir -p %{buildroot}%{_sysconfdir}/dbus-1/system.d
88 cp resources/dbus/stc-manager.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/stc-manager.conf
91 %manifest %{name}.manifest
93 %defattr(-,root,root,-)
94 %attr(500,root,root) %{_bindir}/*
96 %attr(644,root,root) %{_libdir}/systemd/system/stc-manager.service
97 %attr(644,root,root) %{_libdir}/systemd/system/multi-user.target.wants/stc-manager.service
99 %attr(755,root,root) /%{_localstatedir}/lib/stc
100 %attr(600,root,root) /%{_localstatedir}/lib/stc/exceptions
103 %attr(644,root,root) %{_sysconfdir}/dbus-1/system.d/*
105 %if %{?enable_database} == YES
106 %config(noreplace) %attr(660, root, root) %{database_full_path}
107 %config(noreplace) %attr(660, root, root) %{database_full_path}-journal
111 %manifest %{name}.manifest
112 %attr(644, -,-) %{_datadir}/icons/*.png
113 %attr(500,root,root) %{_libdir}/stc-manager-plugin.so