Release version 1.4.19
[platform/core/appfw/message-port.git] / packaging / message-port.spec
1 Name:       message-port
2 Summary:    Message Port library
3 Version:        1.4.19
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(openssl3)
17 BuildRequires:  pkgconfig(gmock)
18
19 %if 0%{?gcov:1}
20 BuildRequires:  lcov
21 %endif
22
23 Requires(post): /sbin/ldconfig
24 Requires(post): coreutils
25 Requires(postun): /sbin/ldconfig
26
27 Provides: capi-message-port
28 Provides: libcapi-message-port.so.1
29
30 %description
31 Message Port library package.
32
33 %package devel
34 Summary:  Message Port library (Development)
35 Group:    Application Framework/Development
36 Requires: %{name} = %{version}-%{release}
37
38 %description devel
39 Message Port library (Development) package.
40
41 %if 0%{?gcov:1}
42 %package gcov
43 Summary:  Message Port API(gcov)
44 Group:    Application Framework/Libraries
45
46 %description gcov
47 gcov objects of a message port library
48 %endif
49
50 %package unittests
51 Summary:    %{name} unittests binary
52
53 %description unittests
54 unittests binary
55
56 %prep
57 %setup -q
58 cp %{SOURCE1001} .
59
60 %build
61 %if 0%{?gcov:1}
62 export CFLAGS+=" -fprofile-arcs -ftest-coverage"
63 export CXXFLAGS+=" -fprofile-arcs -ftest-coverage"
64 export FFLAGS+=" -fprofile-arcs -ftest-coverage"
65 export LDFLAGS+=" -lgcov"
66 %endif
67
68 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
69 %cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
70 # Call make instruction with smp support
71 %__make %{?jobs:-j%jobs}
72
73 %install
74 rm -rf %{buildroot}
75
76 %make_install
77
78 %if 0%{?gcov:1}
79 builddir=$(basename $PWD)
80 gcno_obj_dir=%{buildroot}%{_datadir}/gcov/obj/%{name}/"$builddir"
81 mkdir -p "$gcno_obj_dir"
82 find . -name '*.gcno' -exec cp --parents '{}' "$gcno_obj_dir" ';'
83 %endif
84
85 cat << EOF > run-unittest.sh
86 #!/bin/sh
87 setup() {
88     echo "setup start"
89 }
90
91 test_main() {
92     echo "test_main start"
93     /usr/bin/message-port-unit-tests
94 }
95
96 teardown() {
97     echo "teardown start"
98 }
99
100 main() {
101     setup
102     test_main
103     teardown
104 }
105
106 main "\$*"
107 EOF
108
109 mkdir -p %{buildroot}%{_bindir}/tizen-unittests/%{name}
110 install -m 0755 run-unittest.sh %{buildroot}%{_bindir}/tizen-unittests/%{name}/
111
112 %check
113 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{_libdir}/
114 ctest -V
115
116 %if 0%{?gcov:1}
117 lcov -c --ignore-errors graph --no-external -b . -d . -o %{name}.info
118 genhtml %{name}.info -o out --legend --show-details
119 %endif
120
121 %post -p /sbin/ldconfig
122
123 %postun -p /sbin/ldconfig
124
125 %files
126 %manifest %{name}.manifest
127 %attr(0644,root,root) %{_libdir}/lib%{name}.so.*
128 %attr(0644,root,root) %{_libdir}/libcapi-message-port.so.*
129 %config %{_sysconfdir}/dbus-1/session.d/message-port.conf
130 %license LICENSE.APLv2
131
132 %files devel
133 %{_includedir}/appfw/*.h
134 %{_libdir}/pkgconfig/*.pc
135 %{_libdir}/lib%{name}.so
136
137 %files unittests
138 %attr(0755,root,root) %{_bindir}/message-port-unit-test
139 %attr(0755,root,root) %{_bindir}/tizen-unittests/%{name}/run-unittest.sh
140
141 %if 0%{?gcov:1}
142 %files gcov
143 %{_datadir}/gcov/*
144
145 %endif