Merge "Changes in Particle System for NUI" into devel/master
[platform/core/uifw/dali-toolkit.git] / packaging / dali-toolkit.spec
1 Name:       dali2-toolkit
2 Summary:    Dali 3D engine Toolkit
3 Version:    2.2.38
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 popd
266
267 ##############################
268 # Pre Install
269 ##############################
270
271 %pre resources_360x360
272 case "$1" in
273   2)
274     pushd %{dali_toolkit_style_files}
275     rm -rf ./*
276     popd
277   ;;
278 esac
279
280 %pre resources_480x800
281 case "$1" in
282   2)
283     pushd %{dali_toolkit_style_files}
284     rm -rf ./*
285     popd
286   ;;
287 esac
288
289 %pre resources_720x1280
290 case "$1" in
291   2)
292     pushd %{dali_toolkit_style_files}
293     rm -rf ./*
294     popd
295   ;;
296 esac
297
298 %pre resources_1920x1080
299 case "$1" in
300   2)
301     pushd %{dali_toolkit_style_files}
302     rm -rf ./*
303     popd
304   ;;
305 esac
306
307 %pre resources_1920x1080_rpi
308 case "$1" in
309   2)
310     pushd %{dali_toolkit_style_files}
311     rm -rf ./*
312     popd
313   ;;
314 esac
315
316 ##############################
317 # Post Install
318 ##############################
319 %post
320 /sbin/ldconfig
321 exit 0
322
323 %post resources_360x360
324 pushd %{dali_toolkit_style_files}/360x360
325 for FILE in *; do mv ./"${FILE}" ../"${FILE}"; done
326 popd
327
328 %post resources_480x800
329 pushd %{dali_toolkit_style_files}/480x800
330 for FILE in *; do mv ./"${FILE}" ../"${FILE}"; done
331 popd
332
333 %post resources_720x1280
334 pushd %{dali_toolkit_style_files}/720x1280
335 for FILE in *; do mv ./"${FILE}" ../"${FILE}"; done
336 popd
337
338 %post resources_1920x1080
339 pushd %{dali_toolkit_style_files}/1920x1080
340 for FILE in *; do mv ./"${FILE}" ../"${FILE}"; done
341 popd
342
343 %post resources_1920x1080_rpi
344 pushd %{dali_toolkit_style_files}/1920x1080_rpi
345 for FILE in *; do mv ./"${FILE}" ../"${FILE}"; done
346 popd
347
348 ##############################
349 # Pre Uninstall
350 ##############################
351
352 %preun resources_360x360
353 case "$1" in
354   0)
355     %preun resources_360x360
356     pushd %{dali_toolkit_style_files}
357     mv images ./360x360
358     mv dali-toolkit-default-theme.json ./360x360
359     popd
360   ;;
361 esac
362
363 %preun resources_480x800
364 case "$1" in
365   0)
366     %preun resources_480x800
367     pushd %{dali_toolkit_style_files}
368     mv images ./480x800
369     mv dali-toolkit-default-theme.json ./480x800
370     popd
371   ;;
372 esac
373
374 %preun resources_720x1280
375 case "$1" in
376   0)
377     %preun resources_720x1280
378     pushd %{dali_toolkit_style_files}
379     mv images ./720x1280
380     mv dali-toolkit-default-theme.json ./720x1280
381     popd
382   ;;
383 esac
384
385 %preun resources_1920x1080
386 case "$1" in
387   0)
388     %preun resources_1920x1080
389     pushd %{dali_toolkit_style_files}
390     mv images ./1920x1080
391     mv dali-toolkit-default-theme.json ./1920x1080
392     popd
393   ;;
394 esac
395
396 %preun resources_1920x1080_rpi
397 case "$1" in
398   0)
399     %preun resources_1920x1080_rpi
400     pushd %{dali_toolkit_style_files}
401     mv images ./1920x1080_rpi
402     mv dali-toolkit-default-theme.json ./1920x1080_rpi
403     popd
404   ;;
405 esac
406
407 ##############################
408 # Post Uninstall
409 ##############################
410 %postun
411 /sbin/ldconfig
412 exit 0
413
414 %postun resources_360x360
415 case "$1" in
416   0)
417     pushd %{dali_toolkit_style_files}
418     rm -rf *
419     popd
420   ;;
421 esac
422
423 %postun resources_480x800
424 case "$1" in
425   0)
426     pushd %{dali_toolkit_style_files}
427     rm -rf *
428     popd
429   ;;
430 esac
431
432 %postun resources_720x1280
433 case "$1" in
434   0)
435     pushd %{dali_toolkit_style_files}
436     rm -rf *
437     popd
438   ;;
439 esac
440
441 %postun resources_1920x1080
442 case "$1" in
443   0)
444     pushd %{dali_toolkit_style_files}
445     rm -rf *
446     popd
447   ;;
448 esac
449
450 %postun resources_1920x1080_rpi
451 case "$1" in
452   0)
453     pushd %{dali_toolkit_style_files}
454     rm -rf *
455     popd
456   ;;
457 esac
458
459 ##############################
460 # Files in Binary Packages
461 ##############################
462 %files
463 %if 0%{?enable_dali_smack_rules}
464 %manifest dali-toolkit.manifest-smack
465 %else
466 %manifest dali-toolkit.manifest
467 %endif
468 %defattr(-,root,root,-)
469 %{_libdir}/libdali2-toolkit.so*
470 %license LICENSE
471
472 %files devel
473 %defattr(-,root,root,-)
474 %{dev_include_path}/dali-toolkit/*
475 %{_libdir}/pkgconfig/dali2-toolkit.pc
476 %{_bindir}/dali-shader-generator
477
478 %files resources_360x360
479 %manifest dali-toolkit-resources.manifest
480 %defattr(-,root,root,-)
481 %{dali_toolkit_image_files}/*
482 %{dali_toolkit_sound_files}/*
483 %{dali_toolkit_style_files}/360x360/*
484 %{dali_toolkit_style_files}/default-feedback-theme.json
485 %{_datadir}/locale/*/LC_MESSAGES/*
486
487 %files resources_480x800
488 %manifest dali-toolkit-resources.manifest
489 %defattr(-,root,root,-)
490 %{dali_toolkit_image_files}/*
491 %{dali_toolkit_sound_files}/*
492 %{dali_toolkit_style_files}/480x800/*
493 %{dali_toolkit_style_files}/default-feedback-theme.json
494 %{_datadir}/locale/*/LC_MESSAGES/*
495
496 %files resources_720x1280
497 %manifest dali-toolkit-resources.manifest
498 %defattr(-,root,root,-)
499 %{dali_toolkit_image_files}/*
500 %{dali_toolkit_sound_files}/*
501 %{dali_toolkit_style_files}/720x1280/*
502 %{dali_toolkit_style_files}/default-feedback-theme.json
503 %{_datadir}/locale/*/LC_MESSAGES/*
504
505 %files resources_1920x1080
506 %manifest dali-toolkit-resources.manifest
507 %defattr(-,root,root,-)
508 %{dali_toolkit_image_files}/*
509 %{dali_toolkit_sound_files}/*
510 %{dali_toolkit_style_files}/1920x1080/*
511 %{dali_toolkit_style_files}/default-feedback-theme.json
512 %{_datadir}/locale/*/LC_MESSAGES/*
513
514 %files resources_1920x1080_rpi
515 %manifest dali-toolkit-resources.manifest
516 %defattr(-,root,root,-)
517 %{dali_toolkit_image_files}/*
518 %{dali_toolkit_sound_files}/*
519 %{dali_toolkit_style_files}/1920x1080_rpi/*
520 %{dali_toolkit_style_files}/default-feedback-theme.json
521 %{_datadir}/locale/*/LC_MESSAGES/*
522
523 %files -n %{dali2_scene3d}
524 %if 0%{?enable_dali_smack_rules}
525 %manifest dali-scene3d.manifest-smack
526 %else
527 %manifest dali-scene3d.manifest
528 %endif
529 %defattr(-,root,root,-)
530 %{_libdir}/lib%{dali2_scene3d}.so
531 %license LICENSE
532
533 %files -n %{dali2_scene3d}-devel
534 %defattr(-,root,root,-)
535 %{_includedir}/dali-scene3d/public-api/*
536 %{_includedir}/dali-scene3d/dali-scene3d.h
537 %{_libdir}/pkgconfig/dali2-scene3d.pc
538
539 %files -n %{dali2_physics2d}
540 %if 0%{?enable_dali_smack_rules}
541 %manifest dali-physics-2d.manifest-smack
542 %else
543 %manifest dali-physics-2d.manifest
544 %endif
545 %defattr(-,root,root,-)
546 %{_libdir}/libchipmunk.so*
547 %license LICENSE
548
549 %files -n %{dali2_physics2d}-devel
550 %defattr(-,root,root,-)
551 %{_includedir}/chipmunk/*
552 %{_libdir}/pkgconfig/dali2-physics-2d.pc
553 %{_libdir}/pkgconfig/chipmunk2d.pc
554
555 %files -n %{dali2_physics3d}
556 %if 0%{?enable_dali_smack_rules}
557 %manifest dali-physics-3d.manifest-smack
558 %else
559 %manifest dali-physics-3d.manifest
560 %endif
561 %defattr(-,root,root,-)
562 %{_libdir}/libbullet3.so*
563 %license LICENSE
564
565 %files -n %{dali2_physics3d}-devel
566 %defattr(-,root,root,-)
567 %{_includedir}/bullet/*
568 %{_libdir}/pkgconfig/dali2-physics-3d.pc
569 %{_libdir}/pkgconfig/bullet3.pc
570