BuildRequires: pkgconfig(capi-appfw-package-manager)
BuildRequires: pkgconfig(capi-appfw-app-manager)
BuildRequires: pkgconfig(capi-system-info)
+%if 0%{?gcov:1}
+BuildRequires: lcov
+%endif
+
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
#%description -n vpnsvc_test
#vpnsvc test package
+%if 0%{?gcov:1}
+%package gcov
+Summary: VPN service library(gcov)
+Group: Network/Testing
+%description gcov
+gcov objects for coverage test
+%endif
+
%prep
%setup -q
%build
+%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
+
export LDFLAGS+="-Wl,--rpath=%{_libdir}"
MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
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
+
%clean
rm -rf %{buildroot}
#%files -n vpnsvc_test
#%manifest test/vpnsvc-test.manifest
#%{_bindir}/vpnsvc_test
+
+%if 0%{?gcov:1}
+%files gcov
+%{_datadir}/gcov/obj/*
+%endif