summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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