-
Name: capi-web-url-download
Summary: CAPI for content download with web url
Version: 1.2.11
BuildRequires: pkgconfig(download-provider-interface)
BuildRequires: pkgconfig(capi-system-info)
BuildRequires: cmake
+%if 0%{?gcov:1}
+BuildRequires: lcov
+%endif
%description
CAPI for the content download
%description devel
CAPI for content downloading with web url (developement files)
+%if 0%{?gcov:1}
+%package gcov
+Summary: Download library(gcov)
+Group: Network/Testing
+%description gcov
+gcov objects for coverage test
+%endif
+
%prep
%setup -q
%build
-export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
-export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
-export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
+%if 0%{?gcov:1}
+export CFLAGS+=" -fprofile-arcs -ftest-coverage"
+export CXXFLAGS+=" -fprofile-arcs -ftest-coverage"
+export FFLAGS+=" -fprofile-arcs -ftest-coverage"
+export LDFLAGS+=" -lgcov"
+%endif
+
%cmake .
make %{?jobs:-j%jobs}
+%if 0%{?gcov:1}
+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 -p /sbin/ldconfig
%{_includedir}/web/download_product.h
%{_includedir}/web/download_private.h
%{_includedir}/web/download_doc.h
+
+%if 0%{?gcov:1}
+%files gcov
+%{_datadir}/gcov/obj/*
+%endif