Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
+%if 0%{?gcov:1}
+BuildRequires: lcov
+%endif
+
%description
Tizen oauth 2.0 Framework
%description devel
Development files for %{name}
+#################################################
+# gcov
+#################################################
+%if 0%{?gcov:1}
+%package gcov
+Summary: Oauth Framework (gcov)
+Group: Service Framework/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
+
%if 0%{?sec_build_binary_debug_enable}
export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
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
mkdir -p %{buildroot}%{_libdir}
rm -rf %{buildroot}%{_libdir}/oauth2
%{_libdir}/*.so
%{_includedir}/*.h
%{_libdir}/pkgconfig/oauth2.pc
+
+%if 0%{?gcov:1}
+%files gcov
+%{_datadir}/gcov/obj/*
+%endif
+