e3f74976e57b2ba3046db8ec6f5ac42227424700
[platform/core/api/component-manager.git] / packaging / capi-appfw-component-manager.spec
1 Name:       capi-appfw-component-manager
2 Summary:    Component Manager API
3 Version:    1.0.0
4 Release:    1
5 Group:      Application Framework/API
6 License:    Apache-2.0
7 Source0:    %{name}-%{version}.tar.gz
8
9 Requires(post): /sbin/ldconfig
10 Requires(postun): /sbin/ldconfig
11
12 BuildRequires:  cmake
13 BuildRequires:  pkgconfig(dlog)
14 BuildRequires:  pkgconfig(aul)
15 BuildRequires:  pkgconfig(capi-base-common)
16 BuildRequires:  pkgconfig(glib-2.0)
17 BuildRequires:  pkgconfig(gmock)
18
19 %if 0%{?gcov:1}
20 BuildRequires:  lcov
21 BuildRequires:  zip
22 %endif
23
24 %description
25 The Component Manager API provides functions to get information about running components.
26
27 %package devel
28 Summary:  Component Manager API (Development)
29 Group:    Application Framework/Libraries
30 Requires: %{name} = %{version}-%{release}
31
32 %description devel
33 The Component Manager API provides functions to get information about running components. (DEV)
34
35 #################################################
36 # unittests
37 #################################################
38 %package unittests
39 Summary:    GTest for Component Manager API
40 Group:      Development/Libraries
41 Requires:   %{name}
42
43 %description unittests
44 GTest for Component Manager API
45
46 #################################################
47 # gcov
48 #################################################
49 %if 0%{?gcov:1}
50 %package gcov
51 Summary:    Component Manager API (gcov)
52 Group:      Application Framework/Testing
53
54 %description gcov
55 Component Manager API gcov objects
56 %endif
57
58 %prep
59 %setup -q
60
61 %build
62 %if 0%{?gcov:1}
63 export CFLAGS+=" -fprofile-arcs -ftest-coverage"
64 export CXXFLAGS+=" -fprofile-arcs -ftest-coverage"
65 export FFLAGS+=" -fprofile-arcs -ftest-coverage"
66 export LDFLAGS+=" -lgcov"
67 %endif
68
69 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
70 %cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
71 %__make %{?jobs:-j%jobs}
72
73 %if 0%{?gcov:1}
74 mkdir -p gcov-obj
75 find . -name '*.gcno' -exec cp -rf '{}' gcov-obj ';'
76 %endif
77
78 %check
79 ctest --output-on-failure %{?_smp_mflags}
80 %if 0%{?gcov:1}
81 lcov -c --ignore-errors graph --no-external -q -d . -o component-manager.info
82 genhtml component-manager.info -o component-manager.out
83 zip -r component-manager.zip component-manager.out
84 install -m 0644 component-manager.zip %{buildroot}%{_datadir}/gcov/
85 %endif
86
87 %install
88 rm -rf %{buildroot}
89 %make_install
90
91 %if 0%{?gcov:1}
92 mkdir -p %{buildroot}%{_datadir}/gcov/obj
93 install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj
94 %endif
95
96 %post -p /sbin/ldconfig
97
98 %postun -p /sbin/ldconfig
99
100 %post unittests
101 %if 0%{?gcov:1}
102 %{_bindir}/compmgr_unittests
103 %endif
104
105 %files
106 %{_libdir}/libcapi-appfw-component-manager.so.*
107 %manifest %{name}.manifest
108 %license LICENSE
109
110 %files devel
111 %{_includedir}/appfw/*.h
112 %{_libdir}/libcapi-appfw-component-manager.so
113 %{_libdir}/pkgconfig/*.pc
114
115 #################################################
116 # unittests
117 #################################################
118 %files unittests
119 %{_bindir}/compmgr_unittests
120
121 #################################################
122 # team-gcov
123 #################################################
124 %if 0%{?gcov:1}
125 %files gcov
126 %{_datadir}/gcov/*
127 %endif