Release version 1.4.13
[platform/core/appfw/message-port.git] / packaging / message-port.spec
1 Name:       message-port
2 Summary:    Message Port library
3 Version:        1.4.13
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 %package unittests
52 Summary:    %{name} unittests binary
53
54 %description unittests
55 unittests binary
56
57 %prep
58 %setup -q
59 cp %{SOURCE1001} .
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 # Call make instruction with smp support
72 %__make %{?jobs:-j%jobs}
73
74 %install
75 rm -rf %{buildroot}
76
77 %make_install
78
79 %if 0%{?gcov:1}
80 builddir=$(basename $PWD)
81 gcno_obj_dir=%{buildroot}%{_datadir}/gcov/obj/%{name}/"$builddir"
82 mkdir -p "$gcno_obj_dir"
83 find . -name '*.gcno' -exec cp --parents '{}' "$gcno_obj_dir" ';'
84 %endif
85
86 %check
87 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{_libdir}/
88 ctest -V
89
90 %if 0%{?gcov:1}
91 builddir=$(basename $PWD)
92 gcno_obj_dir=%{buildroot}%{_datadir}/gcov/obj/%{name}/"$builddir"
93 mkdir -p "$gcno_obj_dir"
94 find . -name '*.gcno' -exec cp --parents '{}' "$gcno_obj_dir" ';'
95 %endif
96
97 cat << EOF > run-unittest.sh
98 #!/bin/sh
99 setup() {
100     echo "setup start"
101     %{_aulresdir}/tpk/install.sh
102 }
103
104 test_main() {
105     echo "test_main start"
106     /usr/bin/message-port-unit-tests
107 }
108
109 teardown() {
110     echo "teardown start"
111 }
112
113 main() {
114     setup
115     test_main
116     teardown
117 }
118
119 main "\$*"
120 EOF
121
122 mkdir -p %{buildroot}%{_bindir}/tizen-unittests/%{name}
123 install -m 0755 run-unittest.sh %{buildroot}%{_bindir}/tizen-unittests/%{name}/
124
125 %post -p /sbin/ldconfig
126
127 %postun -p /sbin/ldconfig
128
129 %files
130 %manifest %{name}.manifest
131 %attr(0644,root,root) %{_libdir}/lib%{name}.so.*
132 %attr(0644,root,root) %{_libdir}/libcapi-message-port.so.*
133 %config %{_sysconfdir}/dbus-1/session.d/message-port.conf
134 %license LICENSE.APLv2
135
136 %files devel
137 %{_includedir}/appfw/*.h
138 %{_libdir}/pkgconfig/*.pc
139 %{_libdir}/lib%{name}.so
140
141 %files unittests
142 %attr(0755,root,root) %{_bindir}/message-port-unit-test
143 %attr(0755,root,root) %{_bindir}/tizen-unittests/%{name}/run-unittest.sh
144
145 %if 0%{?gcov:1}
146 %files gcov
147 %{_datadir}/gcov/*
148
149 %endif