Add coverage exception macros
[platform/core/api/video-util.git] / packaging / capi-media-video-util.spec
old mode 100755 (executable)
new mode 100644 (file)
index 86e2fac..a3a6974
@@ -1,11 +1,11 @@
 Name:       capi-media-video-util
 Summary:    A Video Utility library in Tizen Native API
-Version:    0.1.7
-Release:    5
+Version:    0.1.14
+Release:    0
 Group:      System/Libraries
-License:    Apache License, Version 2.0
+License:    Apache-2.0
 Source0:    %{name}-%{version}.tar.gz
-Source1001:    capi-media-video-util.manifest
+Source1001: capi-media-video-util.manifest
 BuildRequires:  pkgconfig(dlog)
 BuildRequires:  pkgconfig(mm-common)
 BuildRequires:  pkgconfig(mm-transcode)
@@ -18,7 +18,6 @@ BuildRequires:  gettext-devel
 %description
 A Video Utility library in Tizen Native API
 
-
 %package devel
 Summary:    A Video Utility library in Tizen Native API (Developement)
 Group:      TO_BE_FILLED
@@ -31,19 +30,43 @@ Requires:  pkgconfig(capi-base-common)
 %description devel
 A Video Utility library in Tizen Native API (Developement)
 
+%if 0%{?gcov:1}
+%package gcov
+Summary: Line Coverage of Video Utility library in Tizen C API
+Group: Development/Multimedia
+
+%description gcov
+Collection of files related to Line Coverage. It is tested as gcov for a video utility library in Tizen native API
+%endif
+
 %prep
 %setup -q
 cp %{SOURCE1001} .
 
 %build
+%if 0%{?gcov:1}
+export CFLAGS+=" -DTIZEN_EXCLUDE_COVERAGE -fprofile-arcs -ftest-coverage"
+export CXXFLAGS+=" -DTIZEN_EXCLUDE_COVERAG -fprofile-arcs -ftest-coverage"
+export FFLAGS+=" -DTIZEN_EXCLUDE_COVERAGE -fprofile-arcs -ftest-coverage"
+export LDFLAGS+=" -lgcov"
+%endif
+
 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
 %cmake . -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
 %make_install
-mkdir -p %{buildroot}/%{_datadir}/license
-cp -rf %{_builddir}/%{name}-%{version}/LICENSE.APLv2.0 %{buildroot}/%{_datadir}/license/%{name}
+mkdir -p %{buildroot}%{_bindir}
+cp test/video_util_test %{buildroot}%{_bindir}
+%if 0%{?gcov:1}
+mkdir -p %{buildroot}%{_datadir}/gcov/obj
+install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj
+%endif
 
 %post
 
@@ -52,7 +75,8 @@ cp -rf %{_builddir}/%{name}-%{version}/LICENSE.APLv2.0 %{buildroot}/%{_datadir}/
 %files
 %manifest %{name}.manifest
 %{_libdir}/lib*.so.*
-%{_datadir}/license/%{name}
+%license LICENSE.Apache-2.0
+%{_bindir}/*
 
 %files devel
 %manifest %{name}.manifest
@@ -60,3 +84,7 @@ cp -rf %{_builddir}/%{name}-%{version}/LICENSE.APLv2.0 %{buildroot}/%{_datadir}/
 %{_libdir}/pkgconfig/*.pc
 %{_includedir}/media/*.h
 
+%if 0%{?gcov:1}
+%files gcov
+%{_datadir}/gcov/obj/*
+%endif