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)
24 %if %{?enable_database} == YES
25 BuildRequires: pkgconfig(sqlite3)
29 BuildRequires: python-xml
32 A smart traffic control manager to manage traffic counting and bandwidth limitation
35 Summary: STC manager plugin
36 BuildRequires: pkgconfig(bundle)
37 BuildRequires: pkgconfig(syspopup-caller)
40 A smart traffic control manager extension for plugin
48 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE -D_GNU_SOURCE"
49 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE -D_GNU_SOURCE"
50 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
52 %cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \
53 -DBIN_DIR=%{_bindir} \
55 -DENABLE_DATABASE=%{enable_database} \
56 -DDATABASE_FULL_PATH=%{database_full_path} \
57 -DENABLE_STATISTICS=%{enable_statistics} \
58 -DENABLE_RESTRICTION=%{enable_restriction}
67 #database initialization
68 %if %{?enable_database} == YES
69 mkdir -p %{buildroot}/opt/usr/dbspace
70 sqlite3 %{buildroot}%{database_full_path} < %{buildroot}/usr/share/traffic_db.sql
71 rm %{buildroot}/usr/share/traffic_db.sql
75 mkdir -p %{buildroot}/%{_localstatedir}/lib/stc
76 cp data/exceptions %{buildroot}/%{_localstatedir}/lib/stc/exceptions
79 mkdir -p %{buildroot}%{_libdir}/systemd/system/
80 cp resources/systemd/stc-manager.service %{buildroot}%{_libdir}/systemd/system/stc-manager.service
82 mkdir -p %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/
83 ln -s ../stc-manager.service %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/stc-manager.service
85 #DBus DAC (stc-manager.manifest enables DBus SMACK)
86 mkdir -p %{buildroot}%{_sysconfdir}/dbus-1/system.d
87 cp resources/dbus/stc-manager.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/stc-manager.conf
90 %manifest %{name}.manifest
92 %defattr(-,root,root,-)
93 %attr(500,root,root) %{_bindir}/*
95 %attr(644,root,root) %{_libdir}/systemd/system/stc-manager.service
96 %attr(644,root,root) %{_libdir}/systemd/system/multi-user.target.wants/stc-manager.service
98 %attr(755,root,root) /%{_localstatedir}/lib/stc
99 %attr(600,root,root) /%{_localstatedir}/lib/stc/exceptions
102 %attr(644,root,root) %{_sysconfdir}/dbus-1/system.d/*
104 %if %{?enable_database} == YES
105 %config(noreplace) %attr(660, root, root) %{database_full_path}
106 %config(noreplace) %attr(660, root, root) %{database_full_path}-journal
110 %manifest %{name}.manifest
111 %attr(644, -,-) %{_datadir}/icons/*.png
112 %attr(500,root,root) %{_libdir}/stc-manager-plugin.so