From: Dongsun Lee Date: Fri, 8 Nov 2019 03:00:28 +0000 (+0900) Subject: Make gcov package when --define 'gcov ON' is given X-Git-Tag: submit/tizen/20191108.073429^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F50%2F217250%2F1;p=platform%2Fcore%2Fsecurity%2Fyaca.git Make gcov package when --define 'gcov ON' is given Change-Id: I2268f6cbf22565b712a7af5038ceb6d222a06772 Signed-off-by: Dongsun Lee --- diff --git a/packaging/yaca.spec b/packaging/yaca.spec index 665da8c..538f47c 100644 --- a/packaging/yaca.spec +++ b/packaging/yaca.spec @@ -9,6 +9,9 @@ BuildRequires: cmake BuildRequires: python3 >= 3.4 BuildRequires: pkgconfig(capi-base-common) BuildRequires: pkgconfig(openssl1.1) +%if 0%{?gcov:1} +BuildRequires: lcov +%endif Requires(post): /sbin/ldconfig Requires(postun): /sbin/ldconfig @@ -31,13 +34,34 @@ The package provides Yet Another Crypto API. %build %{!?build_type:%define build_type "RELEASE"} -%cmake . -DCMAKE_BUILD_TYPE=%{build_type} +%if 0%{?gcov:1} +export CFLAGS+=" -fprofile-arcs -ftest-coverage" +export CXXFLAGS+=" -fprofile-arcs -ftest-coverage" +export FFLAGS+=" -fprofile-arcs -ftest-coverage" +export LDFLAGS+=" -lgcov" +%endif + +%cmake . -DCMAKE_BUILD_TYPE=%{build_type} \ + -DBUILD_GCOV={?gcov:1}%{!?gcov:0} + make -k %{?jobs:-j%jobs} +%if 0%{?gcov:1} +mkdir -p gcov-obj +find . \( -name '*.gcno' ! -name 'tc_*' \) -exec cp '{}' gcov-obj ';' +%endif + + %install %make_install %py3_compile %{buildroot}/%{python3_sitearch} +%if 0%{?gcov:1} +mkdir -p %{buildroot}%{_datadir}/gcov/obj +install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj +%endif + + %clean rm -rf %{buildroot} @@ -79,3 +103,17 @@ The package provides Yet Another Crypto API bindings for Python3. %files -n python3-yaca %{python3_sitearch}/%{name} + +## gcov Package ############################################################ +%if 0%{?gcov:1} +%package gcov +Summary: yaca gcov for measuring test coverage +Group: Secureity/Testing +%description gcov +New yaca gcov objects + +%files gcov +%{_datadir}/gcov/obj/* +%endif + +