3732f1e01f6d1ae01e9e4ce7e82ef9f07036db56
[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.2.1
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 export LD_LIBRARY_PATH=../../src/
80 ctest --verbose %{?_smp_mflags}
81 %if 0%{?gcov:1}
82 lcov -c --ignore-errors graph --no-external -q -d . -o component-manager.info
83 genhtml component-manager.info -o component-manager.out
84 zip -r component-manager.zip component-manager.out
85 install -m 0644 component-manager.zip %{buildroot}%{_datadir}/gcov/
86 %endif
87
88 %install
89 rm -rf %{buildroot}
90 %make_install
91
92 %if 0%{?gcov:1}
93 mkdir -p %{buildroot}%{_datadir}/gcov/obj
94 install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj
95 %endif
96
97 %post -p /sbin/ldconfig
98
99 %postun -p /sbin/ldconfig
100
101 %post unittests
102 %if 0%{?gcov:1}
103 %{_bindir}/component-manager-unit-test
104 %endif
105
106 %files
107 %{_libdir}/libcapi-appfw-component-manager.so.*
108 %manifest %{name}.manifest
109 %license LICENSE
110
111 %files devel
112 %{_includedir}/appfw/*.h
113 %{_libdir}/libcapi-appfw-component-manager.so
114 %{_libdir}/pkgconfig/*.pc
115
116 #################################################
117 # component-manager-gcov
118 #################################################
119 %if 0%{?gcov:1}
120 %files gcov
121 %{_datadir}/gcov/*
122 %endif