BuildRequires: pkgconfig(iotivity)
BuildRequires: pkgconfig(uuid)
BuildRequires: pkgconfig(cynara-client)
+%if 0%{?gcov:1}
+BuildRequires: lcov
+%endif
+
Requires(post): /usr/bin/chgrp, /usr/bin/chmod, /usr/bin/chsmack
%description test
Tizen IoT Connectivity Test Programs
+%if 0%{?gcov:1}
+%package gcov
+Summary: TizenIoT Connectivity library(gcov)
+Group: Connectivit/Testing
+%description gcov
+gcov objects for coverage test
+%endif
%prep
%setup -q
-DPRODUCT_TV=%{PRODUCT_TV} \
-DBUILD_GCOV=%{?gcov:1}%{!?gcov:0}
+%if 0%{?gcov:1}
+make %{?jobs:-j%jobs}
+
+mkdir -p gcov-obj
+find . -name '*.gcno' -exec cp '{}' gcov-obj ';'
+%endif
%install
rm -rf %{buildroot}
%make_install
+%if 0%{?gcov:1}
+mkdir -p %{buildroot}%{_datadir}/gcov/obj
+install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj
+%endif
%post
/sbin/ldconfig
%{_bindir}/iotcon-test-*
%license LICENSE.APLv2
+%if 0%{?gcov:1}
+%files gcov
+%{_datadir}/gcov/obj/*
+%endif