Name: capi-media-camera
Summary: A Camera API
Version: 0.4.25
-Release: 0
+Release: 1
Group: Multimedia/API
License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
%description tool
Tizen Native camera API testsuite.
+%if 0%{?gcov:1}
+%package gcov
+Summary: Line Coverage of Camera library in Tizen Native API
+Group: Development/Multimedia
+
+%description gcov
+Collection of files related to Line Coverage. It is teseted as gcov for a camera library in Tizen native API
+%endif
+
%prep
%setup -q
%if 0%{?sec_build_binary_debug_enable}
export CFLAGS+=" -DTIZEN_DEBUG_ENABLE"
%endif
+%if 0%{?gcov:1}
+export CFLAGS+=" -fprofile-arcs -ftest-coverage"
+export LDFLAGS+=" -lgcov"
+%endif
MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
%cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
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
%license LICENSE.APLv2
%{_bindir}/*
+%if 0%{?gcov:1}
+%files gcov
+%{_datadir}/gcov/obj/*
+%endif
+