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)
24 BuildRequires: pkgconfig(openssl)
26 %if %{?enable_database} == YES
27 BuildRequires: pkgconfig(sqlite3)
31 BuildRequires: python-xml
34 A smart traffic control manager to manage traffic counting and bandwidth limitation
37 Summary: STC manager plugin
38 BuildRequires: pkgconfig(bundle)
39 BuildRequires: pkgconfig(syspopup-caller)
42 A smart traffic control manager extension for plugin
50 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE -D_GNU_SOURCE"
51 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE -D_GNU_SOURCE"
52 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
54 %cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \
55 -DBIN_DIR=%{_bindir} \
57 -DENABLE_DATABASE=%{enable_database} \
58 -DDATABASE_FULL_PATH=%{database_full_path} \
59 -DENABLE_STATISTICS=%{enable_statistics} \
60 -DENABLE_RESTRICTION=%{enable_restriction}
69 #database initialization
70 %if %{?enable_database} == YES
71 mkdir -p %{buildroot}/opt/usr/dbspace
72 sqlite3 %{buildroot}%{database_full_path} < %{buildroot}/usr/share/traffic_db.sql
73 rm %{buildroot}/usr/share/traffic_db.sql
77 mkdir -p %{buildroot}/%{_localstatedir}/lib/stc
78 cp data/exceptions %{buildroot}/%{_localstatedir}/lib/stc/exceptions
81 mkdir -p %{buildroot}%{_libdir}/systemd/system/
82 cp resources/systemd/stc-manager.service %{buildroot}%{_libdir}/systemd/system/stc-manager.service
84 mkdir -p %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/
85 ln -s ../stc-manager.service %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/stc-manager.service
87 #DBus DAC (stc-manager.manifest enables DBus SMACK)
88 mkdir -p %{buildroot}%{_sysconfdir}/dbus-1/system.d
89 cp resources/dbus/stc-manager.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/stc-manager.conf
92 %manifest %{name}.manifest
94 %defattr(-,root,root,-)
95 %attr(500,root,root) %{_bindir}/*
97 %attr(644,root,root) %{_libdir}/systemd/system/stc-manager.service
98 %attr(644,root,root) %{_libdir}/systemd/system/multi-user.target.wants/stc-manager.service
100 %attr(755,root,root) /%{_localstatedir}/lib/stc
101 %attr(600,root,root) /%{_localstatedir}/lib/stc/exceptions
104 %attr(644,root,root) %{_sysconfdir}/dbus-1/system.d/*
106 %if %{?enable_database} == YES
107 %config(noreplace) %attr(660, root, root) %{database_full_path}
108 %config(noreplace) %attr(660, root, root) %{database_full_path}-journal
112 %manifest %{name}.manifest
113 %attr(644, -,-) %{_datadir}/icons/*.png
114 %attr(500,root,root) %{_libdir}/stc-manager-plugin.so