add gcno data for gcov
[platform/core/api/efl-util.git] / packaging / capi-ui-efl-util.spec
index bd4acc8..7a26e9d 100644 (file)
@@ -33,6 +33,15 @@ Requires: %{name} = %{version}-%{release}
 %description devel
 %devel_desc
 
+%if 0%{?gcov:1}
+%package gcov
+Summary: efl-util gcov data package
+Group: Development/Libraries
+
+%description gcov
+efl-util gcno data for gcov
+%endif
+
 %prep
 %setup -q
 cp %{SOURCE1001} .
@@ -44,13 +53,27 @@ sed -i 's/\$TZ_CFG_VER_24_OR_231\$/@if WEARABLE 2.3.1 @else 2.4 @endif/g'   incl
 %build
 export CFLAGS+=" -DEFL_BETA_API_SUPPORT "
 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
-%cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER} \
+%if 0%{?gcov:1}
+%cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER} -DEFLUTILGCOV=ON \
+%else
+%cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER} -DEFLUTILGCOV=OFF \
+%endif
 
 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
@@ -68,3 +91,8 @@ make %{?jobs:-j%jobs}
 %{_libdir}/pkgconfig/*.pc
 %{_libdir}/libcapi-ui-efl-util.so
 %exclude %{_includedir}/ui/config.h
+
+%if 0%{?gcov:1}
+%files gcov
+%{_datadir}/gcov/obj/*
+%endif