Ignoring SIGCHLD signal as exit status if child process is not required.
[platform/core/connectivity/stc-manager.git] / packaging / stc-manager.spec
1 Name:       stc-manager
2 Summary:    STC(Smart Traffic Control) manager
3 Version:    0.0.18
4 Release:    0
5 Group:      Network & Connectivity/Other
6 License:    Apache-2.0
7 Source0:    %{name}-%{version}.tar.gz
8
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
13
14 BuildRequires:  cmake
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
24 %if %{?enable_database} == YES
25 BuildRequires:  pkgconfig(sqlite3)
26 %endif
27
28 BuildRequires:  python
29 BuildRequires:  python-xml
30
31 %description
32 A smart traffic control manager to manage traffic counting and bandwidth limitation
33
34 %package plugin
35 Summary: STC manager plugin
36 BuildRequires:  pkgconfig(bundle)
37 BuildRequires:  pkgconfig(syspopup-caller)
38
39 %description plugin
40 A smart traffic control manager extension for plugin
41
42 %prep
43 %setup -q
44 chmod 644 %{SOURCE0}
45
46 %build
47
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"
51
52 %cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \
53         -DBIN_DIR=%{_bindir} \
54         -DLIB_PATH=%{_lib} \
55         -DENABLE_DATABASE=%{enable_database} \
56         -DDATABASE_FULL_PATH=%{database_full_path} \
57         -DENABLE_STATISTICS=%{enable_statistics} \
58         -DENABLE_RESTRICTION=%{enable_restriction}
59
60 make %{?_smp_mflags}
61
62 %install
63 rm -rf %{buildroot}
64
65 %make_install
66
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
72 %endif
73
74 #Systemd service file
75 mkdir -p %{buildroot}%{_libdir}/systemd/system/
76 cp resources/systemd/stc-manager.service %{buildroot}%{_libdir}/systemd/system/stc-manager.service
77
78 mkdir -p %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/
79 ln -s ../stc-manager.service %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/stc-manager.service
80
81 mkdir -p %{buildroot}%{_datadir}/dbus-1/system-services/
82 cp resources/dbus/net.stc.service %{buildroot}%{_datadir}/dbus-1/system-services/
83
84 #DBus DAC (stc-manager.manifest enables DBus SMACK)
85 mkdir -p %{buildroot}%{_sysconfdir}/dbus-1/system.d
86 cp resources/dbus/stc-manager.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/stc-manager.conf
87
88 %files
89 %manifest %{name}.manifest
90 %license LICENSE
91 %defattr(-,root,root,-)
92 %attr(500,root,root) %{_bindir}/*
93
94 %attr(644,root,root) %{_libdir}/systemd/system/stc-manager.service
95 %attr(644,root,root) %{_libdir}/systemd/system/multi-user.target.wants/stc-manager.service
96
97 #DBus DAC
98 %attr(644,root,root) %{_sysconfdir}/dbus-1/system.d/*
99 %attr(644,-,-) %{_datadir}/dbus-1/system-services/*.service
100
101 %if %{?enable_database} == YES
102 %config(noreplace) %attr(660, root, root) %{database_full_path}
103 %config(noreplace) %attr(660, root, root) %{database_full_path}-journal
104 %endif
105
106 %files plugin
107 %manifest %{name}.manifest
108 %attr(644, -,-) %{_datadir}/icons/*.png
109 %attr(500,root,root) %{_libdir}/stc-manager-plugin.so