Name: capi-system-runtime-info
Summary: A Runtime Information library in Core API
-Version: 0.0.4
-Release: 2
+Version: 0.5.2
+Release: 1
Group: System/API
License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
Binary for testing Runtime-info APIs
+%if 0%{?gcov:1}
+%package -n runtime-info-gcov
+Summary: A Runtime Information gcov test file
+%description -n runtime-info-gcov
+gcno files for Runtime-info line coverage test
+%endif
+
+
%prep
%setup -q
cp %{SOURCE1001} .
+
%build
MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
-%cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
-
+%cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER} -DGCOV=%{?gcov:1}%{!?gcov:0}
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 -p /sbin/ldconfig
%postun -p /sbin/ldconfig
-
%files
%manifest %{name}.manifest
%license LICENSE.APLv2
%files test
%attr(700,root,root) %{_bindir}/runtime-info-test
+
+%if 0%{?gcov:1}
+%files -n runtime-info-gcov
+%{_datadir}/gcov/obj/*
+%endif