Name: capi-media-codec
Summary: A Media Codec library in Tizen Native API
-Version: 0.5.13
-Release: 0
+Version: 0.6.4
+Release: 1
Group: Multimedia/API
License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
BuildRequires: pkgconfig(gstreamer-app-1.0)
BuildRequires: pkgconfig(capi-system-info)
BuildRequires: pkgconfig(iniparser)
+%if "%{tizen_profile_name}" != "tv"
BuildRequires: pkgconfig(mm-resource-manager)
+%endif
#BuildRequires: pkgconfig(capi-media-camera)
#BuildRequires: pkgconfig(capi-mediademuxer)
#BuildRequires: pkgconfig(capi-mediamuxer)
%description devel
+%if 0%{?gcov:1}
+%package gcov
+Summary: Line Coverage of Media Codec library in Tizen Native API
+Group: Development/Multimedia
+
+%description gcov
+Collection of files related to Line Coverage. It is tested as gcov for a media codec library in Tizen native API
+%endif
+
%prep
%setup -q
export CFLAGS="$CFLAGS -DSYSCONFDIR=\\\"%{_sysconfdir}\\\""
-MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
-%cmake . -DCMAKE_INSTALL_PREFIX=/usr -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
+%if 0%{?gcov:1}
+export CFLAGS+=" -fprofile-arcs -ftest-coverage"
+export CXXFLAGS+=" -fprofile-arcs -ftest-coverage"
+export LDFLAGS+=" -lgcov"
+%endif
+MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
+%cmake . -DCMAKE_INSTALL_PREFIX=/usr -DFULLVER=%{version} -DMAJORVER=${MAJORVER} \
+%if "%{tizen_profile_name}" == "tv"
+ -DTIZEN_FEATURE_MM_RESOURCE_MANAGER=NO
+%else
+ -DTIZEN_FEATURE_MM_RESOURCE_MANAGER=YES
+%endif
make %{?jobs:-j%jobs}
+%if 0%{?gcov:1}
+mkdir -p gcov-obj
+find . -name '*.gcno' -exec cp '{}' gcov-obj ';'
+%endif
+
%install
rm -rf %{buildroot}
mkdir -p %{buildroot}/usr/bin
%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
%{_libdir}/pkgconfig/*.pc
%{_libdir}/libcapi-media-codec.so
+%if 0%{?gcov:1}
+%files gcov
+%{_datadir}/gcov/obj/*
+%endif