From 9e644ff059e4efd3dde890b68c5697455670726a Mon Sep 17 00:00:00 2001 From: Youngjae Shin Date: Wed, 26 Jan 2022 15:05:05 +0900 Subject: [PATCH] revise gcov option on rpm spec Change-Id: I9082a7a64e048dc0482e6ae7279ffbcb4d1a0c28 --- packaging/capi-context.spec | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/packaging/capi-context.spec b/packaging/capi-context.spec index 038740d..d2870a8 100644 --- a/packaging/capi-context.spec +++ b/packaging/capi-context.spec @@ -27,13 +27,18 @@ Provides: context %description Tizen Context Framework Native API +%if "%{gcov}" == "0" +%global gcov 0 +%else +%{?gcov: %global gcov 1} +%{!?gcov: %global gcov 0} +%endif + %prep %setup -q %build -MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` - -%if 0%{?gcov:1} +%if %{gcov} export CFLAGS+=" -fprofile-arcs -ftest-coverage" export CXXFLAGS+=" -fprofile-arcs -ftest-coverage" export FFLAGS+=" -fprofile-arcs -ftest-coverage" @@ -45,9 +50,10 @@ export CXXFLAGS+=" -Wformat=2 -Wno-empty-body -fomit-frame-pointer -fno-optimize export CXXFLAGS+=" -fno-strict-aliasing -fno-unroll-loops -fsigned-char -fstrict-overflow" export CXXFLAGS+=" -Wnon-virtual-dtor -std=c++0x" +MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` %cmake . -DMAJORVER=${MAJORVER} -DFULLVER=%{version} make %{?_smp_mflags} -%if 0%{?gcov:1} +%if %{gcov} mkdir -p gcov-obj find . -name '*.gcno' -exec cp '{}' gcov-obj ';' %endif @@ -55,9 +61,9 @@ find . -name '*.gcno' -exec cp '{}' gcov-obj ';' %install %make_install -%if 0%{?gcov:1} -mkdir -p %{buildroot}%{_datadir}/gcov/obj -install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj +%if %{gcov} +mkdir -p %{buildroot}%{_datadir}/gcov/obj/%{name} +install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj/%{name} %endif # Backward compatibility @@ -101,10 +107,11 @@ Tizen Context Framework Testsuite %{_bindir}/context-test %license LICENSE -%if 0%{?gcov:1} +%if %{gcov} %package gcov Summary: Tizen Context Framework Native API (gcov) Group: Service Framework/Testing +BuildRequires: tar %description gcov gcov objects for coverage test -- 2.34.1