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