9355f32eaef1db91b4b5939b6b28d2bb1c376a31
[platform/core/uifw/aurum.git] / packaging / aurum.spec
1 Name:           aurum
2 Version:        0.1.1
3 Release:        0
4 License:        Apache-2.0
5 Summary:        Automation framework for Ui testing
6 Group:          UI Framework
7 Source:         %{name}-%{version}.tar.gz
8 Source1001:     %{name}.manifest
9
10 BuildRequires:  meson
11 BuildRequires:  pkgconfig(grpc)
12 BuildRequires:  pkgconfig(grpc++)
13
14 Requires:       at-spi2-core
15 BuildRequires:  at-spi2-core-devel
16
17 BuildRequires:  pkgconfig(capi-system-info)
18 BuildRequires:  pkgconfig(capi-ui-efl-util)
19 BuildRequires:  pkgconfig(elementary)
20 BuildRequires:  pkgconfig(gmock)
21
22 BuildRequires: pkgconfig(aul)
23 BuildRequires: pkgconfig(capi-appfw-package-manager)
24 BuildRequires: pkgconfig(capi-appfw-app-control)
25 BuildRequires: pkgconfig(capi-appfw-app-manager)
26 BuildRequires: pkgconfig(capi-appfw-service-application)
27 BuildRequires: pkgconfig(capi-system-device)
28 BuildRequires: pkgconfig(libtzplatform-config)
29 BuildRequires: pkgconfig(capi-system-system-settings)
30 BuildRequires: pkgconfig(capi-base-utils-i18n)
31
32 %if 0%{?gendoc:1}
33 BuildRequires:  doxygen
34 %endif
35
36 %if 0%{?gcov:1}
37 BuildRequires:  lcov
38 %endif
39
40 %if "%{?profile}" == "tv"
41   %define __hash_signing 0
42 %else
43   %define __hash_signing 1
44 %endif
45
46 %if 0%{?__hash_signing}
47 BuildRequires:  hash-signer
48 %if 0%{?sec_product_feature_profile_wearable}
49 Requires(post): signing-client
50 %endif
51 %endif
52
53 %description
54 aurum is a project for testing ui.
55 it provides interfaces through gRPC protocol.
56
57 %package devel
58 Summary: devel package for libaurum
59
60 %description devel
61 devel package for libaurum
62
63 %package bootstrap
64 Summary: bootstrap
65 License: Apache-2.0
66 Requires: %{name} = %{version}-%{release}
67 Requires: libgrpc
68
69 %description bootstrap
70 gRPC Server
71
72 %if 0%{?gendoc:1}
73 %package docs
74 Summary: documentation
75 License: Apache-2.0
76 Requires: %{name} = %{version}-%{release}
77 Requires: libgrpc
78
79 %description docs
80 documentations for aurum
81 %endif
82
83 %if 0%{?gcov:1}
84 %package gcov
85 Summary:    Aurum - Ui Automation (gcov)
86 Group:      Graphics & UI Framework/Testing
87 %description gcov
88 Ui Automation Library Aurum gcov objects
89 %endif
90
91
92 %prep
93 %setup -q
94 cp %{SOURCE1001} .
95
96 export LDFLAGS+="-Wl,-z,noexecstack"
97
98 %if "%{asan}" == "1"
99 %restore_fcommon
100 %endif
101
102
103 %if 0%{?gcov:1}
104 export CFLAGS+=" -fprofile-arcs -ftest-coverage "
105 export CXXFLAGS+=" -fprofile-arcs -ftest-coverage "
106 export FFLAGS+=" -fprofile-arcs -ftest-coverage"
107 export LDFLAGS+=" -lgcov"
108 %define TIZEN_GCOV true
109 %else
110 %define TIZEN_GCOV false
111 %endif
112
113 %if 0%{?gendoc:1}
114 %define TIZEN_GEN_DOC true
115 %else
116 %define TIZEN_GEN_DOC false
117 %endif
118 meson \
119     --prefix /usr \
120     --libdir %{_libdir} \
121     -Dcpp_std=c++17 \
122     -Dtizen=true \
123     -Denable_documentation=%{TIZEN_GEN_DOC} \
124     -Dtizen_gcov=%{TIZEN_GCOV} \
125     -Dtzapp_path=%{TZ_SYS_RO_APP} \
126     -Dtzpackage_path=%{TZ_SYS_RO_PACKAGES} \
127     gbsbuild 2>&1 | sed \
128         -e 's%^.*: error: .*$%\x1b[37;41m&\x1b[m%' \
129         -e 's%^.*: warning: .*$%\x1b[30;43m&\x1b[m%'
130
131 %build
132 ninja \
133     -C gbsbuild \
134     -j %(echo "`/usr/bin/getconf _NPROCESSORS_ONLN`") \
135     -v \
136     all 2>&1 | sed \
137         -e 's%^.*: error: .*$%\x1b[37;41m&\x1b[m%' \
138         -e 's%^.*: warning: .*$%\x1b[30;43m&\x1b[m%'
139
140
141 %if 0%{?gcov:1}
142   mkdir -p gcov-obj
143   find . -name '*.gcno' -exec cp '{}' gcov-obj ';'
144 %endif
145
146 %check
147
148 ninja \
149     -C gbsbuild \
150     -j %(echo "`/usr/bin/getconf _NPROCESSORS_ONLN`") \
151     -v \
152     test 2>&1 | sed \
153         -e 's%^.*: error: .*$%\x1b[37;41m&\x1b[m%' \
154         -e 's%^.*: warning: .*$%\x1b[30;43m&\x1b[m%'
155
156 %install
157
158 %if 0%{?__hash_signing}
159 %define tizen_sign 1
160 %define tizen_sign_base /usr/apps/org.tizen.aurum-bootstrap
161 %define tizen_sign_level platform
162 %define tizen_author_sign 1
163 %define tizen_dist_sign 1
164 %endif
165
166 export DESTDIR=%{buildroot}
167 ninja -C gbsbuild install
168
169 %if 0%{?gcov:1}
170 mkdir -p %{buildroot}%{_datadir}/gcov/obj
171 install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj
172 %endif
173
174 %post
175 sbin/ldconfig
176
177 %postun
178 sbin/ldconfig
179
180 %post bootstrap
181 %if 0%{?sec_product_feature_profile_wearable}
182 echo "signing %{TZ_SYS_RO_APP}/org.tizen.aurum-bootstrap"
183 /usr/bin/signing-client/hash-signer-client.sh -a -d -p platform %{TZ_SYS_RO_APP}/org.tizen.aurum-bootstrap
184 %endif
185
186 %postun bootstrap
187 /sbin/ldconfig
188
189 %files
190 %manifest %{name}.manifest
191 %defattr(-,root,root)
192 %license COPYING
193 %{_libdir}/libaurum.so.*
194
195 %files devel
196 %manifest %{name}.manifest
197 %defattr(-,root,root)
198 %license COPYING
199 %{_libdir}/libaurum.so
200
201 %files bootstrap
202 %manifest %{name}.manifest
203 %defattr(-,root,root)
204 %license COPYING
205 %{TZ_SYS_RO_PACKAGES}/org.tizen.aurum-bootstrap.xml
206 %{TZ_SYS_RO_APP}/org.tizen.aurum-bootstrap/*
207
208 %if 0%{?gendoc:1}
209 %files docs
210 %manifest %{name}.manifest
211 %defattr(-,root,root)
212 %license COPYING
213 %{_datadir}/doc/aurum/
214 %endif
215
216 %if 0%{?gcov:1}
217 %files gcov
218 %{_datadir}/gcov/obj/*
219 %{_bindir}/gtest_aurum
220 %else
221 %exclude %{_bindir}/gtest_aurum
222 %endif