a77fe90e8100b6d3f1d2f4501415014534c75287
[platform/core/uifw/dali-extension.git] / packaging / dali-extension.spec
1 # NOTES
2 # This spec file is used to build DALi Extensions
3 #
4 # gbs will try to download the build.conf for the platform automatically from the repo location when
5 # performing a gbs build ( use gbs build -v to see it download location) E.g.
6 # http://download.tizen.org/snapshots/tizen/tv/tizen-tv/repos/arm-wayland/packages/repodata/xxxx-build.conf.gz
7
8 Name:       dali2-extension
9 Summary:    The DALi Tizen Extensions
10 Version:    2.2.51
11 Release:    1
12 Group:      System/Libraries
13 License:    Apache-2.0 and BSD-3-Clause and MIT
14 URL:        https://review.tizen.org/git/?p=platform/core/uifw/dali-extensions.git;a=summary
15 Source0:    %{name}-%{version}.tar.gz
16
17 %if 0%{?tizen_version_major} >= 4
18 %define tizen_40_or_greater 1
19 %endif
20
21 %if 0%{?tizen_version_major} >= 5
22 %define tizen_50_or_greater 1
23 %endif
24
25 %if ( 0%{?tizen_version_major} == 5 && 0%{?tizen_version_minor} >= 5 ) || 0%{?tizen_version_major} >= 6
26 %define tizen_55_or_greater 1
27 %endif
28
29 %if ( 0%{?tizen_version_major} == 6 && 0%{?tizen_version_minor} >= 5 ) || 0%{?tizen_version_major} >= 7
30 %define tizen_65_or_greater 1
31 %endif
32
33 %if %{undefined NO_WEB_FRAMEWORK}
34 %define enable_web_engine_plugin 1
35 %endif
36
37 %define enable_color_controller 1
38
39 Requires(post): /sbin/ldconfig
40 Requires(postun): /sbin/ldconfig
41
42 BuildRequires:  pkgconfig
43 BuildRequires:  pkgconfig(dali2-core)
44 BuildRequires:  pkgconfig(dali2-adaptor)
45 BuildRequires:  pkgconfig(dali2-toolkit)
46 BuildRequires:  pkgconfig(dlog)
47
48 BuildRequires:  pkgconfig(dali2-adaptor-integration)
49 BuildRequires:  pkgconfig(ecore-wl2)
50
51 # For evas-plugin
52 %if 0%{?enable_evas_plugin}
53 BuildRequires:  pkgconfig(elementary)
54 BuildRequires:  pkgconfig(evas)
55 %endif
56
57 %if 0%{?tizen_65_or_greater}
58 BuildRequires:  pkgconfig(rive_tizen)
59 %endif
60
61 %description
62 dali-extension
63
64
65 #############################
66 # devel
67 ##############################
68 %package devel
69 Summary:    Development components for the DALi Extension
70 Group:      Development/Building
71 Requires:   %{name} = %{version}-%{release}
72
73 %description devel
74 Development components for the DALi Tizen Extensions - public headers and package configs
75
76 ##############################
77 # Dali Key Extension
78 ##############################
79
80 %package key-extension
81 Summary:    Plugin to support extension keys for Dali
82 Group:      System/Libraries
83
84 %description key-extension
85 Plugin to support extension keys for Dali
86
87 ##############################
88 # Dali VideoPlayer Plugin
89 ##############################
90
91 %package video-player-plugin
92 Summary:    Plugin to play a video file for Dali
93 Group:      System/Libraries
94 BuildRequires: pkgconfig(capi-media-player)
95 BuildRequires: pkgconfig(capi-system-info)
96 # dali-adaptor uses ecore mainloop
97 %if 0%{?tizen_version_major} >= 5
98 BuildRequires:  pkgconfig(ecore-wl2)
99 %else
100 BuildRequires:  pkgconfig(ecore-wayland)
101 %endif
102
103 %description video-player-plugin
104 VideoPlayer plugin to play a video file for Dali
105
106 ##############################
107 # Dali CameraPlayer Plugin
108 ##############################
109
110 %package camera-player-plugin
111 Summary:    Plugin to play a camera file for Dali
112 Group:      System/Libraries
113 BuildRequires: pkgconfig(capi-media-camera)
114 # dali-adaptor uses ecore mainloop
115 BuildRequires:  pkgconfig(ecore-wl2)
116
117 %description camera-player-plugin
118 CameraPlayer plugin to play a camera file for Dali
119
120 ##############################
121 # Dali Web Engine chromium Plugin
122 ##############################
123
124 %package web-engine-chromium-plugin
125 Summary:    Plugin to support WebView for Dali
126 Group:      System/Libraries
127 %if 0%{?tizen_55_or_greater} && 0%{?enable_web_engine_plugin} == 1
128 BuildRequires: pkgconfig(libtbm)
129 BuildRequires: pkgconfig(chromium-efl)
130 BuildRequires: pkgconfig(elementary)
131 %endif
132
133 %description web-engine-chromium-plugin
134 Web Engine chromium plugin to support WebView for Dali
135
136 ##############################
137 # Dali Image Loader Plugin
138 ##############################
139
140 %package image-loader-plugin
141 Summary:    Plugin to image loading for Dali
142 Group:      System/Libraries
143
144 %description image-loader-plugin
145 Image Loader plugin to image loading file for Dali
146
147 ####################################
148 # Vector Animation Renderer Plugin
149 ####################################
150 %package vector-animation-renderer-plugin
151 Summary:    Plugin to render a vector animation
152 Group:      System/Libraries
153 %if 0%{?tizen_55_or_greater}
154 BuildRequires:  pkgconfig(rlottie)
155 %endif
156
157 %description vector-animation-renderer-plugin
158 Plugin to render a vector animation
159
160 ####################################
161 # color controller Plugin
162 ####################################
163
164 %package color-controller-plugin
165 Summary:    Plugin to load color theme
166 Group:      System/Libraries
167
168 %description color-controller-plugin
169 Plugin to load color theme
170
171 ##############################
172 # Dali Web Engine LWE Plugin
173 ##############################
174
175 %package web-engine-lwe-plugin
176 Summary:    Plugin to support WebView for Dali
177 Group:      System/Libraries
178 %if 0%{?tizen_55_or_greater} && 0%{?enable_web_engine_plugin} == 1
179 BuildRequires: pkgconfig(libtbm)
180 BuildRequires: pkgconfig(lightweight-web-engine)
181 %endif
182
183 %description web-engine-lwe-plugin
184 Web Engine LWE(Light-weight Web Engine) plugin to support WebView for Dali
185
186 ####################################
187 # Rive Animation View Plugin
188 ####################################
189 %package rive-animation-view
190 Summary:    Plugin to render a rive animation
191 Group:      System/Libraries
192 Requires: dali2-extension-rive-animation-view = %{version}-%{release}
193 %if 0%{?tizen_65_or_greater}
194 BuildRequires:  pkgconfig(thorvg)
195 BuildRequires:  pkgconfig(rive_tizen)
196 %endif
197
198 %description rive-animation-view
199 Plugin to render a rive animation
200
201 %package rive-animation-view-devel
202 Summary: Development components for rive animation view
203 Group: System/Libraries
204 Requires: dali2-extension-rive-animation-view = %{version}-%{release}
205
206 %description rive-animation-view-devel
207 Header & package configuration of rive-animation-view
208
209 ##############################
210 # Preparation
211 ##############################
212 %prep
213 %setup -q
214
215 #Use TZ_PATH when tizen version is 3.x or greater
216
217 %define dali_data_rw_dir         %TZ_SYS_RO_SHARE/dali/
218 %define dali_data_ro_dir         %TZ_SYS_RO_SHARE/dali/
219 %define dev_include_path %{_includedir}
220
221 ##############################
222 # Build
223 ##############################
224 %build
225 PREFIX+="/usr"
226 CXXFLAGS+=" -Wall -g -Os -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections -DGL_GLEXT_PROTOTYPES"
227 LDFLAGS+=" -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--gc-sections -Wl,-Bsymbolic-functions "
228
229 %if 0%{?tizen_version_major} >= 5
230 CFLAGS+=" -DECORE_WL2 -DEFL_BETA_API_SUPPORT"
231 CXXFLAGS+=" -DECORE_WL2 -DEFL_BETA_API_SUPPORT"
232 configure_flags="--enable-ecore-wl2"
233 %endif
234
235 %if "%{?profile}" == "tv"
236 CFLAGS+=" -DOS_TIZEN_TV"
237 CXXFLAGS+=" -DOS_TIZEN_TV"
238 %endif
239
240 libtoolize --force
241 cd %{_builddir}/%{name}-%{version}/build/tizen
242 autoreconf --install
243
244 %configure --prefix=$PREFIX \
245 %if 0%{?enable_debug}
246            --enable-debug \
247 %endif
248 %if 0%{?tizen_50_or_greater}
249            --with-tizen-50-or-greater \
250 %endif
251 %if 0%{?tizen_55_or_greater}
252            --with-tizen-55-or-greater \
253 %endif
254 %if 0%{?tizen_65_or_greater}
255            --with-tizen-65-or-greater \
256 %endif
257 %if 0%{?enable_web_engine_plugin} == 1
258            --enable-web-engine-plugin \
259 %endif
260 %if 0%{?enable_image_loader}
261            --enable-imageloader-extension \
262 %endif
263 %if 0%{?enable_color_controller}
264            --enable-color-controller \
265 %endif
266 %if 0%{?enable_evas_plugin}
267            --enable-evas-plugin \
268 %endif
269            --enable-ecore-wl2 \
270            --enable-keyextension
271
272 make %{?jobs:-j%jobs}
273
274 ##############################
275 # Installation
276 ##############################
277 %install
278 rm -rf %{buildroot}
279
280 # install dali.sh
281 mkdir -p %{buildroot}%{_sysconfdir}/profile.d
282
283 %if "%{?profile}" != "common" && "%{?profile}" != "ivi"
284 install -m 0644 scripts/dali.sh %{buildroot}%{_sysconfdir}/profile.d
285 %endif
286
287 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "mobile"
288 install -m 0644 scripts/other/dali.sh %{buildroot}%{_sysconfdir}/profile.d
289 %endif
290
291 cd build/tizen
292 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
293
294 %pre
295 exit 0
296
297 ##############################
298 #  Post Install new package
299 ##############################
300 %post
301 /sbin/ldconfig
302 exit 0
303
304 %post key-extension
305 /sbin/ldconfig
306 exit 0
307
308 %post video-player-plugin
309 /sbin/ldconfig
310 exit 0
311
312 %post camera-player-plugin
313 /sbin/ldconfig
314 exit 0
315
316 %if 0%{?tizen_55_or_greater} && 0%{?enable_web_engine_plugin} == 1
317 %post web-engine-chromium-plugin
318 pushd %{_libdir}
319 ln -sf libdali2-web-engine-chromium-plugin.so libdali2-web-engine-plugin.so
320 popd
321 /sbin/ldconfig
322 exit 0
323 %endif
324
325 %if 0%{?enable_image_loader}
326 %post image-loader-plugin
327 /sbin/ldconfig
328 exit 0
329 %endif
330
331 %if 0%{?tizen_55_or_greater}
332 %post vector-animation-renderer-plugin
333 /sbin/ldconfig
334 exit 0
335 %endif
336
337 %if 0%{?tizen_65_or_greater}
338 %post rive-animation-view
339 /sbin/ldconfig
340 exit 0
341 %endif
342
343 %if 0%{?enable_color_controller}
344 %post color-controller-plugin
345 /sbin/ldconfig
346 exit 0
347 %endif
348
349 %if 0%{?tizen_55_or_greater} && 0%{?enable_web_engine_plugin} == 1
350 %post web-engine-lwe-plugin
351 /sbin/ldconfig
352 exit 0
353 %endif
354
355 ##############################
356 #   Pre Uninstall old package
357 ##############################
358 %preun
359 exit 0
360
361 ##############################
362 #   Post Uninstall old package
363 ##############################
364 %postun
365 /sbin/ldconfig
366 exit 0
367
368 %postun key-extension
369 /sbin/ldconfig
370 exit 0
371
372 %postun video-player-plugin
373 /sbin/ldconfig
374 exit 0
375
376 %postun camera-player-plugin
377 /sbin/ldconfig
378 exit 0
379
380 %if 0%{?tizen_55_or_greater} && 0%{?enable_web_engine_plugin} == 1
381 %postun web-engine-chromium-plugin
382 /sbin/ldconfig
383 exit 0
384 %endif
385
386 %if 0%{?enable_image_loader}
387 %postun image-loader-plugin
388 /sbin/ldconfig
389 exit 0
390 %endif
391
392 %if 0%{?tizen_55_or_greater}
393 %postun vector-animation-renderer-plugin
394 /sbin/ldconfig
395 exit 0
396 %endif
397
398 %if 0%{?tizen_65_or_greater}
399 %postun rive-animation-view
400 /sbin/ldconfig
401 exit 0
402 %endif
403
404 %if 0%{?enable_color_controller}
405 %postun color-controller-plugin
406 /sbin/ldconfig
407 exit 0
408 %endif
409
410 %if 0%{?tizen_55_or_greater} && 0%{?enable_web_engine_plugin} == 1
411 %postun web-engine-lwe-plugin
412 /sbin/ldconfig
413 exit 0
414 %endif
415
416 ##############################
417 # Files in Binary Packages
418 ##############################
419
420 %files
421 %manifest dali-extension.manifest
422 %defattr(-,root,root,-)
423 %{_sysconfdir}/profile.d/dali.sh
424 %{_libdir}/libdali2-extension.so*
425 %license LICENSE
426
427 %files devel
428 %defattr(-,root,root,-)
429 %{_includedir}/dali-extension/*
430 %{_libdir}/pkgconfig/dali2-extension.pc
431
432 %files key-extension
433 %manifest dali-extension.manifest
434 %defattr(-,root,root,-)
435 %{_libdir}/libdali2-key-extension.so*
436 %license LICENSE
437
438 %files video-player-plugin
439 %manifest dali-extension.manifest
440 %defattr(-,root,root,-)
441 %{_libdir}/libdali2-video-player-plugin.so*
442 %license LICENSE
443
444 %if 0%{?tizen_65_or_greater}
445 %files camera-player-plugin
446 %manifest dali-extension.manifest
447 %defattr(-,root,root,-)
448 %{_libdir}/libdali2-camera-player-plugin.so*
449 %license LICENSE
450 %endif
451
452 %if 0%{?tizen_55_or_greater} && 0%{?enable_web_engine_plugin} == 1
453 %files web-engine-chromium-plugin
454 %manifest dali-extension.manifest
455 %defattr(-,root,root,-)
456 %{_libdir}/libdali2-web-engine-chromium-plugin.so*
457 %license LICENSE
458 %endif
459
460 %if 0%{?enable_image_loader}
461 %files image-loader-plugin
462 %manifest dali-extension.manifest
463 %defattr(-,root,root,-)
464 %{_libdir}/libdali2-image-loader-plugin.so*
465 %license LICENSE
466 %endif
467
468 %if 0%{?tizen_55_or_greater}
469 %files vector-animation-renderer-plugin
470 %manifest dali-extension.manifest
471 %defattr(-,root,root,-)
472 %{_libdir}/libdali2-vector-animation-renderer-plugin.so*
473 %license LICENSE
474 %endif
475
476 %if 0%{?tizen_65_or_greater}
477 %files rive-animation-view
478 %manifest dali-extension.manifest
479 %defattr(-,root,root,-)
480 %{_libdir}/libdali2-extension-rive-animation-view.so*
481 %license LICENSE
482
483 %files rive-animation-view-devel
484 %defattr(-,root,root,-)
485 %{_includedir}/dali-extension/devel-api/rive-animation-view/*
486 %{_libdir}/pkgconfig/dali2-extension-rive-animation-view.pc
487 %endif
488
489 %if 0%{?enable_color_controller}
490 %files color-controller-plugin
491 %manifest dali-extension.manifest
492 %defattr(-,root,root,-)
493 %{_libdir}/libdali2-color-controller-plugin.so*
494 %license LICENSE
495 %endif
496
497 %if 0%{?tizen_55_or_greater} && 0%{?enable_web_engine_plugin} == 1
498 %files web-engine-lwe-plugin
499 %manifest dali-extension.manifest
500 %defattr(-,root,root,-)
501 %{_libdir}/libdali2-web-engine-lwe-plugin.so*
502 %license LICENSE
503 %endif