Merge "Replace std::string global variables with C-style string." 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.14
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 %define dali_data_rw_dir            %TZ_SYS_SHARE/dali/
124 %define dali_data_ro_dir            %TZ_SYS_RO_SHARE/dali/
125
126 %define dali_toolkit_image_files    %{dali_data_ro_dir}/toolkit/images/
127 %define dali_toolkit_sound_files    %{dali_data_ro_dir}/toolkit/sounds/
128 %define dali_toolkit_style_files    %{dali_data_ro_dir}/toolkit/styles/
129 %define dev_include_path %{_includedir}
130
131 %define dali_xml_file_dir     %TZ_SYS_RO_PACKAGES
132
133 ##############################
134 # Preparation
135 ##############################
136 %prep
137 %setup -q
138
139 ##############################
140 # Build
141 ##############################
142 %build
143 # PO
144 {
145 cd %{_builddir}/dali2-toolkit-%{version}/dali-toolkit/po
146 for language in *.po
147 do
148   language=${language%.po}
149   msgfmt -o ${language}.mo ${language}.po
150 done
151 } &> /dev/null
152
153 PREFIX="/usr"
154 CXXFLAGS+=" -Wall -g -Os -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections "
155 LDFLAGS+=" -Wl,--rpath=$PREFIX/lib -Wl,--as-needed -Wl,--gc-sections -Wl,-Bsymbolic-functions "
156
157 %if 0%{?enable_coverage}
158 CXXFLAGS+=" --coverage "
159 LDFLAGS+=" --coverage "
160 %endif
161
162 %ifarch %{arm}
163 CXXFLAGS+=" -D_ARCH_ARM_"
164 %endif
165
166 libtoolize --force
167 cd %{_builddir}/dali2-toolkit-%{version}/build/tizen
168
169 DALI_DATA_RW_DIR="%{dali_data_rw_dir}" ; export DALI_DATA_RW_DIR
170 DALI_DATA_RO_DIR="%{dali_data_ro_dir}" ; export DALI_DATA_RO_DIR
171
172 cmake \
173 %if 0%{?enable_debug}
174       -DCMAKE_BUILD_TYPE=Debug \
175 %endif
176       -DENABLE_TRACE=ON \
177       -DCMAKE_INSTALL_PREFIX=%{_prefix} \
178       -DCMAKE_INSTALL_LIBDIR=%{_libdir} \
179       -DCMAKE_INSTALL_INCLUDEDIR=%{_includedir} \
180       -DENABLE_I18N=ON
181
182 make %{?jobs:-j%jobs}
183
184 ##############################
185 # Installation
186 ##############################
187 %install
188 rm -rf %{buildroot}
189 cd build/tizen
190
191 pushd %{_builddir}/%{name}-%{version}/build/tizen
192 %make_install
193
194 # PO
195 {
196 cd %{_builddir}/dali2-toolkit-%{version}/dali-toolkit/po
197 for language in *.mo
198 do
199   language=${language%.mo}
200   mkdir -p %{buildroot}/%{_datadir}/locale/${language}/LC_MESSAGES/
201   cp ${language}.mo %{buildroot}/%{_datadir}/locale/${language}/LC_MESSAGES/dali-toolkit.mo
202 done
203 } &> /dev/null
204 popd
205
206 # Remove default style and style images which are for Linux build
207 rm -rf %{buildroot}%{dali_toolkit_style_files}/*
208
209 # Make folder to contain style and style images
210 # After making folder, copy local style and style images to new folder
211 pushd %{_builddir}/%{name}-%{version}
212 mkdir -p %{buildroot}%{dali_toolkit_style_files}/360x360
213 cp -r dali-toolkit/styles/360x360/* %{buildroot}%{dali_toolkit_style_files}/360x360
214 mkdir -p %{buildroot}%{dali_toolkit_style_files}/480x800
215 cp -r dali-toolkit/styles/480x800/* %{buildroot}%{dali_toolkit_style_files}/480x800
216 mkdir -p %{buildroot}%{dali_toolkit_style_files}/720x1280
217 cp -r dali-toolkit/styles/720x1280/* %{buildroot}%{dali_toolkit_style_files}/720x1280
218 mkdir -p %{buildroot}%{dali_toolkit_style_files}/1920x1080
219 cp -r dali-toolkit/styles/1920x1080/* %{buildroot}%{dali_toolkit_style_files}/1920x1080
220 mkdir -p %{buildroot}%{dali_toolkit_style_files}/1920x1080_rpi
221 cp -r dali-toolkit/styles/1920x1080_rpi/* %{buildroot}%{dali_toolkit_style_files}/1920x1080_rpi
222
223 # Copy default feedback theme
224 cp dali-toolkit/styles/default-feedback-theme.json %{buildroot}%{dali_toolkit_style_files}
225 popd
226
227 ##############################
228 # Pre Install
229 ##############################
230
231 %pre resources_360x360
232 case "$1" in
233   2)
234     pushd %{dali_toolkit_style_files}
235     rm -rf ./*
236     popd
237   ;;
238 esac
239
240 %pre resources_480x800
241 case "$1" in
242   2)
243     pushd %{dali_toolkit_style_files}
244     rm -rf ./*
245     popd
246   ;;
247 esac
248
249 %pre resources_720x1280
250 case "$1" in
251   2)
252     pushd %{dali_toolkit_style_files}
253     rm -rf ./*
254     popd
255   ;;
256 esac
257
258 %pre resources_1920x1080
259 case "$1" in
260   2)
261     pushd %{dali_toolkit_style_files}
262     rm -rf ./*
263     popd
264   ;;
265 esac
266
267 %pre resources_1920x1080_rpi
268 case "$1" in
269   2)
270     pushd %{dali_toolkit_style_files}
271     rm -rf ./*
272     popd
273   ;;
274 esac
275
276 ##############################
277 # Post Install
278 ##############################
279 %post
280 /sbin/ldconfig
281 exit 0
282
283 %post resources_360x360
284 pushd %{dali_toolkit_style_files}/360x360
285 for FILE in *; do mv ./"${FILE}" ../"${FILE}"; done
286 popd
287
288 %post resources_480x800
289 pushd %{dali_toolkit_style_files}/480x800
290 for FILE in *; do mv ./"${FILE}" ../"${FILE}"; done
291 popd
292
293 %post resources_720x1280
294 pushd %{dali_toolkit_style_files}/720x1280
295 for FILE in *; do mv ./"${FILE}" ../"${FILE}"; done
296 popd
297
298 %post resources_1920x1080
299 pushd %{dali_toolkit_style_files}/1920x1080
300 for FILE in *; do mv ./"${FILE}" ../"${FILE}"; done
301 popd
302
303 %post resources_1920x1080_rpi
304 pushd %{dali_toolkit_style_files}/1920x1080_rpi
305 for FILE in *; do mv ./"${FILE}" ../"${FILE}"; done
306 popd
307
308 ##############################
309 # Pre Uninstall
310 ##############################
311
312 %preun resources_360x360
313 case "$1" in
314   0)
315     %preun resources_360x360
316     pushd %{dali_toolkit_style_files}
317     mv images ./360x360
318     mv dali-toolkit-default-theme.json ./360x360
319     popd
320   ;;
321 esac
322
323 %preun resources_480x800
324 case "$1" in
325   0)
326     %preun resources_480x800
327     pushd %{dali_toolkit_style_files}
328     mv images ./480x800
329     mv dali-toolkit-default-theme.json ./480x800
330     popd
331   ;;
332 esac
333
334 %preun resources_720x1280
335 case "$1" in
336   0)
337     %preun resources_720x1280
338     pushd %{dali_toolkit_style_files}
339     mv images ./720x1280
340     mv dali-toolkit-default-theme.json ./720x1280
341     popd
342   ;;
343 esac
344
345 %preun resources_1920x1080
346 case "$1" in
347   0)
348     %preun resources_1920x1080
349     pushd %{dali_toolkit_style_files}
350     mv images ./1920x1080
351     mv dali-toolkit-default-theme.json ./1920x1080
352     popd
353   ;;
354 esac
355
356 %preun resources_1920x1080_rpi
357 case "$1" in
358   0)
359     %preun resources_1920x1080_rpi
360     pushd %{dali_toolkit_style_files}
361     mv images ./1920x1080_rpi
362     mv dali-toolkit-default-theme.json ./1920x1080_rpi
363     popd
364   ;;
365 esac
366
367 ##############################
368 # Post Uninstall
369 ##############################
370 %postun
371 /sbin/ldconfig
372 exit 0
373
374 %postun resources_360x360
375 case "$1" in
376   0)
377     pushd %{dali_toolkit_style_files}
378     rm -rf *
379     popd
380   ;;
381 esac
382
383 %postun resources_480x800
384 case "$1" in
385   0)
386     pushd %{dali_toolkit_style_files}
387     rm -rf *
388     popd
389   ;;
390 esac
391
392 %postun resources_720x1280
393 case "$1" in
394   0)
395     pushd %{dali_toolkit_style_files}
396     rm -rf *
397     popd
398   ;;
399 esac
400
401 %postun resources_1920x1080
402 case "$1" in
403   0)
404     pushd %{dali_toolkit_style_files}
405     rm -rf *
406     popd
407   ;;
408 esac
409
410 %postun resources_1920x1080_rpi
411 case "$1" in
412   0)
413     pushd %{dali_toolkit_style_files}
414     rm -rf *
415     popd
416   ;;
417 esac
418
419 ##############################
420 # Files in Binary Packages
421 ##############################
422 %files
423 %if 0%{?enable_dali_smack_rules}
424 %manifest dali-toolkit.manifest-smack
425 %else
426 %manifest dali-toolkit.manifest
427 %endif
428 %defattr(-,root,root,-)
429 %{_libdir}/libdali2-toolkit.so*
430 %license LICENSE
431
432 %files devel
433 %defattr(-,root,root,-)
434 %{dev_include_path}/dali-toolkit/*
435 %{_libdir}/pkgconfig/dali2-toolkit.pc
436 %{_bindir}/dali-shader-generator
437
438 %files resources_360x360
439 %manifest dali-toolkit-resources.manifest
440 %defattr(-,root,root,-)
441 %{dali_toolkit_image_files}/*
442 %{dali_toolkit_sound_files}/*
443 %{dali_toolkit_style_files}/360x360/*
444 %{dali_toolkit_style_files}/default-feedback-theme.json
445 %{_datadir}/locale/*/LC_MESSAGES/*
446
447 %files resources_480x800
448 %manifest dali-toolkit-resources.manifest
449 %defattr(-,root,root,-)
450 %{dali_toolkit_image_files}/*
451 %{dali_toolkit_sound_files}/*
452 %{dali_toolkit_style_files}/480x800/*
453 %{dali_toolkit_style_files}/default-feedback-theme.json
454 %{_datadir}/locale/*/LC_MESSAGES/*
455
456 %files resources_720x1280
457 %manifest dali-toolkit-resources.manifest
458 %defattr(-,root,root,-)
459 %{dali_toolkit_image_files}/*
460 %{dali_toolkit_sound_files}/*
461 %{dali_toolkit_style_files}/720x1280/*
462 %{dali_toolkit_style_files}/default-feedback-theme.json
463 %{_datadir}/locale/*/LC_MESSAGES/*
464
465 %files resources_1920x1080
466 %manifest dali-toolkit-resources.manifest
467 %defattr(-,root,root,-)
468 %{dali_toolkit_image_files}/*
469 %{dali_toolkit_sound_files}/*
470 %{dali_toolkit_style_files}/1920x1080/*
471 %{dali_toolkit_style_files}/default-feedback-theme.json
472 %{_datadir}/locale/*/LC_MESSAGES/*
473
474 %files resources_1920x1080_rpi
475 %manifest dali-toolkit-resources.manifest
476 %defattr(-,root,root,-)
477 %{dali_toolkit_image_files}/*
478 %{dali_toolkit_sound_files}/*
479 %{dali_toolkit_style_files}/1920x1080_rpi/*
480 %{dali_toolkit_style_files}/default-feedback-theme.json
481 %{_datadir}/locale/*/LC_MESSAGES/*
482
483 %files -n %{dali2_scene3d}
484 %if 0%{?enable_dali_smack_rules}
485 %manifest dali-scene3d.manifest-smack
486 %else
487 %manifest dali-scene3d.manifest
488 %endif
489 %defattr(-,root,root,-)
490 %{_libdir}/lib%{dali2_scene3d}.so
491 %license LICENSE
492
493 %files -n %{dali2_scene3d}-devel
494 %defattr(-,root,root,-)
495 %{_includedir}/dali-scene3d/public-api/*
496 %{_libdir}/pkgconfig/dali2-scene3d.pc