make a gcov package for measuring coverage easier
[platform/core/api/mtp.git] / packaging / capi-network-mtp.spec
1 Name:       capi-network-mtp
2 Summary:    A MTP library in Native API
3 Version:    1.3.19
4 Release:    1
5 Group:      Network & Connectivity/Other
6 License:    Apache-2.0
7 Source0:    %{name}-%{version}.tar.gz
8
9 BuildRequires:  cmake
10 BuildRequires:  pkgconfig(dlog)
11 BuildRequires:  pkgconfig(glib-2.0)
12 BuildRequires:  pkgconfig(gobject-2.0)
13 BuildRequires:  pkgconfig(capi-base-common)
14 BuildRequires:  pkgconfig(capi-system-info)
15 BuildRequires:  pkgconfig(sqlite3)
16 Buildrequires:  pkgconfig(libtzplatform-config)
17 BuildRequires:  python
18 Buildrequires:  python-xml
19
20 Requires(post): /sbin/ldconfig
21 Requires(postun): /sbin/ldconfig
22
23 %description
24
25 %package devel
26 Summary:  A MTP library in Native API (Development)
27 Group:    Network & Connectivity/Other
28 Requires: %{name} = %{version}-%{release}
29
30 %description devel
31
32 %if 0%{?gcov:1}
33 %package gcov
34 Summary:    A MTP gcov Tool
35 Group:      Network & Connectivity/Development
36
37 %description gcov
38 MTP gcov objects
39 %endif
40
41 %prep
42 %setup -q
43
44 %build
45
46 %if 0%{?gcov:1}
47 export LDFLAGS+=" -lgcov"
48 %endif
49
50 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
51
52 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \
53         -DLIB_INSTALL_DIR=%{_libdir} \
54         -DFULLVER=%{version} \
55         -DMAJORVER=${MAJORVER}\
56         -DBUILD_GCOV=%{?gcov:1}%{!?gcov:0}
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 rm -rf %{buildroot}
67
68 %make_install
69
70 %if 0%{?gcov:1}
71 mkdir -p %{buildroot}%{_datadir}/gcov/obj
72 install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj
73 %endif
74
75 %post -p /sbin/ldconfig
76
77 %postun -p /sbin/ldconfig
78
79
80 %files
81 %manifest capi-network-mtp.manifest
82 %license LICENSE.APLv2
83 %{_libdir}/libcapi-network-mtp.so*
84
85 %files devel
86 %{_includedir}/*.h
87 %{_libdir}/pkgconfig/*.pc
88 %{_libdir}/libcapi-network-mtp.so
89 %{_bindir}/mtp_unit_test
90
91 %if 0%{?gcov:1}
92 %files gcov
93 %{_datadir}/gcov/obj/*
94 %endif
95