Added Haltest for wifi-mesh-manager
[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 %package haltests
38 Summary:        wifi-mesh-manager extension for HAL test
39 BuildRequires:  pkgconfig(gmock)
40 BuildRequires:  pkgconfig(glib-2.0)
41 BuildRequires:  pkgconfig(gio-2.0)
42 BuildRequires: pkgconfig(dlog)
43 Requires:       %{name} = %{version}-%{release}
44 %description haltests
45 TIZEN wifi-mesh-manager extension for HAL test.
46
47 %prep
48 %setup -q
49 chmod 644 %{SOURCE0}
50 chmod 644 %{SOURCE1}
51 chmod 644 %{SOURCE2}
52 chmod 644 %{SOURCE3}
53 %if %{CHECK_WMESH_PRIVILEGE} == "True"
54 cp -a %{SOURCE1} ./wmeshd.conf
55 %endif
56 cp -a %{SOURCE2} .
57 cp -a %{SOURCE3} .
58
59 %build
60 CFLAGS=$(echo $CFLAGS | sed 's/-O2/-O0/' | sed 's/-O1/-O0/' | sed 's/-Wp,-D_FORTIFY_SOURCE=2//')
61 CXXFLAGS=$(echo $CXXFLAGS | sed 's/-O2/-O0/' | sed 's/-O1/-O0/' | sed 's/-Wp,-D_FORTIFY_SOURCE=2//')
62
63 %if 0%{?gcov:1}
64 export LDFLAGS+=" -lgcov"
65 %endif
66
67 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \
68         -DTIZEN_FEATURE_MESH_ON_DEMAND=1 \
69         -DLIB_DIR=%{_libdir} \
70         -DBIN_DIR=%{_bindir} \
71         -DSBIN_DIR=%{_sbindir} \
72         -DBUILD_GTESTS=%{?gtests:1}%{!?gtests:0} \
73         -DBUILD_GCOV=%{?gcov:1}%{!?gcov:0}
74
75 make %{?_smp_mflags}
76
77 %install
78 rm -rf %{buildroot}
79
80 %make_install
81
82 %if %{CHECK_WMESH_PRIVILEGE} == "True"
83 mkdir -p %{buildroot}%{_sysconfdir}/dbus-1/system.d
84 cp wmeshd.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/wmeshd.conf
85 %endif
86 mkdir -p %{buildroot}%{_datadir}/dbus-1/system-services/
87 cp net.wmesh.service %{buildroot}%{_datadir}/dbus-1/system-services/net.wmesh.service
88 mkdir -p %{buildroot}%{_unitdir}
89 cp wmeshd.service %{buildroot}%{_unitdir}/wmeshd.service
90
91 %post
92 chmod 755 %{_sbindir}/wmesh.sh
93
94 %files
95 %manifest wmeshd.manifest
96 %license LICENSE
97 %defattr(-,root,root,-)
98 %attr(750,network_fw,network_fw) %{_bindir}/wmeshd
99 %if %{CHECK_WMESH_PRIVILEGE} == "True"
100 %config %{_sysconfdir}/dbus-1/system.d/wmeshd.conf
101 %endif
102 %attr(644,root,root) %{_datadir}/dbus-1/system-services/*
103 %attr(644,root,root) %{_unitdir}/wmeshd.service
104 %attr(750,root,root) %{_sbindir}/wmesh.sh
105
106 %if 0%{?gtests:1}
107     %{_bindir}/gtest*
108 %endif
109
110 %files haltests
111 %manifest wmeshd.manifest
112 %{_bindir}/*hal_tc
113