Add the module name in the gcov install path
[platform/core/telephony/libtapi.git] / packaging / libtapi.spec
1 %define major 0
2 %define minor 9
3 %define patchlevel 0
4
5 Name:           libtapi
6 Version:        %{major}.%{minor}.%{patchlevel}
7 Release:        2
8 License:        Apache-2.0
9 Summary:        Telephony dbus client library
10 Group:          System/Libraries
11 Source0:        libslp-tapi-%{version}.tar.gz
12 BuildRequires:  cmake
13 BuildRequires:  pkgconfig(dlog)
14 BuildRequires:  pkgconfig(glib-2.0)
15 BuildRequires:  pkgconfig(vconf)
16 BuildRequires:  pkgconfig(capi-system-info)
17 BuildRequires:  pkgconfig(gmock)
18 Requires(post): /sbin/ldconfig
19 Requires(postun): /sbin/ldconfig
20
21 %if 0%{?gcov:1}
22 BuildRequires: lcov
23 %endif
24
25 %description
26 Telephony client API library
27
28 %package devel
29 Summary:        Telephony client API (devel)
30 Group:          Development/Libraries
31 Requires:       %{name} = %{version}
32
33 %description devel
34 Telephony client API library (devel)
35
36 %package haltests
37 Summary:        tapi extension for HAL test
38 Requires:       %{name} = %{version}-%{release}
39 %description haltests
40 libtcore extension for HAL test.
41
42 %if 0%{?gcov:1}
43 %package gcov
44 Summary:  tapi client API library(gcov)
45 Group:    Developement/Libraries
46 %description gcov
47 gcov objects for coverage test
48 %endif
49
50 %prep
51 %setup -q
52
53 %build
54 export LDFLAGS+=" -Wl,-z,nodelete "
55
56 export CFLAGS="$CFLAGS -DTIZEN_ENGINEER_MODE"
57 export CXXFLAGS="$CXXFLAGS -DTIZEN_ENGINEER_MODE"
58 export FFLAGS="$FFLAGS -DTIZEN_ENGINEER_MODE"
59
60 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
61 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
62 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
63
64 %if 0%{?gcov:1}
65 export CFLAGS+=" -fprofile-arcs -ftest-coverage"
66 export CXXFLAGS+=" -fprofile-arcs -ftest-coverage"
67 export FFLAGS+=" -fprofile-arcs -ftest-coverage"
68 export LDFLAGS+=" -lgcov"
69 %endif
70
71 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \
72         -DLIB_INSTALL_DIR=%{_libdir} \
73         -DTIZEN_ENGINEER_MODE=1 \
74         -DBUILD_GCOV=%{?gcov:1}%{!?gcov:0}
75
76 make %{?_smp_mflags}
77
78 %if 0%{?gcov:1}
79 mkdir -p gcov-obj
80 find . -name '*.gcno' -exec cp '{}' gcov-obj ';'
81 %endif
82
83 %install
84 %make_install
85
86 %if 0%{?gcov:1}
87 mkdir -p %{buildroot}%{_datadir}/gcov/obj/%{name}
88 install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj/%{name}/
89 %endif
90
91 rm -rf %{buildroot}%{_includedir}/telephony/tapi/.gitignore
92
93 %post -p /sbin/ldconfig
94
95 %postun -p /sbin/ldconfig
96
97
98 %files
99 %manifest libtapi.manifest
100 %defattr(644,root,root,-)
101 #%doc COPYING
102 #%attr(755,root,root) %{_bindir}/tapitest
103 %{_libdir}/*.so.*
104 %license LICENSE
105
106 %files devel
107 %defattr(644,root,root,-)
108 %{_includedir}/telephony-client/*.h
109 %{_libdir}/pkgconfig/*.pc
110 %{_libdir}/*.so
111
112 %files haltests
113 %manifest libtapi.manifest
114 %{_bindir}/hal/telephony-haltests
115 %{_libdir}/*.so
116
117 %if 0%{?gcov:1}
118 %files gcov
119 %{_datadir}/gcov/obj/*
120 %endif