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