1 %bcond_without lws_static
2 %bcond_without lws_static_prebuilt
3 %bcond_without use_glib_event_loop
4 Name: capi-network-vine
5 Summary: An service discovery framework
8 Group: Network & Connectivity/API
10 Source0: %{name}-%{version}.tar.gz
11 Source1: %{name}.manifest
14 BuildRequires: pkgconfig(dns_sd)
15 %if %{with lws_static}
16 BuildRequires: pkgconfig(openssl1.1)
18 %if %{without lws_static}
19 BuildRequires: pkgconfig(libwebsockets)
22 %if 0%{?_with_tizen:1}
23 BuildRequires: pkgconfig(capi-base-common)
24 BuildRequires: pkgconfig(capi-system-info)
25 BuildRequires: pkgconfig(dlog)
27 %ifnarch %i586 i686 x86_64
28 BuildRequires: pkgconfig(capi-network-wifi-aware)
30 BuildRequires: pkgconfig(capi-network-bluetooth)
33 %if %{with use_glib_event_loop}
34 BuildRequires: pkgconfig(glib-2.0)
37 BuildRequires: pkgconfig(gmock)
40 BuildRequires: gtest-devel
44 Requires(post): /sbin/ldconfig
45 Requires(postun): /sbin/ldconfig
48 A Vine library is a Tizen Framework to provide service discovery and connection to communicate between devices in a local network
51 Summary: A Vine library in Native API (Development)
52 Group: Development/Libraries
53 Requires: %{name} = %{version}-%{release}
54 Requires: capi-base-common-devel
57 A Vine library in Native API (Development)
60 Summary: Vine - Test binaries
63 Test Application for Vine
67 Summary: Coverage Data of %{name}
70 The %{name}-gcov package contains gcov objects
74 Summary: %{name} unittests binary
76 %description unittests
82 cp %{SOURCE1} ./%{name}.manifest
92 export CFLAGS+=" -fprofile-arcs -ftest-coverage"
93 export CXXFLAGS+=" -fprofile-arcs -ftest-coverage"
94 export FFLAGS+=" -fprofile-arcs -ftest-coverage"
98 -DTIZEN_OS=%{?_with_tizen} \
102 -DCMAKE_BUILD_TYPE=%{?build_type} \
103 -DCMAKE_VERBOSE_MAKEFILE=ON \
104 -DLIB_DIR:PATH=%{_libdir} \
105 -DBIN_DIR:PATH=%{_bindir} \
106 -DINCLUDE_DIR:PATH=%{_includedir} \
107 -DUSE_EVENT_LOOP_EPOLL=ON \
108 %if %{with use_glib_event_loop}
109 -DUSE_EVENT_LOOP_EXTERNAL_GLIB=ON \
111 -DUSE_EVENT_LOOP_EXTERNAL_GLIB=OFF \
113 %if %{with lws_static}
114 -DUSE_LIBWEBSOCKETS_STATIC=ON \
116 -DUSE_LIBWEBSOCKETS_STATIC=OFF \
118 %ifnarch %i586 i686 x86_64
121 %if %{with lws_static_prebuilt}
122 -DUSE_LIBWEBSOCKETS_STATIC_PREBUILT=ON \
124 -DUSE_LIBWEBSOCKETS_STATIC_PREBUILT=OFF \
129 -DENABLE_DATAPATH_PLUGIN_DEBUG=ON \
132 make %{?jobs:-j%jobs}
138 %if %{with lws_static}
139 rm -rf %{buildroot}%{_libdir}/cmake/libwebsockets
143 builddir=$(basename $PWD)
144 gcno_obj_dir=%{buildroot}%{_datadir}/gcov/obj/%{name}/"$builddir"
145 mkdir -p "$gcno_obj_dir"
146 find . -name '*.gcno' ! -path '*/verifier/*' ! -path '*/vine-test/*' ! -path '*/tool/*' -exec cp --parents '{}' "$gcno_obj_dir" ';'
149 cat << EOF > run-unittest.sh
156 echo "test_main start"
157 /usr/bin/vine-unittest
161 echo "teardown start"
173 mkdir -p %{buildroot}%{_bindir}/tizen-unittests/%{name}
174 install -m 0755 run-unittest.sh %{buildroot}%{_bindir}/tizen-unittests/%{name}/
179 LD_LIBRARY_PATH=%{buildroot}%{_libdir} tests/unittest/vine-unittest
180 lcov -c --ignore-errors graph --no-external -b . -d . -o %{name}.info
181 genhtml %{name}.info -o out --legend --show-details
184 %post -p /sbin/ldconfig
186 %postun -p /sbin/ldconfig
189 %manifest %{name}.manifest
191 %defattr(-,root,root,-)
195 %defattr(-,root,root,-)
196 %{_libdir}/pkgconfig/vine.pc
198 %if %{with lws_static} && %{without lws_static_prebuilt}
199 %{_includedir}/libwebsockets/*.h
200 %{_includedir}/libwebsockets/abstract/*.h
201 %{_includedir}/libwebsockets/abstract/protocols/*.h
202 %{_includedir}/libwebsockets/abstract/transports/*.h
203 %exclude %{_libdir}/pkgconfig/libwebsockets.pc
204 %exclude %{_libdir}/pkgconfig/libwebsockets_static.pc
209 %manifest %{name}.manifest
210 %attr(755,root,root) %{_bindir}/*
211 %attr(644,root,root) %{_datadir}/vine-verifier/certs/rootCA/ca.pem
212 %attr(644,root,root) %{_datadir}/vine-verifier/certs/server/*
216 %{_datadir}/gcov/obj/*
222 %{_bindir}/vine-unittest
223 %{_bindir}/tizen-unittests/%{name}/run-unittest.sh