a87c81ba9b435fe4ecfbe2ee4cf4360f0bcee802
[platform/core/uifw/dali-toolkit.git] / packaging / dali-toolkit.spec
1 Name:       dali2-toolkit
2 Summary:    Dali 3D engine Toolkit
3 Version:    2.3.1
4 Release:    1
5 Group:      System/Libraries
6 License:    Apache-2.0 and BSD-3-Clause and MIT
7 URL:        https://review.tizen.org/git/?p=platform/core/uifw/dali-toolkit.git;a=summary
8 Source0:    %{name}-%{version}.tar.gz
9
10 Requires(post): /sbin/ldconfig
11 Requires(postun): /sbin/ldconfig
12 BuildRequires:  cmake
13 BuildRequires:  pkgconfig
14 BuildRequires:  pkgconfig(dlog)
15 BuildRequires:  pkgconfig(dali2-core)
16 BuildRequires:  pkgconfig(dali2-adaptor)
17 BuildRequires:  pkgconfig(gles20)
18 BuildRequires:  pkgconfig(glesv2)
19 BuildRequires:  pkgconfig(egl)
20
21 BuildRequires:  gettext
22 BuildRequires:  pkgconfig(libtzplatform-config)
23
24 #############################
25 # profile setup
26 #############################
27
28 %description
29 Dali 3D engine Toolkit - a set of controls that provide
30 user interface functionality.
31
32 ##############################
33 # resource
34 ##############################
35 %package resources_360x360
36 Summary:    default resource files for 360x360
37 Requires:   %{name} = %{version}-%{release}
38 Conflicts:  %{name}-resources_480x800
39 Conflicts:  %{name}-resources_720x1280
40 Conflicts:  %{name}-resources_1920x1080
41 Conflicts:  %{name}-resources_1920x1080_rpi
42 %description resources_360x360
43 dali-toolkit default resource files for 360x360
44 Contain po / sounds / common images / style / style images
45
46 %package resources_480x800
47 Summary:    default resource files for 480x800
48 Requires:   %{name} = %{version}-%{release}
49 Conflicts:  %{name}-resources_360x360
50 Conflicts:  %{name}-resources_720x1280
51 Conflicts:  %{name}-resources_1920x1080
52 Conflicts:  %{name}-resources_1920x1080_rpi
53 %description resources_480x800
54 dali-toolkit default resource files for 480x800
55 Contain po / sounds / common images / style / style images
56
57 %package resources_720x1280
58 Summary:    default resource files for 720x1280
59 Requires:   %{name} = %{version}-%{release}
60 Conflicts:  %{name}-resources_360x360
61 Conflicts:  %{name}-resources_480x800
62 Conflicts:  %{name}-resources_1920x1080
63 Conflicts:  %{name}-resources_1920x1080_rpi
64 %description resources_720x1280
65 dali-toolkit default resource files for 720x1280
66 Contain po / sounds / common images / style / style images
67
68 %package resources_1920x1080
69 Summary:    default resource files for 1920x1080
70 Requires:   %{name} = %{version}-%{release}
71 Conflicts:  %{name}-resources_360x360
72 Conflicts:  %{name}-resources_480x800
73 Conflicts:  %{name}-resources_720x1280
74 Conflicts:  %{name}-resources_1920x1080_rpi
75 %description resources_1920x1080
76 dali-toolkit default resource files for 1920x1080
77 Contain po / sounds / common images / style / style images
78
79 %package resources_1920x1080_rpi
80 Summary:    default resource files for 1920x1080 on Raspberry Pi 4
81 Requires:   %{name} = %{version}-%{release}
82 Conflicts:  %{name}-resources_360x360
83 Conflicts:  %{name}-resources_480x800
84 Conflicts:  %{name}-resources_720x1280
85 Conflicts:  %{name}-resources_1920x1080
86 %description resources_1920x1080_rpi
87 dali-toolkit default resource files for 1920x1080 on Raspberry Pi 4
88 Contain po / sounds / common images / style / style images
89
90
91 ##############################
92 # devel
93 ##############################
94 %package devel
95 Summary:    Application development package for Dali 3D engine toolkit
96 Group:      Development/Building
97 Requires:   %{name} = %{version}-%{release}
98
99 %description devel
100 Application development package for Dali 3D engine toolkit - headers and package config
101
102 ##############################
103 # dali-scene3d
104 ##############################
105 %define dali2_scene3d dali2-scene3d
106 %package -n %{dali2_scene3d}
107 Summary:    DLI scene loading library
108 Group:      System/Libraries
109 License:    Apache-2.0
110 Requires:   dali2-toolkit
111
112 %description -n %{dali2_scene3d}
113 Provides functionality for loading and displaying DLI format scenes. See README.md for more details.
114
115 %package -n %{dali2_scene3d}-devel
116 Summary:    Development components for dali-scene3d
117 Group:      Development/Building
118 Requires:   %{dali2_scene3d} = %{version}-%{release}
119
120 %description -n %{dali2_scene3d}-devel
121 Development components for dali-scene3d.
122
123 ##############################
124 # dali-physics-2d
125 ##############################
126 %define dali2_physics2d dali2-physics-2d
127 %package -n %{dali2_physics2d}
128 Summary:    Physics library 2D
129 Group:      System/Libraries
130 License:    Apache-2.0
131
132 %description -n %{dali2_physics2d}
133 Provides functionality for 2D physics simulation. See README.md for more details.
134
135 %package -n %{dali2_physics2d}-devel
136 Summary:    Development components for dali2-physics-2d
137 Group:      Development/Building
138 Requires:   %{dali2_physics2d} = %{version}-%{release}
139
140 %description -n %{dali2_physics2d}-devel
141 Development components for dali2-physics-2d.
142
143 ##############################
144 # dali-physics-3d
145 ##############################
146 %define dali2_physics3d dali2-physics-3d
147 %package -n %{dali2_physics3d}
148 Summary:    Physics library 3D
149 Group:      System/Libraries
150 License:    Apache-2.0
151
152 %description -n %{dali2_physics3d}
153 Provides functionality for 3D physics simulation. See README.md for more details.
154
155 %package -n %{dali2_physics3d}-devel
156 Summary:    Development components for dali2-physics-3d
157 Group:      Development/Building
158 Requires:   %{dali2_physics3d} = %{version}-%{release}
159
160 %description -n %{dali2_physics3d}-devel
161 Development components for dali2-physics-3d.
162
163 %define dali_data_rw_dir            %TZ_SYS_SHARE/dali/
164 %define dali_data_ro_dir            %TZ_SYS_RO_SHARE/dali/
165
166 %define dali_toolkit_image_files    %{dali_data_ro_dir}/toolkit/images/
167 %define dali_toolkit_sound_files    %{dali_data_ro_dir}/toolkit/sounds/
168 %define dali_toolkit_style_files    %{dali_data_ro_dir}/toolkit/styles/
169 %define dev_include_path %{_includedir}
170
171 %define dali_xml_file_dir     %TZ_SYS_RO_PACKAGES
172
173 ##############################
174 # Preparation
175 ##############################
176 %prep
177 %setup -q
178
179 ##############################
180 # Build
181 ##############################
182 %build
183 # PO
184 {
185 cd %{_builddir}/dali2-toolkit-%{version}/dali-toolkit/po
186 for language in *.po
187 do
188   language=${language%.po}
189   msgfmt -o ${language}.mo ${language}.po
190 done
191 } &> /dev/null
192
193 PREFIX="/usr"
194 CXXFLAGS+=" -Wall -g -Os -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections "
195 LDFLAGS+=" -Wl,--rpath=$PREFIX/lib -Wl,--as-needed -Wl,--gc-sections -Wl,-Bsymbolic-functions "
196
197 %if 0%{?enable_coverage}
198 CXXFLAGS+=" --coverage "
199 LDFLAGS+=" --coverage "
200 %endif
201
202 %ifarch %{arm}
203 CXXFLAGS+=" -D_ARCH_ARM_"
204 %endif
205
206 libtoolize --force
207 cd %{_builddir}/dali2-toolkit-%{version}/build/tizen
208
209 DALI_DATA_RW_DIR="%{dali_data_rw_dir}" ; export DALI_DATA_RW_DIR
210 DALI_DATA_RO_DIR="%{dali_data_ro_dir}" ; export DALI_DATA_RO_DIR
211
212 cmake \
213 %if 0%{?enable_debug}
214       -DCMAKE_BUILD_TYPE=Debug \
215 %endif
216       -DENABLE_TRACE=ON \
217       -DCMAKE_INSTALL_PREFIX=%{_prefix} \
218       -DCMAKE_INSTALL_LIBDIR=%{_libdir} \
219       -DCMAKE_INSTALL_INCLUDEDIR=%{_includedir} \
220       -DENABLE_I18N=ON
221
222 make %{?jobs:-j%jobs}
223
224 ##############################
225 # Installation
226 ##############################
227 %install
228 rm -rf %{buildroot}
229 cd build/tizen
230
231 pushd %{_builddir}/%{name}-%{version}/build/tizen
232 %make_install
233
234 # PO
235 {
236 cd %{_builddir}/dali2-toolkit-%{version}/dali-toolkit/po
237 for language in *.mo
238 do
239   language=${language%.mo}
240   mkdir -p %{buildroot}/%{_datadir}/locale/${language}/LC_MESSAGES/
241   cp ${language}.mo %{buildroot}/%{_datadir}/locale/${language}/LC_MESSAGES/dali-toolkit.mo
242 done
243 } &> /dev/null
244 popd
245
246 # Remove default style and style images which are for Linux build
247 rm -rf %{buildroot}%{dali_toolkit_style_files}/*
248
249 # Make folder to contain style and style images
250 # After making folder, copy local style and style images to new folder
251 pushd %{_builddir}/%{name}-%{version}
252 mkdir -p %{buildroot}%{dali_toolkit_style_files}/360x360
253 cp -r dali-toolkit/styles/360x360/* %{buildroot}%{dali_toolkit_style_files}/360x360
254 mkdir -p %{buildroot}%{dali_toolkit_style_files}/480x800
255 cp -r dali-toolkit/styles/480x800/* %{buildroot}%{dali_toolkit_style_files}/480x800
256 mkdir -p %{buildroot}%{dali_toolkit_style_files}/720x1280
257 cp -r dali-toolkit/styles/720x1280/* %{buildroot}%{dali_toolkit_style_files}/720x1280
258 mkdir -p %{buildroot}%{dali_toolkit_style_files}/1920x1080
259 cp -r dali-toolkit/styles/1920x1080/* %{buildroot}%{dali_toolkit_style_files}/1920x1080
260 mkdir -p %{buildroot}%{dali_toolkit_style_files}/1920x1080_rpi
261 cp -r dali-toolkit/styles/1920x1080_rpi/* %{buildroot}%{dali_toolkit_style_files}/1920x1080_rpi
262
263 # Copy default feedback theme
264 cp dali-toolkit/styles/default-feedback-theme.json %{buildroot}%{dali_toolkit_style_files}
265
266 # Copy default debug image visual shader script
267 cp dali-toolkit/styles/debug-image-visual-shader-script.json %{buildroot}%{dali_toolkit_style_files}
268 popd
269
270 ##############################
271 # Pre Install
272 ##############################
273
274 %pre resources_360x360
275 case "$1" in
276   2)
277     pushd %{dali_toolkit_style_files}
278     rm -rf ./*
279     popd
280   ;;
281 esac
282
283 %pre resources_480x800
284 case "$1" in
285   2)
286     pushd %{dali_toolkit_style_files}
287     rm -rf ./*
288     popd
289   ;;
290 esac
291
292 %pre resources_720x1280
293 case "$1" in
294   2)
295     pushd %{dali_toolkit_style_files}
296     rm -rf ./*
297     popd
298   ;;
299 esac
300
301 %pre resources_1920x1080
302 case "$1" in
303   2)
304     pushd %{dali_toolkit_style_files}
305     rm -rf ./*
306     popd
307   ;;
308 esac
309
310 %pre resources_1920x1080_rpi
311 case "$1" in
312   2)
313     pushd %{dali_toolkit_style_files}
314     rm -rf ./*
315     popd
316   ;;
317 esac
318
319 ##############################
320 # Post Install
321 ##############################
322 %post
323 /sbin/ldconfig
324 exit 0
325
326 %post resources_360x360
327 pushd %{dali_toolkit_style_files}/360x360
328 for FILE in *; do mv ./"${FILE}" ../"${FILE}"; done
329 popd
330
331 %post resources_480x800
332 pushd %{dali_toolkit_style_files}/480x800
333 for FILE in *; do mv ./"${FILE}" ../"${FILE}"; done
334 popd
335
336 %post resources_720x1280
337 pushd %{dali_toolkit_style_files}/720x1280
338 for FILE in *; do mv ./"${FILE}" ../"${FILE}"; done
339 popd
340
341 %post resources_1920x1080
342 pushd %{dali_toolkit_style_files}/1920x1080
343 for FILE in *; do mv ./"${FILE}" ../"${FILE}"; done
344 popd
345
346 %post resources_1920x1080_rpi
347 pushd %{dali_toolkit_style_files}/1920x1080_rpi
348 for FILE in *; do mv ./"${FILE}" ../"${FILE}"; done
349 popd
350
351 ##############################
352 # Pre Uninstall
353 ##############################
354
355 %preun resources_360x360
356 case "$1" in
357   0)
358     %preun resources_360x360
359     pushd %{dali_toolkit_style_files}
360     mv images ./360x360
361     mv dali-toolkit-default-theme.json ./360x360
362     popd
363   ;;
364 esac
365
366 %preun resources_480x800
367 case "$1" in
368   0)
369     %preun resources_480x800
370     pushd %{dali_toolkit_style_files}
371     mv images ./480x800
372     mv dali-toolkit-default-theme.json ./480x800
373     popd
374   ;;
375 esac
376
377 %preun resources_720x1280
378 case "$1" in
379   0)
380     %preun resources_720x1280
381     pushd %{dali_toolkit_style_files}
382     mv images ./720x1280
383     mv dali-toolkit-default-theme.json ./720x1280
384     popd
385   ;;
386 esac
387
388 %preun resources_1920x1080
389 case "$1" in
390   0)
391     %preun resources_1920x1080
392     pushd %{dali_toolkit_style_files}
393     mv images ./1920x1080
394     mv dali-toolkit-default-theme.json ./1920x1080
395     popd
396   ;;
397 esac
398
399 %preun resources_1920x1080_rpi
400 case "$1" in
401   0)
402     %preun resources_1920x1080_rpi
403     pushd %{dali_toolkit_style_files}
404     mv images ./1920x1080_rpi
405     mv dali-toolkit-default-theme.json ./1920x1080_rpi
406     popd
407   ;;
408 esac
409
410 ##############################
411 # Post Uninstall
412 ##############################
413 %postun
414 /sbin/ldconfig
415 exit 0
416
417 %postun resources_360x360
418 case "$1" in
419   0)
420     pushd %{dali_toolkit_style_files}
421     rm -rf *
422     popd
423   ;;
424 esac
425
426 %postun resources_480x800
427 case "$1" in
428   0)
429     pushd %{dali_toolkit_style_files}
430     rm -rf *
431     popd
432   ;;
433 esac
434
435 %postun resources_720x1280
436 case "$1" in
437   0)
438     pushd %{dali_toolkit_style_files}
439     rm -rf *
440     popd
441   ;;
442 esac
443
444 %postun resources_1920x1080
445 case "$1" in
446   0)
447     pushd %{dali_toolkit_style_files}
448     rm -rf *
449     popd
450   ;;
451 esac
452
453 %postun resources_1920x1080_rpi
454 case "$1" in
455   0)
456     pushd %{dali_toolkit_style_files}
457     rm -rf *
458     popd
459   ;;
460 esac
461
462 ##############################
463 # Files in Binary Packages
464 ##############################
465 %files
466 %if 0%{?enable_dali_smack_rules}
467 %manifest dali-toolkit.manifest-smack
468 %else
469 %manifest dali-toolkit.manifest
470 %endif
471 %defattr(-,root,root,-)
472 %{_libdir}/libdali2-toolkit.so*
473 %license LICENSE
474
475 %files devel
476 %defattr(-,root,root,-)
477 %{dev_include_path}/dali-toolkit/*
478 %{_libdir}/pkgconfig/dali2-toolkit.pc
479 %{_bindir}/dali-shader-generator
480
481 %files resources_360x360
482 %manifest dali-toolkit-resources.manifest
483 %defattr(-,root,root,-)
484 %{dali_toolkit_image_files}/*
485 %{dali_toolkit_sound_files}/*
486 %{dali_toolkit_style_files}/360x360/*
487 %{dali_toolkit_style_files}/debug-image-visual-shader-script.json
488 %{dali_toolkit_style_files}/default-feedback-theme.json
489 %{_datadir}/locale/*/LC_MESSAGES/*
490
491 %files resources_480x800
492 %manifest dali-toolkit-resources.manifest
493 %defattr(-,root,root,-)
494 %{dali_toolkit_image_files}/*
495 %{dali_toolkit_sound_files}/*
496 %{dali_toolkit_style_files}/480x800/*
497 %{dali_toolkit_style_files}/debug-image-visual-shader-script.json
498 %{dali_toolkit_style_files}/default-feedback-theme.json
499 %{_datadir}/locale/*/LC_MESSAGES/*
500
501 %files resources_720x1280
502 %manifest dali-toolkit-resources.manifest
503 %defattr(-,root,root,-)
504 %{dali_toolkit_image_files}/*
505 %{dali_toolkit_sound_files}/*
506 %{dali_toolkit_style_files}/720x1280/*
507 %{dali_toolkit_style_files}/debug-image-visual-shader-script.json
508 %{dali_toolkit_style_files}/default-feedback-theme.json
509 %{_datadir}/locale/*/LC_MESSAGES/*
510
511 %files resources_1920x1080
512 %manifest dali-toolkit-resources.manifest
513 %defattr(-,root,root,-)
514 %{dali_toolkit_image_files}/*
515 %{dali_toolkit_sound_files}/*
516 %{dali_toolkit_style_files}/1920x1080/*
517 %{dali_toolkit_style_files}/debug-image-visual-shader-script.json
518 %{dali_toolkit_style_files}/default-feedback-theme.json
519 %{_datadir}/locale/*/LC_MESSAGES/*
520
521 %files resources_1920x1080_rpi
522 %manifest dali-toolkit-resources.manifest
523 %defattr(-,root,root,-)
524 %{dali_toolkit_image_files}/*
525 %{dali_toolkit_sound_files}/*
526 %{dali_toolkit_style_files}/1920x1080_rpi/*
527 %{dali_toolkit_style_files}/debug-image-visual-shader-script.json
528 %{dali_toolkit_style_files}/default-feedback-theme.json
529 %{_datadir}/locale/*/LC_MESSAGES/*
530
531 %files -n %{dali2_scene3d}
532 %if 0%{?enable_dali_smack_rules}
533 %manifest dali-scene3d.manifest-smack
534 %else
535 %manifest dali-scene3d.manifest
536 %endif
537 %defattr(-,root,root,-)
538 %{_libdir}/lib%{dali2_scene3d}.so
539 %license LICENSE
540
541 %files -n %{dali2_scene3d}-devel
542 %defattr(-,root,root,-)
543 %{_includedir}/dali-scene3d/public-api/*
544 %{_includedir}/dali-scene3d/dali-scene3d.h
545 %{_libdir}/pkgconfig/dali2-scene3d.pc
546
547 %files -n %{dali2_physics2d}
548 %if 0%{?enable_dali_smack_rules}
549 %manifest dali-physics-2d.manifest-smack
550 %else
551 %manifest dali-physics-2d.manifest
552 %endif
553 %defattr(-,root,root,-)
554 %{_libdir}/libchipmunk.so*
555 %{_libdir}/libdali2-physics-2d.so*
556 %license LICENSE
557
558 %files -n %{dali2_physics2d}-devel
559 %defattr(-,root,root,-)
560 %{_includedir}/dali-physics/integration-api/*
561 %{_includedir}/dali-physics/public-api/*
562 %{_includedir}/dali-physics/dali-physics.h
563 %{_includedir}/chipmunk/*
564 %{_libdir}/pkgconfig/chipmunk2d.pc
565 %{_libdir}/pkgconfig/dali2-physics-2d.pc
566
567 %files -n %{dali2_physics3d}
568 %if 0%{?enable_dali_smack_rules}
569 %manifest dali-physics-3d.manifest-smack
570 %else
571 %manifest dali-physics-3d.manifest
572 %endif
573 %defattr(-,root,root,-)
574 %{_libdir}/libbullet3.so*
575 %{_libdir}/libdali2-physics-3d.so*
576 %license LICENSE
577
578 %files -n %{dali2_physics3d}-devel
579 %defattr(-,root,root,-)
580 %{_includedir}/dali-physics/integration-api/*
581 %{_includedir}/dali-physics/public-api/*
582 %{_includedir}/dali-physics/dali-physics.h
583 %{_includedir}/bullet/*
584 %{_libdir}/pkgconfig/dali2-physics-3d.pc
585 %{_libdir}/pkgconfig/bullet3.pc