License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
-BuildRequires: cmake
-
# Maps API dependencies
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(gmodule-2.0)
Requires(postun): /sbin/ldconfig
Provides: capi-maps-service-plugin-devel
+BuildRequires: cmake
+
+%if 0%{?gcov:1}
+BuildRequires: lcov
+%endif
+
%ifarch %{arm}
%define ARCH arm
%else
%description
This provides the Tizen Map Service API to access and handle the map data.
+#################################################
+# gcov
+#################################################
+%if 0%{?gcov:1}
+%package gcov
+Summary: Account library (gcov)
+Group: Service Framework/Testing
+%description gcov
+gcov objects for coverage test
+%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 -DTIZEN_ENGINEER_MODE"
export CXXFLAGS="$CXXFLAGS -DTIZEN_ENGINEER_MODE"
export FFLAGS="$FFLAGS -DTIZEN_ENGINEER_MODE"
cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DMAJORVER=${MAJORVER} -DFULLVER=%{version} \
-DLIBDIR=%{_libdir} -DTIZEN_VER=0x030000
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
mkdir -p %{_libdir}/maps/plugins
# privilege mapping for Tizen 3.x
%defattr(-,root,root,-)
%{_bindir}/%{name}-test
+%if 0%{?gcov:1}
+%files gcov
+%{_datadir}/gcov/obj/*
+%endif