%description
Client/Server library for updating badge information
-%prep
-%setup -q
-
%package devel
Summary: Badge library (devel)
Group: Development/Libraries
%description service-devel
Development files needed to build badge service
+%if 0%{?gcov:1}
+%package gcov
+Summary: Badge library (gcov)
+Group: System/API
+
+%description gcov
+gcov objects of a Badge library
+%endif
+
+%prep
+%setup -q
+
%build
-export LDFLAGS+="-Wl,--rpath=%{_prefix}/lib -Wl,--as-needed"
+%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=%{_prefix}/lib -Wl,--as-needed"
LDFLAGS="$LDFLAGS"
MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
%cmake . \
-DFULLVER=%{version}
make %{?jobs:-j%jobs}
+%if 0%{?gcov:1}
+mkdir -p gcov-obj
+find . -name '*.gcno' -exec cp '{}' gcov-obj ';'
+%endif
+
%install
+
%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
%{_includedir}/badge/badge_ipc.h
%{_libdir}/pkgconfig/%{name}.pc
%{_libdir}/libbadge.so
+
+
+%if 0%{?gcov:1}
+%files gcov
+%{_datadir}/gcov/obj/*
+%endif
+# End of a file