Release version 1.4.7
[platform/core/appfw/message-port.git] / packaging / message-port.spec
1 Name:       message-port
2 Summary:    Message Port library
3 Version:        1.4.7
4 Release:    0
5 Group:          Application Framework/Libraries
6 License:    Apache-2.0
7 Source0:    %{name}-%{version}.tar.gz
8 Source1001:     %{name}.manifest
9 BuildRequires:  cmake
10 BuildRequires:  pkgconfig(dlog)
11 BuildRequires:  pkgconfig(bundle)
12 BuildRequires:  pkgconfig(glib-2.0)
13 BuildRequires:  pkgconfig(aul)
14 BuildRequires:  pkgconfig(pkgmgr)
15 BuildRequires:  pkgconfig(pkgmgr-info)
16 BuildRequires:  pkgconfig(openssl1.1)
17 BuildRequires:  pkgconfig(gmock)
18
19 %if 0%{?gcov:1}
20 BuildRequires:  lcov
21 BuildRequires:  zip
22 %endif
23
24 Requires(post): /sbin/ldconfig
25 Requires(post): coreutils
26 Requires(postun): /sbin/ldconfig
27
28 Provides: capi-message-port
29 Provides: libcapi-message-port.so.1
30
31 %description
32 Message Port library package.
33
34 %package devel
35 Summary:  Message Port library (Development)
36 Group:    Application Framework/Development
37 Requires: %{name} = %{version}-%{release}
38
39 %description devel
40 Message Port library (Development) package.
41
42 %if 0%{?gcov:1}
43 %package gcov
44 Summary:  Message Port API(gcov)
45 Group:    Application Framework/Libraries
46
47 %description gcov
48 gcov objects of a message port library
49 %endif
50
51 %prep
52 %setup -q
53 cp %{SOURCE1001} .
54
55 %build
56 %if 0%{?gcov:1}
57 export CFLAGS+=" -fprofile-arcs -ftest-coverage"
58 export CXXFLAGS+=" -fprofile-arcs -ftest-coverage"
59 export FFLAGS+=" -fprofile-arcs -ftest-coverage"
60 export LDFLAGS+=" -lgcov"
61 %endif
62
63 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
64 %cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
65 # Call make instruction with smp support
66 %__make %{?jobs:-j%jobs}
67
68 %if 0%{?gcov:1}
69 mkdir -p gcov-obj
70 find . -name '*.gcno' -exec cp '{}' gcov-obj ';'
71 %endif
72
73 %install
74 rm -rf %{buildroot}
75
76 %make_install
77
78 %if 0%{?gcov:1}
79 mkdir -p %{buildroot}%{_datadir}/gcov/obj
80 install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj
81 %endif
82
83 %check
84 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{_libdir}/
85 ctest -V
86
87 %if 0%{?gcov:1}
88 lcov -c --ignore-errors graph --no-external -q -d . -o message-port.info
89 genhtml message-port.info -o message-port.out
90 zip -r message-port.zip message-port.out
91 install -m 0644 message-port.zip %{buildroot}%{_datadir}/gcov/
92 %endif
93
94 %post -p /sbin/ldconfig
95
96 %postun -p /sbin/ldconfig
97
98 %files
99 %manifest %{name}.manifest
100 %attr(0644,root,root) %{_libdir}/lib%{name}.so.*
101 %attr(0644,root,root) %{_libdir}/libcapi-message-port.so.*
102 %config %{_sysconfdir}/dbus-1/session.d/message-port.conf
103 %license LICENSE.APLv2
104
105 %files devel
106 %{_includedir}/appfw/*.h
107 %{_libdir}/pkgconfig/*.pc
108 %{_libdir}/lib%{name}.so
109
110 %if 0%{?gcov:1}
111 %files gcov
112 %{_datadir}/gcov/*
113
114 %endif