Apply requirement for gcov automation
[platform/core/api/runtime-info.git] / packaging / capi-system-runtime-info.spec
1 Name:       capi-system-runtime-info
2 Summary:    A Runtime Information library in Core API
3 Version:    0.5.2
4 Release:    1
5 Group:      System/API
6 License:    Apache-2.0
7 Source0:    %{name}-%{version}.tar.gz
8 Source1001:     %{name}.manifest
9
10 BuildRequires:  cmake
11 BuildRequires:  pkgconfig(dlog)
12 BuildRequires:  pkgconfig(vconf)
13 BuildRequires:  pkgconfig(capi-base-common)
14 BuildRequires:  pkgconfig(capi-system-info)
15 BuildRequires:  pkgconfig(glib-2.0)
16 BuildRequires:  pkgconfig(libsyscommon)
17 BuildRequires:  pkgconfig(hal-api-common)
18 BuildRequires:  pkgconfig(hal-api-device)
19 Requires(post): /sbin/ldconfig
20 Requires(postun): /sbin/ldconfig
21
22 %description
23
24
25 %package devel
26 Summary:  A Runtime Information library in Core API (Development)
27 Group:    Development/System
28 Requires: %{name} = %{version}-%{release}
29 Requires:  pkgconfig(capi-base-common)
30
31 %description devel
32 %devel_desc
33
34
35 %package test
36 Summary:  A Runtime Information test binary
37 Requires: %{name} = %{version}-%{release}
38 Requires: memps
39
40 %description test
41 Binary for testing Runtime-info APIs
42
43
44 %if 0%{?gcov:1}
45 %package gcov
46 Summary:  A Runtime Information gcov test file
47 %description gcov
48 gcno files for Runtime-info line coverage test
49 %endif
50
51
52 %prep
53 %setup -q
54 cp %{SOURCE1001} .
55
56
57 %build
58 %if 0%{?gcov:1}
59 export CFLAGS+=" -fprofile-arcs -ftest-coverage"
60 export CXXFLAGS+=" -fprofile-arcs -ftest-coverage"
61 export FFLAGS+=" -fprofile-arcs -ftest-coverage"
62 export LDFLAGS+=" -lgcov"
63 %endif
64
65 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
66 %cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER} -DGCOV=%{?gcov:1}%{!?gcov:0}
67
68 make %{?jobs:-j%jobs}
69
70 %install
71 %make_install
72
73 %if 0%{?gcov:1}
74 builddir=$(basename $PWD)
75 gcno_obj_dir=%{buildroot}%{_datadir}/gcov/obj/%{name}/"$builddir"
76 mkdir -p "$gcno_obj_dir"
77 find . -name '*.gcno' -exec cp --parents '{}' "$gcno_obj_dir" ';'
78 %endif
79
80
81 %post -p /sbin/ldconfig
82
83 %postun -p /sbin/ldconfig
84
85 %files
86 %manifest %{name}.manifest
87 %license LICENSE.APLv2
88 %{_libdir}/lib*.so.*
89
90 %files devel
91 %{_includedir}/system/runtime_info.h
92 %{_includedir}/system/runtime_info-internal.h
93 %{_libdir}/pkgconfig/*.pc
94 %{_libdir}/lib*.so
95
96 %files test
97 %attr(700,root,root) %{_bindir}/runtime-info-test
98
99 %if 0%{?gcov:1}
100 %files gcov
101 %{_datadir}/gcov/obj/*
102 %endif