Backout commit 46ff72c744b643df25898d10400f778f24897a74
[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.2
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 # if wmeshd do dhcp instead of connman
24 Requires: net-tools
25 Requires: toybox-symlinks-dhcp
26 # if image creater dose not know network_fw
27 Requires: security-config
28
29 %description
30 Manager for handling Wi-Fi mesh network
31
32 %prep
33 %setup -q
34 chmod 644 %{SOURCE0}
35 chmod 644 %{SOURCE1}
36 chmod 644 %{SOURCE2}
37 chmod 644 %{SOURCE3}
38 %if %{CHECK_WMESH_PRIVILEGE} == "True"
39 cp -a %{SOURCE1} ./wmeshd.conf
40 %endif
41 cp -a %{SOURCE2} .
42 cp -a %{SOURCE3} .
43
44 %build
45 CFLAGS=$(echo $CFLAGS | sed 's/-O2/-O0/' | sed 's/-O1/-O0/' | sed 's/-Wp,-D_FORTIFY_SOURCE=2//')
46 CXXFLAGS=$(echo $CXXFLAGS | sed 's/-O2/-O0/' | sed 's/-O1/-O0/' | sed 's/-Wp,-D_FORTIFY_SOURCE=2//')
47
48 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \
49         -DTIZEN_FEATURE_MESH_ON_DEMAND=1 \
50         -DLIB_DIR=%{_libdir} \
51         -DBIN_DIR=%{_bindir} \
52         -DSBIN_DIR=%{_sbindir}
53
54 make %{?_smp_mflags}
55
56 %install
57 rm -rf %{buildroot}
58
59 %make_install
60
61 %if %{CHECK_WMESH_PRIVILEGE} == "True"
62 mkdir -p %{buildroot}%{_sysconfdir}/dbus-1/system.d
63 cp wmeshd.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/wmeshd.conf
64 %endif
65 mkdir -p %{buildroot}%{_datadir}/dbus-1/system-services/
66 cp net.wmesh.service %{buildroot}%{_datadir}/dbus-1/system-services/net.wmesh.service
67 mkdir -p %{buildroot}%{_unitdir}
68 cp wmeshd.service %{buildroot}%{_unitdir}/wmeshd.service
69
70 %post
71 chmod 755 %{_sbindir}/wmesh.sh
72
73 %files
74 %manifest wmeshd.manifest
75 %license LICENSE
76 %defattr(-,root,root,-)
77 %attr(750,network_fw,network_fw) %{_bindir}/wmeshd
78 %if %{CHECK_WMESH_PRIVILEGE} == "True"
79 %config %{_sysconfdir}/dbus-1/system.d/wmeshd.conf
80 %endif
81 %attr(644,root,root) %{_datadir}/dbus-1/system-services/*
82 %attr(644,root,root) %{_unitdir}/wmeshd.service
83 %attr(750,root,root) %{_sbindir}/wmesh.sh