Revert "[Tizen] Change BuildRequires of dali2-toolkit to Requires"
[platform/core/uifw/dali-toolkit.git] / packaging / dali-toolkit.spec
1 Name:       dali2-toolkit
2 Summary:    Dali 3D engine Toolkit
3 Version:    2.0.17
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
91 BuildRequires:  pkgconfig(dali2-toolkit)
92
93 %description -n %{dali2_scene_loader}
94 Provides functionality for loading and displaying DLI format scenes. See README.md for more details.
95
96 %package -n %{dali2_scene_loader}-devel
97 Summary:    Development components for dali-scene-loader
98 Group:      Development/Building
99 Requires:   %{dali2_scene_loader} = %{version}-%{release}
100
101 %description -n %{dali2_scene_loader}-devel
102 Development components for dali-scene-loader.
103
104 ##############################
105 # Preparation
106 ##############################
107 %prep
108 %setup -q
109
110 %define dali_data_rw_dir            %TZ_SYS_SHARE/dali/
111 %define dali_data_ro_dir            %TZ_SYS_RO_SHARE/dali/
112
113 %define dali_toolkit_image_files    %{dali_data_ro_dir}/toolkit/images/
114 %define dali_toolkit_sound_files    %{dali_data_ro_dir}/toolkit/sounds/
115 %define dali_toolkit_style_files    %{dali_data_ro_dir}/toolkit/styles/
116 %define dev_include_path %{_includedir}
117
118 %define dali_xml_file_dir     %TZ_SYS_RO_PACKAGES
119
120 # PO
121 {
122 cd %{_builddir}/dali2-toolkit-%{version}/dali-toolkit/po
123 for language in *.po
124 do
125   language=${language%.po}
126   msgfmt -o ${language}.mo ${language}.po
127 done
128 } &> /dev/null
129
130 ##############################
131 # Build
132 ##############################
133 %build
134 PREFIX="/usr"
135 CXXFLAGS+=" -Wall -g -Os -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections "
136 LDFLAGS+=" -Wl,--rpath=$PREFIX/lib -Wl,--as-needed -Wl,--gc-sections -Wl,-Bsymbolic-functions "
137
138 %if 0%{?enable_coverage}
139 CXXFLAGS+=" --coverage "
140 LDFLAGS+=" --coverage "
141 %endif
142
143 %ifarch %{arm}
144 CXXFLAGS+=" -D_ARCH_ARM_"
145 %endif
146
147 libtoolize --force
148 cd %{_builddir}/dali2-toolkit-%{version}/build/tizen
149
150 DALI_DATA_RW_DIR="%{dali_data_rw_dir}" ; export DALI_DATA_RW_DIR
151 DALI_DATA_RO_DIR="%{dali_data_ro_dir}" ; export DALI_DATA_RO_DIR
152
153 cmake \
154 %if 0%{?enable_debug}
155       -DCMAKE_BUILD_TYPE=Debug \
156 %endif
157 %if 0%{?enable_trace}
158       -DENABLE_TRACE=ON \
159 %endif
160       -DCMAKE_INSTALL_PREFIX=%{_prefix} \
161       -DCMAKE_INSTALL_LIBDIR=%{_libdir} \
162       -DCMAKE_INSTALL_INCLUDEDIR=%{_includedir} \
163       -DENABLE_I18N=ON
164
165 make %{?jobs:-j%jobs}
166
167 ##############################
168 # Installation
169 ##############################
170 %install
171 rm -rf %{buildroot}
172 cd build/tizen
173
174 pushd %{_builddir}/%{name}-%{version}/build/tizen
175 %make_install
176
177 # PO
178 {
179 cd %{_builddir}/dali2-toolkit-%{version}/dali-toolkit/po
180 for language in *.mo
181 do
182   language=${language%.mo}
183   mkdir -p %{buildroot}/%{_datadir}/locale/${language}/LC_MESSAGES/
184   cp ${language}.mo %{buildroot}/%{_datadir}/locale/${language}/LC_MESSAGES/dali-toolkit.mo
185 done
186 } &> /dev/null
187 popd
188
189 # Remove default style and style images which are for Linux build
190 rm -rf %{buildroot}%{dali_toolkit_style_files}/*
191
192 # Make folder to contain style and style images
193 # After making folder, copy local style and style images to new folder
194 pushd %{_builddir}/%{name}-%{version}
195 mkdir -p %{buildroot}%{dali_toolkit_style_files}/360x360
196 cp -r dali-toolkit/styles/360x360/* %{buildroot}%{dali_toolkit_style_files}/360x360
197 mkdir -p %{buildroot}%{dali_toolkit_style_files}/480x800
198 cp -r dali-toolkit/styles/480x800/* %{buildroot}%{dali_toolkit_style_files}/480x800
199 mkdir -p %{buildroot}%{dali_toolkit_style_files}/720x1280
200 cp -r dali-toolkit/styles/720x1280/* %{buildroot}%{dali_toolkit_style_files}/720x1280
201 mkdir -p %{buildroot}%{dali_toolkit_style_files}/1920x1080
202 cp -r dali-toolkit/styles/1920x1080/* %{buildroot}%{dali_toolkit_style_files}/1920x1080
203
204 # Copy default feedback theme
205 cp dali-toolkit/styles/default-feedback-theme.json %{buildroot}%{dali_toolkit_style_files}
206 popd
207
208 ##############################
209 # Pre Install
210 ##############################
211
212 %pre resources_360x360
213 case "$1" in
214   2)
215     pushd %{dali_toolkit_style_files}
216     rm -rf ./*
217     popd
218   ;;
219 esac
220
221 %pre resources_480x800
222 case "$1" in
223   2)
224     pushd %{dali_toolkit_style_files}
225     rm -rf ./*
226     popd
227   ;;
228 esac
229
230 %pre resources_720x1280
231 case "$1" in
232   2)
233     pushd %{dali_toolkit_style_files}
234     rm -rf ./*
235     popd
236   ;;
237 esac
238
239 %pre resources_1920x1080
240 case "$1" in
241   2)
242     pushd %{dali_toolkit_style_files}
243     rm -rf ./*
244     popd
245   ;;
246 esac
247
248 ##############################
249 # Post Install
250 ##############################
251 %post
252 /sbin/ldconfig
253 exit 0
254
255 %post resources_360x360
256 pushd %{dali_toolkit_style_files}/360x360
257 for FILE in *; do mv ./"${FILE}" ../"${FILE}"; done
258 popd
259
260 %post resources_480x800
261 pushd %{dali_toolkit_style_files}/480x800
262 for FILE in *; do mv ./"${FILE}" ../"${FILE}"; done
263 popd
264
265 %post resources_720x1280
266 pushd %{dali_toolkit_style_files}/720x1280
267 for FILE in *; do mv ./"${FILE}" ../"${FILE}"; done
268 popd
269
270 %post resources_1920x1080
271 pushd %{dali_toolkit_style_files}/1920x1080
272 for FILE in *; do mv ./"${FILE}" ../"${FILE}"; done
273 popd
274
275 ##############################
276 # Pre Uninstall
277 ##############################
278
279 %preun resources_360x360
280 case "$1" in
281   0)
282     %preun resources_360x360
283     pushd %{dali_toolkit_style_files}
284     mv images ./360x360
285     mv dali-toolkit-default-theme.json ./360x360
286     popd
287   ;;
288 esac
289
290 %preun resources_480x800
291 case "$1" in
292   0)
293     %preun resources_480x800
294     pushd %{dali_toolkit_style_files}
295     mv images ./480x800
296     mv dali-toolkit-default-theme.json ./480x800
297     popd
298   ;;
299 esac
300
301 %preun resources_720x1280
302 case "$1" in
303   0)
304     %preun resources_720x1280
305     pushd %{dali_toolkit_style_files}
306     mv images ./720x1280
307     mv dali-toolkit-default-theme.json ./720x1280
308     popd
309   ;;
310 esac
311
312 %preun resources_1920x1080
313 case "$1" in
314   0)
315     %preun resources_1920x1080
316     pushd %{dali_toolkit_style_files}
317     mv images ./1920x1080
318     mv dali-toolkit-default-theme.json ./1920x1080
319     popd
320   ;;
321 esac
322
323 ##############################
324 # Post Uninstall
325 ##############################
326 %postun
327 /sbin/ldconfig
328 exit 0
329
330 %postun resources_360x360
331 case "$1" in
332   0)
333     pushd %{dali_toolkit_style_files}
334     rm -rf *
335     popd
336   ;;
337 esac
338
339 %postun resources_480x800
340 case "$1" in
341   0)
342     pushd %{dali_toolkit_style_files}
343     rm -rf *
344     popd
345   ;;
346 esac
347
348 %postun resources_720x1280
349 case "$1" in
350   0)
351     pushd %{dali_toolkit_style_files}
352     rm -rf *
353     popd
354   ;;
355 esac
356
357 %postun resources_1920x1080
358 case "$1" in
359   0)
360     pushd %{dali_toolkit_style_files}
361     rm -rf *
362     popd
363   ;;
364 esac
365
366 ##############################
367 # Files in Binary Packages
368 ##############################
369 %files
370 %if 0%{?enable_dali_smack_rules}
371 %manifest dali-toolkit.manifest-smack
372 %else
373 %manifest dali-toolkit.manifest
374 %endif
375 %defattr(-,root,root,-)
376 %{_libdir}/libdali2-toolkit.so*
377 %license LICENSE
378
379 %files devel
380 %defattr(-,root,root,-)
381 %{dev_include_path}/dali-toolkit/*
382 %{_libdir}/pkgconfig/dali2-toolkit.pc
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