Merge "Support multiple window rendering" into devel/master
[platform/core/uifw/dali-toolkit.git] / packaging / dali-toolkit.spec
1 Name:       dali-toolkit
2 Summary:    Dali 3D engine Toolkit
3 Version:    1.4.8
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
13 %if 0%{?tizen_version_major} < 4
14 %define disable_cxx03_build 1
15 %endif
16
17 BuildRequires:  pkgconfig
18 BuildRequires:  pkgconfig(dlog)
19 BuildRequires:  pkgconfig(dali-core)
20 BuildRequires:  pkgconfig(dali-adaptor)
21 %if !0%{?disable_cxx03_build}
22 BuildRequires:  pkgconfig(dali-core-cxx03)
23 BuildRequires:  pkgconfig(dali-adaptor-cxx03)
24 %endif
25 BuildRequires: gettext
26
27
28 #need libtzplatform-config for directory if tizen version is 3.x
29
30 %if 0%{?tizen_version_major} >= 3
31 BuildRequires:  pkgconfig(libtzplatform-config)
32 %endif
33
34 #############################
35 # profile setup
36 #############################
37
38 %if "%{tizen_version_major}" == "2" && 0%{?tizen_profile_name:1}
39 %define profile %{tizen_profile_name}
40 %endif
41
42 %description
43 Dali 3D engine Toolkit - a set of controls that provide
44 user interface functionality.
45
46 ##############################
47 # resource
48 ##############################
49 %package resources_360x360
50 Summary:    default resource files for 360x360
51 Requires:   %{name} = %{version}-%{release}
52 Conflicts:  %{name}-resources_480x800
53 Conflicts:  %{name}-resources_720x1280
54 Conflicts:  %{name}-resources_1920x1080
55 %description resources_360x360
56 dali-toolkit default resource files for 360x360
57 Contain po / sounds / common images / style / style images
58
59 %package resources_480x800
60 Summary:    default resource files for 480x800
61 Requires:   %{name} = %{version}-%{release}
62 Conflicts:  %{name}-resources_360x360
63 Conflicts:  %{name}-resources_720x1280
64 Conflicts:  %{name}-resources_1920x1080
65 %description resources_480x800
66 dali-toolkit default resource files for 480x800
67 Contain po / sounds / common images / style / style images
68
69 %package resources_720x1280
70 Summary:    default resource files for 720x1280
71 Requires:   %{name} = %{version}-%{release}
72 Conflicts:  %{name}-resources_360x360
73 Conflicts:  %{name}-resources_480x800
74 Conflicts:  %{name}-resources_1920x1080
75 %description resources_720x1280
76 dali-toolkit default resource files for 720x1280
77 Contain po / sounds / common images / style / style images
78
79 %package resources_1920x1080
80 Summary:    default resource files for 1920x1080
81 Requires:   %{name} = %{version}-%{release}
82 Conflicts:  %{name}-resources_360x360
83 Conflicts:  %{name}-resources_480x800
84 Conflicts:  %{name}-resources_720x1280
85 %description resources_1920x1080
86 dali-toolkit default resource files for 1920x1080
87 Contain po / sounds / common images / style / style images
88
89 %if !0%{?disable_cxx03_build}
90 %package cxx03
91 Summary:        Dali 3D engine Toolkit with cxx03
92 Provides:       %{name}-cxx03 = %{version}-%{release}
93
94 %description cxx03
95 Dali 3D engine Toolkit with cxx03
96 %endif
97
98 ##############################
99 # devel
100 ##############################
101 %package devel
102 Summary:    Application development package for Dali 3D engine toolkit
103 Group:      Development/Building
104 Requires:   %{name} = %{version}-%{release}
105
106 %description devel
107 Application development package for Dali 3D engine toolkit - headers and package config
108
109 ##############################
110 # Preparation
111 ##############################
112 %prep
113 %setup -q
114
115 #Use TZ_PATH when tizen version is 3.x
116
117 %if "%{tizen_version_major}" == "2"
118 %define dali_data_rw_dir            /opt/usr/share/dali/
119 %define dali_data_ro_dir            /usr/share/dali/
120 %else
121 %define dali_data_rw_dir            %TZ_SYS_SHARE/dali/
122 %define dali_data_ro_dir            %TZ_SYS_RO_SHARE/dali/
123 %endif
124
125 %define dali_toolkit_image_files    %{dali_data_ro_dir}/toolkit/images/
126 %define dali_toolkit_sound_files    %{dali_data_ro_dir}/toolkit/sounds/
127 %define dali_toolkit_style_files    %{dali_data_ro_dir}/toolkit/styles/
128 %define dev_include_path %{_includedir}
129
130 # PO
131 {
132 cd %{_builddir}/dali-toolkit-%{version}/dali-toolkit/po
133 for language in *.po
134 do
135   language=${language%.po}
136   msgfmt -o ${language}.mo ${language}.po
137 done
138 } &> /dev/null
139
140 ##############################
141 # Build
142 ##############################
143 %build
144 PREFIX="/usr"
145 CXXFLAGS+=" -Wall -g -Os -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections "
146 LDFLAGS+=" -Wl,--rpath=$PREFIX/lib -Wl,--as-needed -Wl,--gc-sections -Wl,-Bsymbolic-functions "
147
148 %if 0%{?enable_coverage}
149 CXXFLAGS+=" --coverage "
150 LDFLAGS+=" --coverage "
151 %endif
152
153 libtoolize --force
154 cd %{_builddir}/dali-toolkit-%{version}/build/tizen
155 autoreconf --install
156 DALI_DATA_RW_DIR="%{dali_data_rw_dir}" ; export DALI_DATA_RW_DIR
157 DALI_DATA_RO_DIR="%{dali_data_ro_dir}" ; export DALI_DATA_RO_DIR
158
159 %configure --enable-profile=TIZEN \
160 %if 0%{?enable_debug}
161            --enable-debug \
162 %endif
163 %if 0%{?enable_trace}
164       --enable-trace \
165 %endif
166            --enable-i18n=yes \
167            --enable-rename-so=no
168
169 make %{?jobs:-j%jobs}
170
171 pushd %{_builddir}/%{name}-%{version}/build/tizen
172 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
173 popd
174
175 pushd %{buildroot}%{_libdir}
176 for FILE in libdali-toolkit-cxx11.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE"; done
177 mv pkgconfig/dali-toolkit.pc %{_builddir}/%{name}-%{version}/build/tizen/dali-toolkit.pc
178 popd
179
180 %if !0%{?disable_cxx03_build}
181 make clean
182
183 libtoolize --force
184 cd %{_builddir}/dali-toolkit-%{version}/build/tizen
185 autoreconf --install
186
187 DALI_DATA_RW_DIR="%{dali_data_rw_dir}" ; export DALI_DATA_RW_DIR
188 DALI_DATA_RO_DIR="%{dali_data_ro_dir}" ; export DALI_DATA_RO_DIR
189
190 %configure --enable-profile=TIZEN \
191            --enable-cxx03-abi=yes \
192 %if 0%{?enable_debug}
193            --enable-debug \
194 %endif
195 %if 0%{?enable_trace}
196       --enable-trace \
197 %endif
198            --enable-i18n=yes \
199            --enable-rename-so=no
200
201 make %{?jobs:-j%jobs}
202 %endif
203
204 ##############################
205 # Installation
206 ##############################
207 %install
208 rm -rf %{buildroot}
209 pushd %{_builddir}/%{name}-%{version}/build/tizen
210 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
211
212 for FILE in libdali-toolkit-cxx11.so*; do mv "$FILE" "%{buildroot}%{_libdir}/$FILE"; done
213 mv dali-toolkit.pc %{buildroot}%{_libdir}/pkgconfig/dali-toolkit.pc
214
215 # PO
216 {
217 cd %{_builddir}/dali-toolkit-%{version}/dali-toolkit/po
218 for language in *.mo
219 do
220   language=${language%.mo}
221   mkdir -p %{buildroot}/%{_datadir}/locale/${language}/LC_MESSAGES/
222   cp ${language}.mo %{buildroot}/%{_datadir}/locale/${language}/LC_MESSAGES/dali-toolkit.mo
223 done
224 } &> /dev/null
225 popd
226
227 #############################
228 #rename
229 #############################
230 pushd  %{buildroot}%{_libdir}
231 rm -rf libdali-toolkit.so
232 rm -rf libdali-toolkit-cxx11.so
233 %if !0%{?disable_cxx03_build}
234 ln -s libdali-toolkit.so.0.0.* libdali-toolkit-cxx03.so
235 %endif
236 ln -s libdali-toolkit-cxx11.so.0.0.* libdali-toolkit.so
237 popd
238
239 # Remove default style and style images which are for Linux build
240 rm -rf %{buildroot}%{dali_toolkit_style_files}/*
241
242 # Make folder to contain style and style images
243 # After making folder, copy local style and style images to new folder
244 mkdir -p %{buildroot}%{dali_toolkit_style_files}/360x360
245 cp -r dali-toolkit/styles/360x360/* %{buildroot}%{dali_toolkit_style_files}/360x360
246 mkdir -p %{buildroot}%{dali_toolkit_style_files}/480x800
247 cp -r dali-toolkit/styles/480x800/* %{buildroot}%{dali_toolkit_style_files}/480x800
248 mkdir -p %{buildroot}%{dali_toolkit_style_files}/720x1280
249 cp -r dali-toolkit/styles/720x1280/* %{buildroot}%{dali_toolkit_style_files}/720x1280
250 mkdir -p %{buildroot}%{dali_toolkit_style_files}/1920x1080
251 cp -r dali-toolkit/styles/1920x1080/* %{buildroot}%{dali_toolkit_style_files}/1920x1080
252
253 # Copy default feedback theme
254 cp dali-toolkit/styles/default-feedback-theme.json %{buildroot}%{dali_toolkit_style_files}
255
256 ##############################
257 # Pre Install
258 ##############################
259
260 %pre resources_360x360
261 case "$1" in
262   2)
263     pushd %{dali_toolkit_style_files}
264     rm -rf ./*
265     popd
266   ;;
267 esac
268
269 %pre resources_480x800
270 case "$1" in
271   2)
272     pushd %{dali_toolkit_style_files}
273     rm -rf ./*
274     popd
275   ;;
276 esac
277
278 %pre resources_720x1280
279 case "$1" in
280   2)
281     pushd %{dali_toolkit_style_files}
282     rm -rf ./*
283     popd
284   ;;
285 esac
286
287 %pre resources_1920x1080
288 case "$1" in
289   2)
290     pushd %{dali_toolkit_style_files}
291     rm -rf ./*
292     popd
293   ;;
294 esac
295
296 ##############################
297 # Post Install
298 ##############################
299 %post
300 /sbin/ldconfig
301 exit 0
302
303 %post resources_360x360
304 pushd %{dali_toolkit_style_files}/360x360
305 for FILE in *; do mv ./"${FILE}" ../"${FILE}"; done
306 popd
307
308 %post resources_480x800
309 pushd %{dali_toolkit_style_files}/480x800
310 for FILE in *; do mv ./"${FILE}" ../"${FILE}"; done
311 popd
312
313 %post resources_720x1280
314 pushd %{dali_toolkit_style_files}/720x1280
315 for FILE in *; do mv ./"${FILE}" ../"${FILE}"; done
316 popd
317
318 %post resources_1920x1080
319 pushd %{dali_toolkit_style_files}/1920x1080
320 for FILE in *; do mv ./"${FILE}" ../"${FILE}"; done
321 popd
322
323 ##############################
324 # Pre Uninstall
325 ##############################
326
327 %preun resources_360x360
328 case "$1" in
329   0)
330     %preun resources_360x360
331     pushd %{dali_toolkit_style_files}
332     mv images ./360x360
333     mv dali-toolkit-default-theme.json ./360x360
334     popd
335   ;;
336 esac
337
338 %preun resources_480x800
339 case "$1" in
340   0)
341     %preun resources_480x800
342     pushd %{dali_toolkit_style_files}
343     mv images ./480x800
344     mv dali-toolkit-default-theme.json ./480x800
345     popd
346   ;;
347 esac
348
349 %preun resources_720x1280
350 case "$1" in
351   0)
352     %preun resources_720x1280
353     pushd %{dali_toolkit_style_files}
354     mv images ./720x1280
355     mv dali-toolkit-default-theme.json ./720x1280
356     popd
357   ;;
358 esac
359
360 %preun resources_1920x1080
361 case "$1" in
362   0)
363     %preun resources_1920x1080
364     pushd %{dali_toolkit_style_files}
365     mv images ./1920x1080
366     mv dali-toolkit-default-theme.json ./1920x1080
367     popd
368   ;;
369 esac
370
371 ##############################
372 # Post Uninstall
373 ##############################
374 %postun
375 /sbin/ldconfig
376 exit 0
377
378 %postun resources_360x360
379 case "$1" in
380   0)
381     pushd %{dali_toolkit_style_files}
382     rm -rf *
383     popd
384   ;;
385 esac
386
387 %postun resources_480x800
388 case "$1" in
389   0)
390     pushd %{dali_toolkit_style_files}
391     rm -rf *
392     popd
393   ;;
394 esac
395
396 %postun resources_720x1280
397 case "$1" in
398   0)
399     pushd %{dali_toolkit_style_files}
400     rm -rf *
401     popd
402   ;;
403 esac
404
405 %postun resources_1920x1080
406 case "$1" in
407   0)
408     pushd %{dali_toolkit_style_files}
409     rm -rf *
410     popd
411   ;;
412 esac
413
414 ##############################
415 # Files in Binary Packages
416 ##############################
417 %files
418 %if 0%{?enable_dali_smack_rules}
419 %manifest dali-toolkit.manifest-smack
420 %else
421 %manifest dali-toolkit.manifest
422 %endif
423 %defattr(-,root,root,-)
424 %{_libdir}/libdali-toolkit-cxx11.so.*
425 %{_libdir}/libdali-toolkit.so
426 %license LICENSE
427
428 %if !0%{?disable_cxx03_build}
429 %files cxx03
430 %if 0%{?enable_dali_smack_rules}
431 %manifest dali-toolkit.manifest-smack
432 %else
433 %manifest dali-toolkit.manifest
434 %endif
435 %defattr(-,root,root,-)
436 %{_libdir}/libdali-toolkit.so.*
437 %{_libdir}/libdali-toolkit-cxx03.so
438 %license LICENSE
439 %endif
440
441 %files devel
442 %defattr(-,root,root,-)
443 %{dev_include_path}/dali-toolkit/*
444 %{_libdir}/pkgconfig/dali-toolkit.pc
445
446 %files resources_360x360
447 %manifest dali-toolkit-resources.manifest
448 %defattr(-,root,root,-)
449 %{dali_toolkit_image_files}/*
450 %{dali_toolkit_sound_files}/*
451 %{dali_toolkit_style_files}/360x360/*
452 %{dali_toolkit_style_files}/default-feedback-theme.json
453 %{_datadir}/locale/*/LC_MESSAGES/*
454
455 %files resources_480x800
456 %manifest dali-toolkit-resources.manifest
457 %defattr(-,root,root,-)
458 %{dali_toolkit_image_files}/*
459 %{dali_toolkit_sound_files}/*
460 %{dali_toolkit_style_files}/480x800/*
461 %{dali_toolkit_style_files}/default-feedback-theme.json
462 %{_datadir}/locale/*/LC_MESSAGES/*
463
464 %files resources_720x1280
465 %manifest dali-toolkit-resources.manifest
466 %defattr(-,root,root,-)
467 %{dali_toolkit_image_files}/*
468 %{dali_toolkit_sound_files}/*
469 %{dali_toolkit_style_files}/720x1280/*
470 %{dali_toolkit_style_files}/default-feedback-theme.json
471 %{_datadir}/locale/*/LC_MESSAGES/*
472
473 %files resources_1920x1080
474 %manifest dali-toolkit-resources.manifest
475 %defattr(-,root,root,-)
476 %{dali_toolkit_image_files}/*
477 %{dali_toolkit_sound_files}/*
478 %{dali_toolkit_style_files}/1920x1080/*
479 %{dali_toolkit_style_files}/default-feedback-theme.json
480 %{_datadir}/locale/*/LC_MESSAGES/*