summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoon.c.baek <joon.c.baek@samsung.com>2019-06-28 11:30:40 +0900
committerjoon.c.baek <joon.c.baek@samsung.com>2019-07-01 13:45:54 +0900
commit9003eb047d46ef36e2f19cd42d4a06bd95e974d4 (patch)
tree71f4a70caacbada7cd3351232baf393e4423ddea
parent4a87ccb85c870777655c4066a36dd11ba260ea6d (diff)
downloadttrace-9003eb047d46ef36e2f19cd42d4a06bd95e974d4.tar.gz
ttrace-9003eb047d46ef36e2f19cd42d4a06bd95e974d4.tar.bz2
ttrace-9003eb047d46ef36e2f19cd42d4a06bd95e974d4.zip
Change-Id: I8bc65b1d0767ad5cc940d6ebdb31cd622fca4c6f Signed-off-by: joon.c.baek <joon.c.baek@samsung.com>
-rw-r--r--packaging/ttrace.spec30
1 files changed, 30 insertions, 0 deletions
diff --git a/packaging/ttrace.spec b/packaging/ttrace.spec
index f922f60..5ee3a9e 100644
--- a/packaging/ttrace.spec
+++ b/packaging/ttrace.spec
@@ -48,16 +48,36 @@ Requires: %{name} = %{version}-%{release}
%description devel
T-trace library devel
+%if 0%{?gcov:1}
+%package gcov
+Summary: ttrace(gcov)
+Group: Development/Libraries
+%description gcov
+New T-trace library cov 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"
+export LDFLAGS+=" -lgcov"
+%endif
+
export CFLAGS="$CFLAGS -g -Wall -std=gnu99"
export CXXFLAGS="$CXXFLAGS -std=c++0x -fPIE -pie -fno-exceptions"
%cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DLIBDIR=%{_libdir} -DINCLUDEDIR=%{_includedir} \
-DTTRACE_PROFILE=%{TTRACE_PROFILE} -DTTRACE_TIZEN_VERSION_MAJOR=%{TTRACE_TIZEN_VERSION_MAJOR}
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
@@ -71,6 +91,11 @@ cp %{SOURCE103} %{buildroot}%{_bindir}
%install_service sysinit.target.wants ttrace-marker.service
%install_service sysinit.target.wants sys-kernel-debug-tracing.mount
+%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
@@ -95,3 +120,8 @@ cp %{SOURCE103} %{buildroot}%{_bindir}
%{_libdir}/libttrace.so
%{_libdir}/libttrace.a
%{_libdir}/pkgconfig/*.pc
+
+%if 0%{?gcov:1}
+%files gcov
+%{_datadir}/gcov/obj/*
+%endif