Adding Tizen Coverage Automation
[platform/core/api/location-manager.git] / packaging / capi-location-manager.spec
1 Name: capi-location-manager
2 Summary: A Location Manager library in Tizen Native API
3 Version: 0.8.2
4 Release: 1
5 Group: Location/API
6 License: Apache-2.0
7 Source0: %{name}-%{version}.tar.gz
8 Source1001: %{name}.manifest
9 BuildRequires: cmake
10 BuildRequires: pkgconfig(dlog)
11 BuildRequires: pkgconfig(lbs-location)
12 BuildRequires: pkgconfig(capi-base-common)
13 BuildRequires: pkgconfig(capi-system-info)
14 BuildRequires: pkgconfig(vconf)
15 BuildRequires: pkgconfig(libtzplatform-config)
16 Requires(post): /sbin/ldconfig
17 Requires(postun): /sbin/ldconfig
18
19 %if 0%{?gcov:1}
20 BuildRequires:  lcov
21 %endif
22
23 %description
24 A Location Manager library in Tizen Native API
25
26
27 %package devel
28 Summary:  A Location Manager library in Tizen Native API (Development)
29 Group:    Location/Development
30 Requires: %{name} = %{version}-%{release}
31
32 %description devel
33 A Location Manager library in Tizen Native API (Development)
34
35 #################################################
36 # gcov
37 #################################################
38 %if 0%{?gcov:1}
39 %package gcov
40 Summary:    Location Manager (gcov)
41 Group:      Service Framework/Testing
42 %description gcov
43 gcov objects for coverage test
44 %endif
45
46 %prep
47 %setup -q
48 cp %{SOURCE1001} .
49
50 %build
51 %if 0%{?gcov:1}
52 export CFLAGS+=" -fprofile-arcs -ftest-coverage"
53 export CXXFLAGS+=" -fprofile-arcs -ftest-coverage"
54 export FFLAGS+=" -fprofile-arcs -ftest-coverage"
55 export LDFLAGS+=" -lgcov"
56 %endif
57 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
58 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DLIBDIR=%{_libdir} -DINCLUDEDIR=%{_includedir} \
59 -DFULLVER=%{version} -DMAJORVER=${MAJORVER} -DTZ_SYS_RO_PACKAGES=%{TZ_SYS_RO_PACKAGES} -DTZ_SYS_BIN=%{TZ_SYS_BIN} \
60
61 make %{?jobs:-j%jobs}
62 %if 0%{?gcov:1}
63 mkdir -p gcov-obj
64 find . -name '*.gcno' -exec cp '{}' gcov-obj ';'
65 %endif
66
67 %install
68 rm -rf %{buildroot}
69 %make_install
70
71 %if 0%{?gcov:1}
72 mkdir -p %{buildroot}%{_datadir}/gcov/obj
73 install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj
74 %endif
75
76 %post -p /sbin/ldconfig
77
78 %postun -p /sbin/ldconfig
79
80 %files
81 %manifest %{name}.manifest
82 %license LICENSE
83 %{_libdir}/libcapi-location-manager.so.*
84 %{_bindir}/location_test
85
86 %files devel
87 %{_includedir}/location/*.h
88 %{_libdir}/pkgconfig/*.pc
89 %{_libdir}/libcapi-location-manager.so
90
91 %if 0%{?gcov:1}
92 %files gcov
93 %{_datadir}/gcov/obj/*
94 %endif