From: DongHun Kwak Date: Mon, 1 Jul 2019 05:20:31 +0000 (+0900) Subject: Make gcov package X-Git-Tag: accepted/tizen/unified/20190702.114950^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F75%2F208875%2F1;p=platform%2Fcore%2Fapi%2Fbase-utils.git Make gcov package Change-Id: Ie9e538efff76eda16f3e73149481eda1ca541bdf Signed-off-by: DongHun Kwak --- diff --git a/packaging/capi-base-utils.spec b/packaging/capi-base-utils.spec index b987895..22646ce 100755 --- a/packaging/capi-base-utils.spec +++ b/packaging/capi-base-utils.spec @@ -35,19 +35,44 @@ Requires: capi-base-utils %description -n i18ninfo The base utils library test tool +# gcov +%if 0%{?gcov:1} +%package gcov +Summary: The Base Utils Tool(gcov) +Group: Base + +%description gcov +Base utils gcov objects +%endif + %prep %setup -q %build +%if 0%{?gcov:1} +export CFLAGS+=" -fprofile-arcs -ftest-coverage" +export CXXFLAGS+=" -fprofile-arcs -ftest-coverage" +export FFLAGS+=" -fprofile-arcs -ftest-coverage" +%endif cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DLIB_INSTALL_DIR:PATH=%{_libdir} -DINCLUDE_INSTALL_DIR:PATH=%{_includedir} \ -DPKG_NAME=%{name} -DPKG_VERSION=%{version} \ make %{?jobs:-j%jobs} +%if 0%{?gcov:1} +mkdir -p gcov-obj +find . -name '*.gcno' -exec cp '{}' gcov-obj ';' +%endif + %install rm -rf %{buildroot} %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 @@ -66,3 +91,7 @@ rm -rf %{buildroot} %defattr(-,root,root,-) %{_bindir}/i18ninfo +%if 0%{?gcov:1} +%files gcov +%{_datadir}/gcov/obj/* +%endif