Add tv profile specific code
[platform/core/api/tethering.git] / packaging / capi-network-tethering.spec
index fdf00c4..f8b4f84 100644 (file)
@@ -1,6 +1,6 @@
 Name:          capi-network-tethering
 Summary:       Tethering Framework
-Version:       1.0.52
+Version:       1.1.2
 Release:       1
 Group:         System/Network
 License:       Apache-2.0
@@ -12,10 +12,14 @@ BuildRequires:      pkgconfig(glib-2.0)
 BuildRequires: pkgconfig(gio-2.0)
 BuildRequires: pkgconfig(vconf)
 BuildRequires: pkgconfig(key-manager)
-BuildRequires: pkgconfig(libssl)
 BuildRequires: pkgconfig(capi-system-info)
 BuildRequires: pkgconfig(libtzplatform-config)
+BuildRequires:  pkgconfig(gmock)
 BuildRequires: cmake
+%if 0%{?gcov:1}
+BuildRequires: lcov
+BuildRequires: tar
+%endif
 Requires(post):                /sbin/ldconfig
 Requires(postun):      /sbin/ldconfig
 
@@ -29,23 +33,59 @@ Requires:   %{name} = %{version}-%{release}
 %description devel
 Development package for Tethering framework library
 
+%package tool
+Summary:       Test application for Tethering
+%description tool
+Test application for Tethering
+
+%if 0%{?gcov:1}
+%package gcov
+Summary:  Tethering Library(gcov)
+Group:    Network/Testing
+%description gcov
+gcov objects for coverage test
+%endif
+
 %prep
 %setup -q
 
 
 %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
 
-%cmake .
+%if "%{?tizen_profile_name}" == "tv"
+export CFLAGS+=" -DTIZEN_TV_EXT"
+export CXXFLAGS+=" -DTIZEN_TV_EXT"
+%endif
 
+%cmake -DBUILD_GTESTS=%{?gcov:1}%{!?gcov:0} \
+       .
 make %{?_smp_mflags}
 
-
 %install
 %make_install
 
+%if 0%{?gcov:1}
+find .. -name '*.gcno' | tar cf %{name}-gcov.tar -T -
+install -d -m 755 %{buildroot}%{_datadir}/gcov/obj
+tar xf %{name}-gcov.tar -C %{buildroot}%{_datadir}/gcov/obj
+%endif
+
+%check
+%if 0%{?gcov:1}
+tests/tethering-gtest
+%endif
+
+%if 0%{?gcov:1}
+lcov -c --ignore-errors graph --no-external -b . -d . -o %{name}.info
+genhtml %{name}.info -o out --legend --show-details
+%endif
+
 %post -p /sbin/ldconfig
 
 %postun -p /sbin/ldconfig
@@ -54,7 +94,6 @@ make %{?_smp_mflags}
 %manifest capi-network-tethering.manifest
 %defattr(-,root,root,-)
 %{_libdir}/*.so.*
-%{_bindir}/tethering_test
 %license LICENSE
 
 %files devel
@@ -63,3 +102,11 @@ make %{?_smp_mflags}
 %{_libdir}/pkgconfig/*.pc
 %{_libdir}/*.so
 %license LICENSE
+
+%files tool
+%{_bindir}/tethering_test
+
+%if 0%{?gcov:1}
+%files gcov
+%{_datadir}/gcov/obj/*
+%endif