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