Adding Tizen Coverage Automation
[platform/core/api/location-manager.git] / packaging / capi-location-manager.spec
old mode 100755 (executable)
new mode 100644 (file)
index 7842f31..28f1e85
@@ -1,6 +1,6 @@
 Name: capi-location-manager
 Summary: A Location Manager library in Tizen Native API
-Version: 0.6.3
+Version: 0.8.2
 Release: 1
 Group: Location/API
 License: Apache-2.0
@@ -12,9 +12,14 @@ BuildRequires: pkgconfig(lbs-location)
 BuildRequires: pkgconfig(capi-base-common)
 BuildRequires: pkgconfig(capi-system-info)
 BuildRequires: pkgconfig(vconf)
+BuildRequires: pkgconfig(libtzplatform-config)
 Requires(post): /sbin/ldconfig
 Requires(postun): /sbin/ldconfig
 
+%if 0%{?gcov:1}
+BuildRequires:  lcov
+%endif
+
 %description
 A Location Manager library in Tizen Native API
 
@@ -27,29 +32,46 @@ Requires: %{name} = %{version}-%{release}
 %description devel
 A Location Manager library in Tizen Native API (Development)
 
+#################################################
+# gcov
+#################################################
+%if 0%{?gcov:1}
+%package gcov
+Summary:    Location Manager (gcov)
+Group:      Service Framework/Testing
+%description gcov
+gcov objects for coverage test
+%endif
 
 %prep
 %setup -q
 cp %{SOURCE1001} .
 
 %build
-
-export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
-export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
-export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
-
+%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
 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DLIBDIR=%{_libdir} -DINCLUDEDIR=%{_includedir} \
--DFULLVER=%{version} -DMAJORVER=${MAJORVER} \
+-DFULLVER=%{version} -DMAJORVER=${MAJORVER} -DTZ_SYS_RO_PACKAGES=%{TZ_SYS_RO_PACKAGES} -DTZ_SYS_BIN=%{TZ_SYS_BIN} \
 
 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
 
-#mkdir -p %{buildroot}/usr/share/license
-#cp LICENSE %{buildroot}/usr/share/license/%{name}
+%if 0%{?gcov:1}
+mkdir -p %{buildroot}%{_datadir}/gcov/obj
+install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj
+%endif
 
 %post -p /sbin/ldconfig
 
@@ -59,24 +81,14 @@ rm -rf %{buildroot}
 %manifest %{name}.manifest
 %license LICENSE
 %{_libdir}/libcapi-location-manager.so.*
+%{_bindir}/location_test
 
 %files devel
 %{_includedir}/location/*.h
 %{_libdir}/pkgconfig/*.pc
 %{_libdir}/libcapi-location-manager.so
 
-
-%if 1
-%package test
-Summary:    Test application of Location Manager
-Group:      Location/Testing
-Requires: %{name} = %{version}-%{release}
-
-%description test
-Test application of Location Manager
-
-%files test
-%manifest test/capi-location-manager-test.manifest
-/usr/share/packages/capi-location-manager-test.xml
-/opt/usr/devel/location/location_test
+%if 0%{?gcov:1}
+%files gcov
+%{_datadir}/gcov/obj/*
 %endif