Add gtest for line coverage
[platform/core/api/tethering.git] / packaging / capi-network-tethering.spec
1 Name:           capi-network-tethering
2 Summary:        Tethering Framework
3 Version:        1.0.57
4 Release:        1
5 Group:          System/Network
6 License:        Apache-2.0
7 Source0:        %{name}-%{version}.tar.gz
8 BuildRequires:  pkgconfig(dlog)
9 BuildRequires:  pkgconfig(dbus-1)
10 BuildRequires:  pkgconfig(capi-base-common)
11 BuildRequires:  pkgconfig(glib-2.0)
12 BuildRequires:  pkgconfig(gio-2.0)
13 BuildRequires:  pkgconfig(vconf)
14 BuildRequires:  pkgconfig(key-manager)
15 BuildRequires:  pkgconfig(capi-system-info)
16 BuildRequires:  pkgconfig(libtzplatform-config)
17 BuildRequires:  pkgconfig(gmock)
18 BuildRequires:  cmake
19 %if 0%{?gcov:1}
20 BuildRequires: lcov
21 BuildRequires: tar
22 %endif
23 Requires(post):         /sbin/ldconfig
24 Requires(postun):       /sbin/ldconfig
25
26 %description
27 Tethering framework library for CAPI
28
29 %package devel
30 Summary:        Development package for Tethering framework library
31 Group:          Development/Libraries
32 Requires:       %{name} = %{version}-%{release}
33 %description devel
34 Development package for Tethering framework library
35
36 %package tool
37 Summary:        Test application for Tethering
38 %description tool
39 Test application for Tethering
40
41 %if 0%{?gcov:1}
42 %package gcov
43 Summary:  Tethering Library(gcov)
44 Group:    Network/Testing
45 %description gcov
46 gcov objects for coverage test
47 %endif
48
49 %prep
50 %setup -q
51
52
53 %build
54 %if 0%{?gcov:1}
55 export CFLAGS+=" -fprofile-arcs -ftest-coverage"
56 export CXXFLAGS+=" -fprofile-arcs -ftest-coverage"
57 export FFLAGS+=" -fprofile-arcs -ftest-coverage"
58 export LDFLAGS+=" -lgcov"
59 %endif
60
61 %cmake .
62
63 make %{?_smp_mflags}
64
65 %install
66 %make_install
67
68 %if 0%{?gcov:1}
69 find .. -name '*.gcno' | tar cf %{name}-gcov.tar -T -
70 install -d -m 755 %{buildroot}%{_datadir}/gcov/obj
71 tar xf %{name}-gcov.tar -C %{buildroot}%{_datadir}/gcov/obj
72 %endif
73
74 %check
75 tests/tethering-gtest
76
77 %if 0%{?gcov:1}
78 lcov -c --ignore-errors graph --no-external -b . -d . -o %{name}.info
79 genhtml %{name}.info -o out --legend --show-details
80 %endif
81
82 %post -p /sbin/ldconfig
83
84 %postun -p /sbin/ldconfig
85
86 %files
87 %manifest capi-network-tethering.manifest
88 %defattr(-,root,root,-)
89 %{_libdir}/*.so.*
90 %license LICENSE
91
92 %files devel
93 %defattr(-,root,root,-)
94 %{_includedir}/network/*.h
95 %{_libdir}/pkgconfig/*.pc
96 %{_libdir}/*.so
97 %license LICENSE
98
99 %files tool
100 %{_bindir}/tethering_test
101
102 %if 0%{?gcov:1}
103 %files gcov
104 %{_datadir}/gcov/obj/*
105 %endif