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