bf9591deb7eb6e2caba3ffe5062a9a4b2ba90f8a
[platform/core/connectivity/wifi-mesh-manager.git] / packaging / wifi-mesh-manager.spec
1 %define CHECK_WMESH_PRIVILEGE False
2
3 Name:           wifi-mesh-manager
4 Summary:        Wi-Fi mesh network daemon
5 Version:        0.0.3
6 Release:        1
7 Group:      Network & Connectivity/Wireless
8 License:    Apache-2.0
9 Source0:        %{name}-%{version}.tar.gz
10 Source1:        dbus-wmeshd.conf
11 Source2:        net.wmesh.service
12 Source3:        wmeshd.service
13 BuildRequires: pkgconfig(glib-2.0)
14 BuildRequires: pkgconfig(gio-2.0)
15 BuildRequires: pkgconfig(gio-unix-2.0)
16 BuildRequires: pkgconfig(dlog)
17 BuildRequires: pkgconfig(libnl-3.0)
18 BuildRequires: pkgconfig(dbus-1)
19 BuildRequires: pkgconfig(libcrypto)
20 BuildRequires: pkgconfig(libtzplatform-config)
21 BuildRequires: pkgconfig(capi-network-wifi-manager)
22 BuildRequires: cmake
23
24 %if 0%{?gtests:1}
25 BuildRequires:  pkgconfig(gmock)
26 %endif
27
28 # if wmeshd do dhcp instead of connman
29 Requires: net-tools
30 Requires: toybox-symlinks-dhcp
31 # if image creater dose not know network_fw
32 Requires: security-config
33
34 %description
35 Manager for handling Wi-Fi mesh network
36
37 %prep
38 %setup -q
39 chmod 644 %{SOURCE0}
40 chmod 644 %{SOURCE1}
41 chmod 644 %{SOURCE2}
42 chmod 644 %{SOURCE3}
43 %if %{CHECK_WMESH_PRIVILEGE} == "True"
44 cp -a %{SOURCE1} ./wmeshd.conf
45 %endif
46 cp -a %{SOURCE2} .
47 cp -a %{SOURCE3} .
48
49 %build
50 CFLAGS=$(echo $CFLAGS | sed 's/-O2/-O0/' | sed 's/-O1/-O0/' | sed 's/-Wp,-D_FORTIFY_SOURCE=2//')
51 CXXFLAGS=$(echo $CXXFLAGS | sed 's/-O2/-O0/' | sed 's/-O1/-O0/' | sed 's/-Wp,-D_FORTIFY_SOURCE=2//')
52
53 %if 0%{?gcov:1}
54 export LDFLAGS+=" -lgcov"
55 %endif
56
57 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \
58         -DTIZEN_FEATURE_MESH_ON_DEMAND=1 \
59         -DLIB_DIR=%{_libdir} \
60         -DBIN_DIR=%{_bindir} \
61         -DSBIN_DIR=%{_sbindir} \
62         -DBUILD_GTESTS=%{?gtests:1}%{!?gtests:0} \
63         -DBUILD_GCOV=%{?gcov:1}%{!?gcov:0}
64
65 make %{?_smp_mflags}
66
67 %install
68 rm -rf %{buildroot}
69
70 %make_install
71
72 %if %{CHECK_WMESH_PRIVILEGE} == "True"
73 mkdir -p %{buildroot}%{_sysconfdir}/dbus-1/system.d
74 cp wmeshd.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/wmeshd.conf
75 %endif
76 mkdir -p %{buildroot}%{_datadir}/dbus-1/system-services/
77 cp net.wmesh.service %{buildroot}%{_datadir}/dbus-1/system-services/net.wmesh.service
78 mkdir -p %{buildroot}%{_unitdir}
79 cp wmeshd.service %{buildroot}%{_unitdir}/wmeshd.service
80
81 %post
82 chmod 755 %{_sbindir}/wmesh.sh
83
84 %files
85 %manifest wmeshd.manifest
86 %license LICENSE
87 %defattr(-,root,root,-)
88 %attr(750,network_fw,network_fw) %{_bindir}/wmeshd
89 %if %{CHECK_WMESH_PRIVILEGE} == "True"
90 %config %{_sysconfdir}/dbus-1/system.d/wmeshd.conf
91 %endif
92 %attr(644,root,root) %{_datadir}/dbus-1/system-services/*
93 %attr(644,root,root) %{_unitdir}/wmeshd.service
94 %attr(750,root,root) %{_sbindir}/wmesh.sh
95
96 %if 0%{?gtests:1}
97     %{_bindir}/gtest*
98 %endif
99