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