Make gcov package
[platform/core/api/device.git] / packaging / capi-system-device.spec
1 Name:       capi-system-device
2 Summary:    A Device library in TIZEN C API
3 Version:    0.1.0
4 Release:    0
5 Group:      System/API
6 License:    Apache-2.0
7 Source0:    %{name}-%{version}.tar.gz
8 Source1:    capi-system-device.manifest
9 BuildRequires:  cmake
10 BuildRequires:  pkgconfig(capi-base-common)
11 BuildRequires:  pkgconfig(capi-system-info)
12 BuildRequires:  pkgconfig(dlog)
13 BuildRequires:  pkgconfig(vconf)
14 BuildRequires:  pkgconfig(gio-2.0)
15 BuildRequires:  pkgconfig(tracker)
16 %if 0%{?gcov:1}
17 BuildRequires:  lcov
18 %endif
19
20 %description
21 A Device library in TIZEN C API package.
22
23 %package devel
24 Summary:  A Device library in TIZEN C API (Development)
25 Group:    System/Development
26 Requires: %{name} = %{version}-%{release}
27
28 %description devel
29 A Device library in TIZEN C API (Development) package.
30 %devel_desc
31
32 %if 0%{?gcov:1}
33 %package gcov
34 Summary:    A Device library in TIZEN C API (gcov)
35 Group:      System/Libraries
36
37 %description gcov
38 A Device library in TIZEN C API (gcov)
39 %endif
40
41 %prep
42 %setup -q
43
44 %build
45 %if 0%{?gcov:1}
46 export CFLAGS+=" -fprofile-arcs -ftest-coverage"
47 export LDFLAGS+=" -lgcov"
48 %endif
49
50 cp %{SOURCE1} .
51 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
52 %cmake . -DFULLVER=%{version} \
53                  -DMAJORVER=${MAJORVER}
54
55 %__make %{?jobs:-j%jobs}
56
57 %if 0%{?gcov:1}
58 mkdir -p gcov-obj
59 find . -name '*.gcno' -exec cp '{}' gcov-obj ';'
60 %endif
61
62 %install
63 %make_install
64
65 %if 0%{?gcov:1}
66 mkdir -p %{buildroot}%{_datadir}/gcov/obj
67 install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj
68 %endif
69
70 %post -p /sbin/ldconfig
71
72 %postun -p /sbin/ldconfig
73
74 %files
75 %manifest %{name}.manifest
76 %license LICENSE.Apache-2.0
77 %{_libdir}/libcapi-system-device.so.*
78 /etc/deviced/device/*.conf
79
80 %files devel
81 %manifest %{name}.manifest
82 %license LICENSE.Apache-2.0
83 %{_includedir}/device/*.h
84 %{_includedir}/system/*.h
85 %{_libdir}/pkgconfig/*.pc
86 %{_libdir}/libcapi-system-device.so
87
88 %if 0%{?gcov:1}
89 %files gcov
90 %{_datadir}/gcov/*
91 %endif