Fix issues in add device and scan operation
[platform/core/connectivity/ua-plugin-wifi-location.git] / packaging / ua-plugin-wifi-location.spec
1 Name:       ua-plugin-wifi-location
2 Summary:    Wifi Location User awareness plugin
3 Version:    0.0.1
4 Release:    1
5 License:    Apache-2.0
6 Source0:    %{name}-%{version}.tar.gz
7 Source1001: %{name}.manifest
8
9 BuildRequires:  cmake
10 BuildRequires:  pkgconfig(dlog)
11 BuildRequires:  pkgconfig(glib-2.0)
12 BuildRequires:  pkgconfig(gio-2.0)
13 BuildRequires:  pkgconfig(gio-unix-2.0)
14 BuildRequires:  pkgconfig(libtzplatform-config)
15 BuildRequires:  pkgconfig(ua-plugins)
16 BuildRequires:  pkgconfig(capi-system-info)
17 BuildRequires:  pkgconfig(capi-network-wifi-location)
18
19 %if 0%{?gtests:1}
20 BuildRequires:  pkgconfig(gmock)
21 %endif
22 Requires(post): /sbin/ldconfig
23 Requires(postun): /sbin/ldconfig
24
25 %description
26 WIFI Location User awareness plugin
27
28 %prep
29 %setup -q
30 cp %{SOURCE1001} .
31
32 %build
33 CFLAGS=$(echo $CFLAGS | sed 's/-O2/-O0/' | sed 's/-O1/-O0/' | sed 's/-Wp,-D_FORTIFY_SOURCE=2//')
34 CXXFLAGS=$(echo $CXXFLAGS | sed 's/-O2/-O0/' | sed 's/-O1/-O0/' | sed 's/-Wp,-D_FORTIFY_SOURCE=2//')
35 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
36
37 %if 0%{?gcov:1}
38 export LDFLAGS+=" -lgcov"
39 %endif
40
41 %define NETWORK_FW_DATADIR %{TZ_SYS_RO_SHARE}/network
42 %define DBDIR %{TZ_SYS_GLOBALUSER_DATA}/
43
44 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
45                 -DCMAKE_LIB_DIR=%{_libdir} \
46                 -DBIN_DIR=%{_bindir} \
47                 -DSBIN_DIR=%{_sbindir} \
48                 -DNETWORK_FW_DATADIR=%{NETWORK_FW_DATADIR} \
49                 -DDBDIR=%{DBDIR} \
50                 -DBUILD_GTESTS=%{?gtests:1}%{!?gtests:0} \
51                 -DBUILD_GCOV=%{?gcov:1}%{!?gcov:0}
52 make %{?jobs:-j%jobs}
53
54 %cmake
55
56 %install
57 mkdir -p %{buildroot}/%{TZ_SYS_RO_SHARE}/network/ua/lib/sensor
58 cp -af *.so %{buildroot}/%{TZ_SYS_RO_SHARE}/network/ua/lib/sensor
59 %make_install
60
61 %post -p /sbin/ldconfig
62
63 %postun -p /sbin/ldconfig
64
65 %files
66 %manifest %{name}.manifest
67 %license LICENSE
68 %defattr(-, root, root)
69 %attr(640,network_fw,network_fw) %{NETWORK_FW_DATADIR}/ua/lib/sensor/wifi-location-plugin.so*