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