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)
23 %if %{?enable_database} == YES
24 BuildRequires: pkgconfig(sqlite3)
28 BuildRequires: python-xml
31 A smart traffic control manager to manage traffic counting and bandwidth limitation
34 Summary: STC manager plugin
35 BuildRequires: pkgconfig(bundle)
36 BuildRequires: pkgconfig(syspopup-caller)
39 A smart traffic control manager extension for plugin
47 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE -D_GNU_SOURCE"
48 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE -D_GNU_SOURCE"
49 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
51 %cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \
52 -DBIN_DIR=%{_bindir} \
54 -DENABLE_DATABASE=%{enable_database} \
55 -DDATABASE_FULL_PATH=%{database_full_path} \
56 -DENABLE_STATISTICS=%{enable_statistics} \
57 -DENABLE_RESTRICTION=%{enable_restriction}
66 #database initialization
67 %if %{?enable_database} == YES
68 mkdir -p %{buildroot}/opt/usr/dbspace
69 sqlite3 %{buildroot}%{database_full_path} < %{buildroot}/usr/share/traffic_db.sql
70 rm %{buildroot}/usr/share/traffic_db.sql
74 mkdir -p %{buildroot}%{_libdir}/systemd/system/
75 cp resources/systemd/stc-manager.service %{buildroot}%{_libdir}/systemd/system/stc-manager.service
77 mkdir -p %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/
78 ln -s ../stc-manager.service %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/stc-manager.service
80 mkdir -p %{buildroot}%{_datadir}/dbus-1/system-services/
81 cp resources/dbus/net.stc.service %{buildroot}%{_datadir}/dbus-1/system-services/
83 #DBus DAC (stc-manager.manifest enables DBus SMACK)
84 mkdir -p %{buildroot}%{_sysconfdir}/dbus-1/system.d
85 cp resources/dbus/stc-manager.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/stc-manager.conf
88 %manifest %{name}.manifest
90 %defattr(-,root,root,-)
91 %attr(500,root,root) %{_bindir}/*
93 %attr(644,root,root) %{_libdir}/systemd/system/stc-manager.service
94 %attr(644,root,root) %{_libdir}/systemd/system/multi-user.target.wants/stc-manager.service
97 %attr(644,root,root) %{_sysconfdir}/dbus-1/system.d/*
98 %attr(644,-,-) %{_datadir}/dbus-1/system-services/*.service
100 %if %{?enable_database} == YES
101 %config(noreplace) %attr(660, root, root) %{database_full_path}
102 %config(noreplace) %attr(660, root, root) %{database_full_path}-journal
106 %manifest %{name}.manifest
107 %attr(500,root,root) %{_libdir}/stc-manager-plugin.so