Merge "[Tizen] Destructors cannot throw exceptions." into tizen
[platform/core/uifw/dali-adaptor.git] / packaging / dali-adaptor.spec
1 # NOTES
2 # This spec file is used to build DALi Adaptor for different Tizen Profiles
3 # Current profiles are:  Mobile, TV, Wearable, Common
4 #
5 # The profile variable is defined outside of the spec file in a build.conf file.
6 # It will contain the profile and whether or not to build with X11 or Wayland
7 #
8 # gbs will try to download the build.conf for the platform automatically from the repo location when
9 # performing a gbs build ( use gbs build -v to see it download location) E.g.
10 # http://download.tizen.org/snapshots/tizen/tv/tizen-tv/repos/arm-wayland/packages/repodata/xxxx-build.conf.gz
11
12 # Do not provide .so automatically for the extensions.
13 # This if statement is for backward compatibility with GBM/Obsolete build systems
14 %if "%{?profile}" != "wearable" && "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
15 %global __provides_exclude_from ^.*\\.(wearable|mobile|tv|ivi|common)$
16 %endif
17
18 %bcond_with wayland
19
20 Name:       dali-adaptor
21 Summary:    The DALi Tizen Adaptor
22 Version:    1.2.22
23 Release:    1
24 Group:      System/Libraries
25 License:    Apache-2.0 and BSD-2-Clause and MIT
26 URL:        https://review.tizen.org/git/?p=platform/core/uifw/dali-adaptor.git;a=summary
27 Source0:    %{name}-%{version}.tar.gz
28
29 Requires(post): /sbin/ldconfig
30 Requires(postun): /sbin/ldconfig
31 Requires:       giflib
32
33 #need libtzplatform-config for directory if tizen version is 3.x
34
35 %if "%{tizen_version_major}" >= "3"
36 %define tizen_platform_config_supported 1
37 BuildRequires:  pkgconfig(libtzplatform-config)
38 %endif
39
40
41 # Get the profile from tizen_profile_name if tizen version is 2.x and tizen_profile_name exists.
42
43 %if "%{tizen_version_major}" == "2" && 0%{?tizen_profile_name:1}
44 %define profile %{tizen_profile_name}
45 %endif
46
47 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
48 # if wearable || "undefined"
49 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
50 BuildRequires:  pkgconfig(capi-appfw-watch-application)
51 BuildRequires:  pkgconfig(appcore-watch)
52 %endif
53
54 BuildRequires:  pkgconfig(gles20)
55 BuildRequires:  pkgconfig(glesv2)
56
57 BuildRequires:  pkgconfig
58 BuildRequires:  gawk
59 BuildRequires:  pkgconfig(screen_connector_provider)
60 BuildRequires:  giflib-devel
61 BuildRequires:  pkgconfig(fontconfig)
62 BuildRequires:  libjpeg-turbo-devel
63 BuildRequires:  dali-devel
64 BuildRequires:  dali-integration-devel
65 BuildRequires:  pkgconfig(vconf)
66 BuildRequires:  tts-devel
67 BuildRequires:  pkgconfig(dlog)
68 BuildRequires:  libdrm-devel
69 BuildRequires:  pkgconfig(libexif)
70 BuildRequires:  pkgconfig(libpng)
71 BuildRequires:  pkgconfig(egl)
72 BuildRequires:  libcurl-devel
73 BuildRequires:  pkgconfig(harfbuzz)
74 BuildRequires:  fribidi-devel
75 BuildRequires:  pkgconfig(capi-system-info)
76 BuildRequires:  pkgconfig(capi-system-sensor)
77
78 # Tizen currently does not have libuv as a separate libuv package
79 # So we have to look into the uv headers bundled inside node-js
80 BuildRequires:  nodejs-devel
81
82
83 %if %{with wayland}
84
85 ####### BUILDING FOR WAYLAND #######
86 BuildRequires:  pkgconfig(wayland-egl)
87 BuildRequires:  pkgconfig(wayland-client)
88 BuildRequires:  wayland-devel
89 BuildRequires:  wayland-extension-client-devel
90
91 # dali-adaptor-uv uses libuv mainloop and has its own wayland client (it needs wayland-client headers).
92 BuildRequires:  libxkbcommon-devel
93
94 # dali-adaptor uses ecore mainloop
95 BuildRequires:  pkgconfig(ecore-wayland)
96
97 # dali-adaptor needs tbm_surface in tizen 3.0 wayland
98 BuildRequires:  pkgconfig(libtbm)
99
100 # tpkp-curl (certificate pinning for libcurl functions) is only available in Tizen 3.0
101 BuildRequires:  pkgconfig(tpkp-curl)
102
103 ####### BUILDING FOR X11#######
104 %else
105 BuildRequires:  pkgconfig(egl)
106 BuildRequires:  pkgconfig(xext)
107 BuildRequires:  pkgconfig(xi)
108 BuildRequires:  pkgconfig(xfixes)
109 BuildRequires:  pkgconfig(xdamage)
110 BuildRequires:  pkgconfig(utilX)
111 %endif
112
113 # for dali-adaptor
114 BuildRequires:  pkgconfig(evas)
115 BuildRequires:  pkgconfig(elementary)
116 BuildRequires:  pkgconfig(capi-appfw-application)
117 BuildRequires:  pkgconfig(capi-system-system-settings)
118
119 # for feedback plugin
120 BuildRequires:  pkgconfig(mm-sound)
121 BuildRequires:  libfeedback-devel
122
123 # for videoplayer Plugin
124 BuildRequires:  pkgconfig(capi-media-player)
125
126
127 # for multiprofile
128 Requires:   %{name}-compat = %{version}-%{release}
129 Recommends: %{name}-profile_common = %{version}-%{release}
130
131 %description
132 The DALi Tizen Adaptor provides a Tizen specific implementation of the dali-core
133 platform abstraction and application shell
134
135 ###########################################
136 # Dali adapter for profiles
137 ###########################################
138
139 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
140 # if mobile || "undefined"
141 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
142 %package profile_mobile
143 %define dali_feedback_plugin_mobile 0
144 Summary:        The DALi Tizen Adaptor for mobile
145 Provides:       %{name}-compat = %{version}-%{release}
146 Conflicts:      %{name}-profile_tv
147 Conflicts:      %{name}-profile_wearable
148 Conflicts:      %{name}-profile_ivi
149 Conflicts:      %{name}-profile_common
150 %description profile_mobile
151 The DALi Tizen Adaptor for mobile.
152 %endif
153
154 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
155 # if tv ||"undefined"
156 %if "%{?profile}" != "wearable" && "%{?profile}" != "common" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
157 %package profile_tv
158 %define dali_feedback_plugin_tv 0
159 Summary:        The DALi Tizen Adaptor for tv
160 Provides:       %{name}-compat = %{version}-%{release}
161 Conflicts:      %{name}-profile_mobile
162 Conflicts:      %{name}-profile_wearable
163 Conflicts:      %{name}-profile_ivi
164 Conflicts:      %{name}-profile_common
165 %description profile_tv
166 The DALi Tizen Adaptor for tv.
167 %endif
168
169 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
170 # if wearable || "undefined"
171 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
172 %package profile_wearable
173 %define dali_feedback_plugin_wearable 0
174 Summary:        The DALi Tizen Adaptor for wearable
175 Provides:       %{name}-compat = %{version}-%{release}
176 Conflicts:      %{name}-profile_mobile
177 Conflicts:      %{name}-profile_tv
178 Conflicts:      %{name}-profile_ivi
179 Conflicts:      %{name}-profile_common
180 %description profile_wearable
181 The DALi Tizen Adaptor for wearable.
182 %endif
183
184 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
185 # if ivi ||"undefined"
186 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "common" && "%{?profile}" != "mobile"
187 %package profile_ivi
188 %define dali_feedback_plugin_ivi 0
189 Summary:        The DALi Tizen Adaptor for ivi
190 Provides:       %{name}-compat = %{version}-%{release}
191 Conflicts:      %{name}-profile_mobile
192 Conflicts:      %{name}-profile_wearable
193 Conflicts:      %{name}-profile_tv
194 Conflicts:      %{name}-profile_common
195 %description profile_ivi
196 The DALi Tizen Adaptor for ivi.
197 %endif
198
199 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
200 # if common ||"undefined"
201 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
202 # Currently Tizen Common we use does not have wayland extensions like xdg-shell
203 %package profile_common
204 %define dali_feedback_plugin_common 0
205 %define tizen_2_2_compatibility 0
206 Summary:  The DALi Tizen Adaptor for common
207 Provides:       %{name}-compat = %{version}-%{release}
208 Conflicts:      %{name}-profile_mobile
209 Conflicts:      %{name}-profile_wearable
210 Conflicts:      %{name}-profile_tv
211 Conflicts:      %{name}-profile_ivi
212 %description profile_common
213 The DALi Tizen Adaptor for common.
214 %endif
215
216 ##############################
217 # devel
218 ##############################
219 %package devel
220 Summary:    Development components for the DALi Tizen Adaptor
221 Group:      Development/Building
222 Requires:   %{name} = %{version}-%{release}
223 Requires:   %{name}-integration-devel = %{version}-%{release}
224
225 %description devel
226 Development components for the DALi Tizen Adaptor - public headers and package configs
227
228 ##############################
229 # integration-devel
230 ##############################
231 %package integration-devel
232 Summary:    Integration development package for the Adaptor
233 Group:      Development/Building
234 Requires:   %{name} = %{version}-%{release}
235
236 %description integration-devel
237 Integration development package for the Adaptor - headers for integrating with an adaptor library.
238
239 ##############################
240 # Dali Feedback Plugin
241 ##############################
242
243 %package dali-feedback-plugin
244 Summary:    Plugin to play haptic and audio feedback for Dali
245 Group:      System/Libraries
246 Requires:   %{name} = %{version}-%{release}
247 Requires:   %{name}-dali-feedback-plugin-compat = %{version}-%{release}
248 Recommends: %{name}-dali-feedback-plugin-profile_common = %{version}-%{release}
249 %description dali-feedback-plugin
250 eedback plugin to play haptic and audio feedback for Dali
251
252 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
253 # if mobile || "undefined"
254 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
255 %package dali-feedback-plugin-profile_mobile
256 Summary:    Plugin to play haptic and audio feedback for Dali profile mobile.
257 Group:      System/Libraries
258 %if 0%{?dali_feedback_plugin_mobile}
259 Provides:       %{name}-dali-feedback-plugin-compat = %{version}-%{release}
260 Conflicts:      %{name}-dali-feedback-plugin-profile_ivi
261 Conflicts:      %{name}-dali-feedback-plugin-profile_wearable
262 Conflicts:      %{name}-dali-feedback-plugin-profile_tv
263 Conflicts:      %{name}-dali-feedback-plugin-profile_common
264 %endif
265 %description dali-feedback-plugin-profile_mobile
266 Feedback plugin to play haptic and audio feedback for Dali profile mobile.
267 %endif
268
269 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
270 # if tv ||"undefined"
271 %if "%{?profile}" != "wearable" && "%{?profile}" != "common" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
272 %package dali-feedback-plugin-profile_tv
273 Summary:    Plugin to play haptic and audio feedback for Dali profile tv.
274 Group:      System/Libraries
275 %if 0%{?dali_feedback_plugin_tv}
276 Provides:       %{name}-dali-feedback-plugin-compat = %{version}-%{release}
277 Conflicts:      %{name}-dali-feedback-plugin-profile_ivi
278 Conflicts:      %{name}-dali-feedback-plugin-profile_wearable
279 Conflicts:      %{name}-dali-feedback-plugin-profile_mobile
280 Conflicts:      %{name}-dali-feedback-plugin-profile_common
281 %endif
282 %description dali-feedback-plugin-profile_tv
283 Feedback plugin to play haptic and audio feedback for Dali profile tv.
284 %endif
285
286 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
287 # if wearable || "undefined"
288 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
289 %package dali-feedback-plugin-profile_wearable
290 Summary:    Plugin to play haptic and audio feedback for Dali profile wearable.
291 Group:      System/Libraries
292 %if 0%{?dali_feedback_plugin_wearable}
293 Provides:       %{name}-dali-feedback-plugin-compat = %{version}-%{release}
294 Conflicts:      %{name}-dali-feedback-plugin-profile_ivi
295 Conflicts:      %{name}-dali-feedback-plugin-profile_tv
296 Conflicts:      %{name}-dali-feedback-plugin-profile_mobile
297 Conflicts:      %{name}-dali-feedback-plugin-profile_common
298 %endif
299 %description dali-feedback-plugin-profile_wearable
300 Feedback plugin to play haptic and audio feedback for Dali profile wearable.
301 %endif
302
303 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
304 # if ivi ||"undefined"
305 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "common" && "%{?profile}" != "mobile"
306 %package dali-feedback-plugin-profile_ivi
307 Summary:    Plugin to play haptic and audio feedback for Dali profile ivi.
308 Group:      System/Libraries
309 %if 0%{?dali_feedback_plugin_ivi}
310 Provides:       %{name}-dali-feedback-plugin-compat = %{version}-%{release}
311 Conflicts:      %{name}-dali-feedback-plugin-profile_wearable
312 Conflicts:      %{name}-dali-feedback-plugin-profile_tv
313 Conflicts:      %{name}-dali-feedback-plugin-profile_mobile
314 Conflicts:      %{name}-dali-feedback-plugin-profile_common
315 %endif
316 %description dali-feedback-plugin-profile_ivi
317 Feedback plugin to play haptic and audio feedback for Dali profile ivi.
318 %endif
319
320 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
321 # if common ||"undefined"
322 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
323 %package dali-feedback-plugin-profile_common
324 Summary:    Plugin to play haptic and audio feedback for Dali profile common.
325 Group:      System/Libraries
326 %if 0%{?dali_feedback_plugin_common}
327 Provides:       %{name}-dali-feedback-plugin-compat = %{version}-%{release}
328 Conflicts:      %{name}-dali-feedback-plugin-profile_wearable
329 Conflicts:      %{name}-dali-feedback-plugin-profile_tv
330 Conflicts:      %{name}-dali-feedback-plugin-profile_mobile
331 Conflicts:      %{name}-dali-feedback-plugin-profile_ivi
332 %endif
333 %description dali-feedback-plugin-profile_common
334 Feedback plugin to play haptic and audio feedback for Dali profile common.
335 %endif
336
337 ##############################
338 # Dali VideoPlayer Plugin
339 ##############################
340 %if %{with wayland}
341
342 %package dali-video-player-plugin
343 Summary:    Plugin to play a video file for Dali
344 Group:      System/Libraries
345 %description dali-video-player-plugin
346 VideoPlayer plugin to play a video file for Dali
347 %endif
348
349 ##############################
350 # Preparation
351 ##############################
352 %prep
353 %setup -q
354
355 #Use TZ_PATH when tizen version is 3.x or greater
356
357 %if "%{tizen_version_major}" >= "3"
358 %define dali_data_rw_dir         %TZ_SYS_RO_SHARE/dali/
359 %define dali_data_ro_dir         %TZ_SYS_RO_SHARE/dali/
360 %define font_preloaded_path      %TZ_SYS_RO_SHARE/fonts/
361 %define font_downloaded_path     %TZ_SYS_SHARE/fonts/
362 %define font_application_path    %TZ_SYS_RO_SHARE/app_fonts/
363 %define font_configuration_file  %TZ_SYS_ETC/fonts/conf.avail/99-slp.conf
364 %else
365 %define dali_data_rw_dir         /usr/share/dali/
366 %define dali_data_ro_dir         /usr/share/dali/
367 %define font_preloaded_path      /usr/share/fonts/
368 %define font_downloaded_path     /opt/share/fonts/
369 %define font_application_path    /usr/share/app_fonts/
370 %define font_configuration_file  /opt/etc/fonts/conf.avail/99-slp.conf
371 %endif
372
373 %define user_shader_cache_dir    %{dali_data_ro_dir}/core/shaderbin/
374 %define dali_plugin_sound_files  %{dali_data_ro_dir}/plugins/sounds/
375 %define dev_include_path %{_includedir}
376
377 ##############################
378 # Build
379 ##############################
380 %build
381 PREFIX+="/usr"
382 CXXFLAGS+=" -Wall -g -Os -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections -DGL_GLEXT_PROTOTYPES"
383 LDFLAGS+=" -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--gc-sections -Wl,-Bsymbolic-functions "
384
385 %ifarch %{arm}
386 CXXFLAGS+=" -D_ARCH_ARM_ -lgcc"
387 %endif
388
389 %if %{with wayland}
390 CFLAGS+=" -DWAYLAND"
391 CXXFLAGS+=" -DWAYLAND"
392 configure_flags="--enable-wayland"
393 %endif
394
395 %if 0%{?tizen_2_2_compatibility}
396 CFLAGS+=" -DTIZEN_SDK_2_2_COMPATIBILITY"
397 CXXFLAGS+=" -DTIZEN_SDK_2_2_COMPATIBILITY"
398 %endif
399
400 libtoolize --force
401 cd %{_builddir}/%{name}-%{version}/build/tizen
402 autoreconf --install
403
404 DALI_DATA_RW_DIR="%{dali_data_rw_dir}" ; export DALI_DATA_RW_DIR
405 DALI_DATA_RO_DIR="%{dali_data_ro_dir}"  ; export DALI_DATA_RO_DIR
406 FONT_PRELOADED_PATH="%{font_preloaded_path}" ; export FONT_PRELOADED_PATH
407 FONT_DOWNLOADED_PATH="%{font_downloaded_path}" ; export FONT_DOWNLOADED_PATH
408 FONT_APPLICATION_PATH="%{font_application_path}"  ; export FONT_APPLICATION_PATH
409 FONT_CONFIGURATION_FILE="%{font_configuration_file}" ; export FONT_CONFIGURATION_FILE
410 %if 0%{?tizen_platform_config_supported}
411 TIZEN_PLATFORM_CONFIG_SUPPORTED="%{tizen_platform_config_supported}" ; export TIZEN_PLATFORM_CONFIG_SUPPORTED
412 %endif
413
414 # Default to GLES 2.0 if not specified.
415 %{!?target_gles_version: %define target_gles_version 20}
416
417 #--enable-efl=no \ # only affects dali-adaptor-uv
418 #--enable-appfw=yes \ # affects both dali-adaptor & dali-adaptor-uv
419 #--with-libuv=/usr/include/node/ \ # only affects dali-adaptor-uv
420
421 # Set up the build via configure.
422 #######################################################################
423 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
424 # if mobile || "undefined"
425 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
426 %configure --prefix=$PREFIX --with-jpeg-turbo --enable-gles=%{target_gles_version} \
427            --enable-shaderbincache=DISABLE --enable-profile=MOBILE \
428 %if 0%{?dali_feedback_plugin_mobile}
429            --enable-feedback \
430 %endif
431 %if 0%{?tizen_2_2_compatibility}
432            --with-tizen-2-2-compatibility \
433 %endif
434 %if %{with wayland}
435            --enable-efl=no \
436 %else
437            --enable-efl=yes \
438 %endif
439 %if 0%{?enable_debug}
440            --enable-debug \
441 %endif
442            --enable-appfw=yes \
443            --with-libuv=/usr/include/node/ \
444            $configure_flags --libdir=%{_libdir}
445
446 # Build.
447 make %{?jobs:-j%jobs}
448
449 pushd %{_builddir}/%{name}-%{version}/build/tizen
450 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
451 popd
452
453 pushd %{buildroot}%{_libdir}
454 for FILE in libdali-adap*.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE.mobile"; done
455 %if 0%{?dali_feedback_plugin_mobile}
456 for FILE in libdali-feedback-plugin.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE.mobile"; done
457 %endif
458 popd
459
460 rm -rf %{buildroot}%{_libdir}/libdali-adap*.so*
461 rm -rf %{buildroot}%{_libdir}/libdali-feedback-plugin.so*
462 %endif
463
464 #######################################################################
465 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
466 # if tv ||"undefined"
467 %if "%{?profile}" != "wearable" && "%{?profile}" != "common" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
468 %configure --prefix=$PREFIX --with-jpeg-turbo --enable-gles=%{target_gles_version} \
469            --enable-shaderbincache=ENABLE --enable-profile=TV \
470 %if 0%{?dali_feedback_plugin_tv}
471            --enable-feedback \
472 %endif
473 %if 0%{?tizen_2_2_compatibility}
474            --with-tizen-2-2-compatibility \
475 %endif
476 %if %{with wayland}
477            --enable-efl=no \
478 %else
479            --enable-efl=yes \
480 %endif
481 %if 0%{?enable_debug}
482            --enable-debug \
483 %endif
484            --enable-appfw=yes \
485            --with-libuv=/usr/include/node/ \
486            $configure_flags --libdir=%{_libdir}
487
488 # Build.
489 make %{?jobs:-j%jobs}
490
491 pushd %{_builddir}/%{name}-%{version}/build/tizen
492 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
493 popd
494
495 pushd %{buildroot}%{_libdir}
496 for FILE in libdali-adap*.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE.tv"; done
497 %if 0%{?dali_feedback_plugin_tv}
498 for FILE in libdali-feedback-plugin.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE.tv"; done
499 %endif
500 popd
501
502 rm -rf %{buildroot}%{_libdir}/libdali-adap*.so*
503 rm -rf %{buildroot}%{_libdir}/libdali-feedback-plugin.so*
504 %endif
505
506 #######################################################################
507 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
508 # if wearable || "undefined"
509 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
510 %configure --prefix=$PREFIX --with-jpeg-turbo --enable-gles=%{target_gles_version} \
511            --enable-shaderbincache=DISABLE --enable-profile=WEARABLE \
512 %if 0%{?dali_feedback_plugin_wearable}
513            --enable-feedback \
514 %endif
515 %if 0%{?tizen_2_2_compatibility}
516            --with-tizen-2-2-compatibility \
517 %endif
518 %if %{with wayland}
519            --enable-efl=no \
520 %else
521            --enable-efl=yes \
522 %endif
523 %if 0%{?enable_debug}
524            --enable-debug \
525 %endif
526            --enable-appfw=yes \
527            --with-libuv=/usr/include/node/ \
528            $configure_flags --libdir=%{_libdir}
529
530 # Build.
531 make %{?jobs:-j%jobs}
532
533 pushd %{_builddir}/%{name}-%{version}/build/tizen
534 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
535 popd
536
537 pushd %{buildroot}%{_libdir}
538 for FILE in libdali-adap*.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE.wearable"; done
539 %if 0%{?dali_feedback_plugin_wearable}
540 for FILE in libdali-feedback-plugin.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE.wearable"; done
541 %endif
542 popd
543
544 rm -rf %{buildroot}%{_libdir}/libdali-adap*.so*
545 rm -rf %{buildroot}%{_libdir}/libdali-feedback-plugin.so*
546 %endif
547
548 #######################################################################
549 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
550 # if ivi ||"undefined"
551 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "common" && "%{?profile}" != "mobile"
552 %configure --prefix=$PREFIX --with-jpeg-turbo --enable-gles=%{target_gles_version} \
553            --enable-shaderbincache=DISABLE --enable-profile=IVI \
554 %if 0%{?dali_feedback_plugin_ivi}
555            --enable-feedback \
556 %endif
557 %if 0%{?tizen_2_2_compatibility}
558            --with-tizen-2-2-compatibility \
559 %endif
560 %if %{with wayland}
561            --enable-efl=no \
562 %else
563            --enable-efl=yes \
564 %endif
565 %if 0%{?enable_debug}
566            --enable-debug \
567 %endif
568            --enable-appfw=yes \
569            --with-libuv=/usr/include/node/ \
570            $configure_flags --libdir=%{_libdir}
571
572 # Build.
573 make %{?jobs:-j%jobs}
574
575 pushd %{_builddir}/%{name}-%{version}/build/tizen
576 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
577 popd
578
579 pushd %{buildroot}%{_libdir}
580 for FILE in libdali-adap*.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE.ivi"; done
581 %if 0%{?dali_feedback_plugin_ivi}
582 for FILE in libdali-feedback-plugin.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE.ivi"; done
583 %endif
584 popd
585
586 rm -rf %{buildroot}%{_libdir}/libdali-adap*.so*
587 rm -rf %{buildroot}%{_libdir}/libdali-feedback-plugin.so*
588 %endif
589
590 #######################################################################
591 # common ( build dali_videoplayer_plugin for common uses )
592 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
593 # if common ||"undefined"
594 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
595 %configure --prefix=$PREFIX --with-jpeg-turbo --enable-gles=%{target_gles_version} \
596            --enable-shaderbincache=DISABLE --enable-profile=COMMON \
597 %if 0%{?dali_feedback_plugin_common}
598            --enable-feedback \
599 %endif
600            --enable-videoplayer \
601 %if 0%{?tizen_2_2_compatibility}
602            --with-tizen-2-2-compatibility \
603 %endif
604 %if %{with wayland}
605            --enable-efl=no \
606 %else
607            --enable-efl=yes \
608 %endif
609 %if 0%{?enable_debug}
610            --enable-debug \
611 %endif
612            --enable-appfw=yes \
613            --with-libuv=/usr/include/node/ \
614            $configure_flags --libdir=%{_libdir}
615
616 # Build.
617 make %{?jobs:-j%jobs}
618 %endif
619
620
621 ##############################
622 # Installation
623 ##############################
624 %install
625 rm -rf %{buildroot}
626
627 pushd %{_builddir}/%{name}-%{version}/build/tizen
628 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
629
630 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
631 # !unified && (wearable || tv || ivi || mobile)
632 %if "%{?profile}" == "wearable" || "%{?profile}" == "tv" || "%{?profile}" == "ivi" || "%{?profile}" == "mobile"
633 rm -rf %{buildroot}%{_libdir}/libdali-adap*.so*
634 rm -rf %{buildroot}%{_libdir}/libdali-feedback-plugin.so*
635 %endif
636
637 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
638 # wearable || tv || ivi || mobile || unified
639 %if "%{?profile}" != "common"
640 for FILE in libdali-*.so*; do mv "$FILE" "%{buildroot}%{_libdir}/$FILE"; done
641 %endif
642 popd
643
644 mkdir -p %{buildroot}/usr/share/license
645 cp -af %{_builddir}/%{name}-%{version}/LICENSE %{buildroot}/usr/share/license/%{name}
646
647 ##############################
648 # Upgrade order:
649 # 1 - Pre Install new package
650 # 2 - Install new package
651 # 3 - Post install new package
652 # 4 - Pre uninstall old package
653 # 5 - Remove files not overwritten by new package
654 # 6 - Post uninstall old package
655 ##############################
656
657 %pre
658 exit 0
659
660 ##############################
661 #  Post, Preun, Postun Install new package
662 ##############################
663 %post
664 /sbin/ldconfig
665 exit 0
666
667 %preun
668 exit 0
669
670 %postun
671 /sbin/ldconfig
672 exit 0
673
674 %if %{with wayland}
675 %post dali-video-player-plugin
676 /sbin/ldconfig
677 exit 0
678 %endif
679
680 %if %{with wayland}
681 %postun dali-video-player-plugin
682 /sbin/ldconfig
683 exit 0
684 %endif
685
686 ##############################
687
688 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
689 # if mobile || "undefined"
690 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
691 %post profile_mobile
692 pushd %{_libdir}
693 for FILE in libdali-adap*.so*.mobile; do ln -sf "$FILE" "${FILE%.mobile}"; done
694 popd
695 /sbin/ldconfig
696 exit 0
697
698 %postun profile_mobile
699 /sbin/ldconfig
700 exit 0
701
702 %if 0%{?dali_feedback_plugin_mobile}
703 %post dali-feedback-plugin-profile_mobile
704 pushd %{_libdir}
705 for FILE in libdali-feedback-plugin.so*.mobile; do ln -sf "$FILE" "${FILE%.mobile}"; done
706 popd
707 /sbin/ldconfig
708 exit 0
709 %endif
710
711 %if 0%{?dali_feedback_plugin_mobile}
712 %postun dali-feedback-plugin-profile_mobile
713 /sbin/ldconfig
714 exit 0
715 %endif
716 %endif
717
718 ##############################
719
720 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
721 # if tv ||"undefined"
722 %if "%{?profile}" != "wearable" && "%{?profile}" != "common" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
723 %post profile_tv
724 pushd %{_libdir}
725 for FILE in libdali-adap*.so*.tv; do ln -sf "$FILE" "${FILE%.tv}"; done
726 popd
727 /sbin/ldconfig
728 exit 0
729
730 %postun profile_tv
731 /sbin/ldconfig
732 exit 0
733
734 %if 0%{?dali_feedback_plugin_tv}
735 %post dali-feedback-plugin-profile_tv
736 pushd %{_libdir}
737 for FILE in libdali-feedback-plugin.so*.tv; do ln -sf "$FILE" "${FILE%.tv}"; done
738 popd
739 /sbin/ldconfig
740 exit 0
741 %endif
742
743 %if 0%{?dali_feedback_plugin_tv}
744 %postun dali-feedback-plugin-profile_tv
745 /sbin/ldconfig
746 exit 0
747 %endif
748 %endif
749
750 ##############################
751
752 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
753 # if wearable || "undefined"
754 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
755 %post profile_wearable
756 pushd %{_libdir}
757 for FILE in libdali-adap*.so*.wearable; do ln -sf "$FILE" "${FILE%.wearable}"; done
758 popd
759 /sbin/ldconfig
760 exit 0
761
762 %postun profile_wearable
763 /sbin/ldconfig
764 exit 0
765
766 %if 0%{?dali_feedback_plugin_wearable}
767 %post dali-feedback-plugin-profile_wearable
768 pushd %{_libdir}
769 for FILE in libdali-feedback-plugin.so*.wearable; do ln -sf "$FILE" "${FILE%.wearable}"; done
770 popd
771 /sbin/ldconfig
772 exit 0
773 %endif
774
775 %if 0%{?dali_feedback_plugin_wearable}
776 %postun dali-feedback-plugin-profile_wearable
777 /sbin/ldconfig
778 exit 0
779 %endif
780 %endif
781
782 ##############################
783
784 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
785 # if ivi ||"undefined"
786 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "common" && "%{?profile}" != "mobile"
787 %post profile_ivi
788 pushd %{_libdir}
789 for FILE in libdali-adap*.so*.ivi; do ln -sf "$FILE" "${FILE%.ivi}"; done
790 popd
791 /sbin/ldconfig
792 exit 0
793
794 %postun profile_ivi
795 /sbin/ldconfig
796 exit 0
797
798 %if 0%{?dali_feedback_plugin_ivi}
799 %post dali-feedback-plugin-profile_ivi
800 pushd %{_libdir}
801 for FILE in libdali-feedback-plugin.so*.ivi; do ln -sf "$FILE" "${FILE%.ivi}"; done
802 popd
803 /sbin/ldconfig
804 exit 0
805 %endif
806
807 %if 0%{?dali_feedback_plugin_ivi}
808 %postun dali-feedback-plugin-profile_ivi
809 /sbin/ldconfig
810 exit 0
811 %endif
812 %endif
813
814
815 ##############################
816 # Files in Binary Packages
817 ##############################
818
819 %files
820 %manifest dali-adaptor.manifest
821 %defattr(-,root,root,-)
822 %defattr(-,app,app,-)
823 %dir %{user_shader_cache_dir}
824 %{_bindir}/*
825 %{_datadir}/license/%{name}
826 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
827 # if common ||"undefined"
828 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
829 %defattr(-,root,root,-)
830 %{_libdir}/libdali-adap*.so*
831 %exclude %{_libdir}/libdali-adap*.so*.mobile
832 %exclude %{_libdir}/libdali-adap*.so*.wearable
833 %exclude %{_libdir}/libdali-adap*.so*.tv
834 %exclude %{_libdir}/libdali-adap*.so*.ivi
835 %endif
836
837 %files dali-feedback-plugin
838 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
839 # if common ||"undefined"
840 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
841 %if 0%{?dali_feedback_plugin_common}
842 %manifest dali-adaptor.manifest
843 %defattr(-,root,root,-)
844 %{_libdir}/libdali-feedback-plugin.so*
845 %exclude %{_libdir}/libdali-feedback-plugin.so*.mobile
846 %exclude %{_libdir}/libdali-feedback-plugin.so*.wearable
847 %exclude %{_libdir}/libdali-feedback-plugin.so*.tv
848 %exclude %{_libdir}/libdali-feedback-plugin.so*.ivi
849 %endif
850 %endif
851
852
853 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
854 # if common ||"undefined"
855 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
856 %files profile_common
857 # default .so files are housed in the main pkg.
858
859 %if 0%{?dali_feedback_plugin_common}
860 %files dali-feedback-plugin-profile_common
861 # default .so files are housed in the main pkg.
862 %manifest dali-adaptor.manifest
863 %defattr(-,root,root,-)
864 %{dali_plugin_sound_files}/*
865 %endif
866
867 %if %{with wayland}
868 %files dali-video-player-plugin
869 %manifest dali-adaptor.manifest
870 %defattr(-,root,root,-)
871 %{_libdir}/libdali-video-player-plugin.so*
872 %endif
873 %endif
874
875 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
876 # if mobile || "undefined"
877 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
878 %files profile_mobile
879 %manifest dali-adaptor.manifest
880 %defattr(-,root,root,-)
881 %{_libdir}/libdali-adap*.so*.mobile
882
883 %if 0%{?dali_feedback_plugin_mobile}
884 %files dali-feedback-plugin-profile_mobile
885 %manifest dali-adaptor.manifest
886 %defattr(-,root,root,-)
887 %{_libdir}/libdali-feedback-plugin.so*.mobile
888 %{dali_plugin_sound_files}/*
889 %endif
890 %endif
891
892 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
893 # if tv ||"undefined"
894 %if "%{?profile}" != "wearable" && "%{?profile}" != "common" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
895 %files profile_tv
896 %manifest dali-adaptor.manifest
897 %defattr(-,root,root,-)
898 %{_libdir}/libdali-adap*.so*.tv
899
900 %if 0%{?dali_feedback_plugin_tv}
901 %files dali-feedback-plugin-profile_tv
902 %manifest dali-adaptor.manifest
903 %defattr(-,root,root,-)
904 %{_libdir}/libdali-feedback-plugin.so*.tv
905 %{dali_plugin_sound_files}/*
906 %endif
907 %endif
908
909 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
910 # if wearable || "undefined"
911 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
912 %files profile_wearable
913 %manifest dali-adaptor.manifest
914 %defattr(-,root,root,-)
915 %{_libdir}/libdali-adap*.so*.wearable
916
917 %if 0%{?dali_feedback_plugin_wearable}
918 %files dali-feedback-plugin-profile_wearable
919 %manifest dali-adaptor.manifest
920 %defattr(-,root,root,-)
921 %{_libdir}/libdali-feedback-plugin.so*.wearable
922 %{dali_plugin_sound_files}/*
923 %endif
924 %endif
925
926 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
927 # if ivi ||"undefined"
928 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "common" && "%{?profile}" != "mobile"
929 %files profile_ivi
930 %manifest dali-adaptor.manifest
931 %defattr(-,root,root,-)
932 %{_libdir}/libdali-adap*.so*.ivi
933
934 %if 0%{?dali_feedback_plugin_ivi}
935 %files dali-feedback-plugin-profile_ivi
936 %manifest dali-adaptor.manifest
937 %defattr(-,root,root,-)
938 %{_libdir}/libdali-feedback-plugin.so*.ivi
939 %{dali_plugin_sound_files}/*
940 %endif
941 %endif
942
943
944 %files devel
945 %defattr(-,root,root,-)
946 %{dev_include_path}/dali/dali.h
947 %{dev_include_path}/dali/public-api/*
948 %{dev_include_path}/dali/devel-api/*
949 %{dev_include_path}/dali/doc/*
950 %{_libdir}/pkgconfig/dali-adaptor.pc
951 %{_libdir}/pkgconfig/dali-adaptor-uv.pc
952
953 %files integration-devel
954 %defattr(-,root,root,-)
955 %{dev_include_path}/dali/integration-api/adaptors/*
956 %{_libdir}/pkgconfig/dali-adaptor-integration.pc