8898f80020a825e4232bfcb3cd73a306b3434923
[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.20
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(aul)
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 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
243 # if mobile || "undefined"
244 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
245 %package dali-feedback-plugin-profile_mobile
246 Summary:    Plugin to play haptic and audio feedback for Dali profile mobile.
247 Group:      System/Libraries
248 %if 0%{?dali_feedback_plugin_mobile}
249 Provides:       %{name}-dali-feedback-plugin = %{version}-%{release}
250 %endif
251 %description dali-feedback-plugin-profile_mobile
252 Feedback plugin to play haptic and audio feedback for Dali profile mobile.
253 %endif
254
255 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
256 # if tv ||"undefined"
257 %if "%{?profile}" != "wearable" && "%{?profile}" != "common" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
258 %package dali-feedback-plugin-profile_tv
259 Summary:    Plugin to play haptic and audio feedback for Dali profile tv.
260 Group:      System/Libraries
261 %if 0%{?dali_feedback_plugin_tv}
262 Provides:       %{name}-dali-feedback-plugin = %{version}-%{release}
263 %endif
264 %description dali-feedback-plugin-profile_tv
265 Feedback plugin to play haptic and audio feedback for Dali profile tv.
266 %endif
267
268 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
269 # if wearable || "undefined"
270 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
271 %package dali-feedback-plugin-profile_wearable
272 Summary:    Plugin to play haptic and audio feedback for Dali profile wearable.
273 Group:      System/Libraries
274 %if 0%{?dali_feedback_plugin_wearable}
275 Provides:       %{name}-dali-feedback-plugin = %{version}-%{release}
276 %endif
277 %description dali-feedback-plugin-profile_wearable
278 Feedback plugin to play haptic and audio feedback for Dali profile wearable.
279 %endif
280
281 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
282 # if ivi ||"undefined"
283 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "common" && "%{?profile}" != "mobile"
284 %package dali-feedback-plugin-profile_ivi
285 Summary:    Plugin to play haptic and audio feedback for Dali profile ivi.
286 Group:      System/Libraries
287 %if 0%{?dali_feedback_plugin_ivi}
288 Provides:       %{name}-dali-feedback-plugin = %{version}-%{release}
289 %endif
290 %description dali-feedback-plugin-profile_ivi
291 Feedback plugin to play haptic and audio feedback for Dali profile ivi.
292 %endif
293
294 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
295 # if common ||"undefined"
296 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
297 %package dali-feedback-plugin-profile_common
298 Summary:    Plugin to play haptic and audio feedback for Dali profile common.
299 Group:      System/Libraries
300 %if 0%{?dali_feedback_plugin_common}
301 Provides:       %{name}-dali-feedback-plugin = %{version}-%{release}
302 %endif
303 %description dali-feedback-plugin-profile_common
304 Feedback plugin to play haptic and audio feedback for Dali profile common.
305 %endif
306
307 ##############################
308 # Dali VideoPlayer Plugin
309 ##############################
310 %if %{with wayland}
311
312 %package dali-video-player-plugin
313 Summary:    Plugin to play a video file for Dali
314 Group:      System/Libraries
315 %description dali-video-player-plugin
316 VideoPlayer plugin to play a video file for Dali
317 %endif
318
319 ##############################
320 # Preparation
321 ##############################
322 %prep
323 %setup -q
324
325 #Use TZ_PATH when tizen version is 3.x or greater
326
327 %if "%{tizen_version_major}" >= "3"
328 %define dali_data_rw_dir         %TZ_SYS_RO_SHARE/dali/
329 %define dali_data_ro_dir         %TZ_SYS_RO_SHARE/dali/
330 %define font_preloaded_path      %TZ_SYS_RO_SHARE/fonts/
331 %define font_downloaded_path     %TZ_SYS_SHARE/fonts/
332 %define font_application_path    %TZ_SYS_RO_SHARE/app_fonts/
333 %define font_configuration_file  %TZ_SYS_ETC/fonts/conf.avail/99-slp.conf
334 %else
335 %define dali_data_rw_dir         /usr/share/dali/
336 %define dali_data_ro_dir         /usr/share/dali/
337 %define font_preloaded_path      /usr/share/fonts/
338 %define font_downloaded_path     /opt/share/fonts/
339 %define font_application_path    /usr/share/app_fonts/
340 %define font_configuration_file  /opt/etc/fonts/conf.avail/99-slp.conf
341 %endif
342
343 %define user_shader_cache_dir    %{dali_data_ro_dir}/core/shaderbin/
344 %define dali_plugin_sound_files  %{dali_data_ro_dir}/plugins/sounds/
345 %define dev_include_path %{_includedir}
346
347 ##############################
348 # Build
349 ##############################
350 %build
351 PREFIX+="/usr"
352 CXXFLAGS+=" -Wall -g -Os -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections -DGL_GLEXT_PROTOTYPES"
353 LDFLAGS+=" -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--gc-sections -Wl,-Bsymbolic-functions "
354
355 %ifarch %{arm}
356 CXXFLAGS+=" -D_ARCH_ARM_ -lgcc"
357 %endif
358
359 %if %{with wayland}
360 CFLAGS+=" -DWAYLAND"
361 CXXFLAGS+=" -DWAYLAND"
362 configure_flags="--enable-wayland"
363 %endif
364
365 %if 0%{?tizen_2_2_compatibility}
366 CFLAGS+=" -DTIZEN_SDK_2_2_COMPATIBILITY"
367 CXXFLAGS+=" -DTIZEN_SDK_2_2_COMPATIBILITY"
368 %endif
369
370 libtoolize --force
371 cd %{_builddir}/%{name}-%{version}/build/tizen
372 autoreconf --install
373
374 DALI_DATA_RW_DIR="%{dali_data_rw_dir}" ; export DALI_DATA_RW_DIR
375 DALI_DATA_RO_DIR="%{dali_data_ro_dir}"  ; export DALI_DATA_RO_DIR
376 FONT_PRELOADED_PATH="%{font_preloaded_path}" ; export FONT_PRELOADED_PATH
377 FONT_DOWNLOADED_PATH="%{font_downloaded_path}" ; export FONT_DOWNLOADED_PATH
378 FONT_APPLICATION_PATH="%{font_application_path}"  ; export FONT_APPLICATION_PATH
379 FONT_CONFIGURATION_FILE="%{font_configuration_file}" ; export FONT_CONFIGURATION_FILE
380 %if 0%{?tizen_platform_config_supported}
381 TIZEN_PLATFORM_CONFIG_SUPPORTED="%{tizen_platform_config_supported}" ; export TIZEN_PLATFORM_CONFIG_SUPPORTED
382 %endif
383
384 # Default to GLES 2.0 if not specified.
385 %{!?target_gles_version: %define target_gles_version 20}
386
387 #--enable-efl=no \ # only affects dali-adaptor-uv
388 #--enable-appfw=yes \ # affects both dali-adaptor & dali-adaptor-uv
389 #--with-libuv=/usr/include/node/ \ # only affects dali-adaptor-uv
390
391 # Set up the build via configure.
392 #######################################################################
393 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
394 # if mobile || "undefined"
395 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
396 %configure --prefix=$PREFIX --with-jpeg-turbo --enable-gles=%{target_gles_version} \
397            --enable-shaderbincache=DISABLE --enable-profile=MOBILE \
398 %if 0%{?dali_feedback_plugin_mobile}
399            --enable-feedback \
400 %endif
401 %if 0%{?tizen_2_2_compatibility}
402            --with-tizen-2-2-compatibility \
403 %endif
404 %if %{with wayland}
405            --enable-efl=no \
406 %else
407            --enable-efl=yes \
408 %endif
409 %if 0%{?enable_debug}
410            --enable-debug \
411 %endif
412            --enable-appfw=yes \
413            --with-libuv=/usr/include/node/ \
414            $configure_flags --libdir=%{_libdir}
415
416 # Build.
417 make %{?jobs:-j%jobs}
418
419 pushd %{_builddir}/%{name}-%{version}/build/tizen
420 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
421 popd
422
423 pushd %{buildroot}%{_libdir}
424 for FILE in libdali-adap*.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE.mobile"; done
425 %if 0%{?dali_feedback_plugin_mobile}
426 for FILE in libdali-feedback-plugin.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE.mobile"; done
427 %endif
428 popd
429
430 rm -rf %{buildroot}%{_libdir}/libdali-adap*.so*
431 rm -rf %{buildroot}%{_libdir}/libdali-feedback-plugin.so*
432 %endif
433
434 #######################################################################
435 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
436 # if tv ||"undefined"
437 %if "%{?profile}" != "wearable" && "%{?profile}" != "common" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
438 %configure --prefix=$PREFIX --with-jpeg-turbo --enable-gles=%{target_gles_version} \
439            --enable-shaderbincache=ENABLE --enable-profile=TV \
440 %if 0%{?dali_feedback_plugin_tv}
441            --enable-feedback \
442 %endif
443 %if 0%{?tizen_2_2_compatibility}
444            --with-tizen-2-2-compatibility \
445 %endif
446 %if %{with wayland}
447            --enable-efl=no \
448 %else
449            --enable-efl=yes \
450 %endif
451 %if 0%{?enable_debug}
452            --enable-debug \
453 %endif
454            --enable-appfw=yes \
455            --with-libuv=/usr/include/node/ \
456            $configure_flags --libdir=%{_libdir}
457
458 # Build.
459 make %{?jobs:-j%jobs}
460
461 pushd %{_builddir}/%{name}-%{version}/build/tizen
462 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
463 popd
464
465 pushd %{buildroot}%{_libdir}
466 for FILE in libdali-adap*.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE.tv"; done
467 %if 0%{?dali_feedback_plugin_tv}
468 for FILE in libdali-feedback-plugin.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE.tv"; done
469 %endif
470 popd
471
472 rm -rf %{buildroot}%{_libdir}/libdali-adap*.so*
473 rm -rf %{buildroot}%{_libdir}/libdali-feedback-plugin.so*
474 %endif
475
476 #######################################################################
477 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
478 # if wearable || "undefined"
479 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
480 %configure --prefix=$PREFIX --with-jpeg-turbo --enable-gles=%{target_gles_version} \
481            --enable-shaderbincache=DISABLE --enable-profile=WEARABLE \
482 %if 0%{?dali_feedback_plugin_wearable}
483            --enable-feedback \
484 %endif
485 %if 0%{?tizen_2_2_compatibility}
486            --with-tizen-2-2-compatibility \
487 %endif
488 %if %{with wayland}
489            --enable-efl=no \
490 %else
491            --enable-efl=yes \
492 %endif
493 %if 0%{?enable_debug}
494            --enable-debug \
495 %endif
496            --enable-appfw=yes \
497            --with-libuv=/usr/include/node/ \
498            $configure_flags --libdir=%{_libdir}
499
500 # Build.
501 make %{?jobs:-j%jobs}
502
503 pushd %{_builddir}/%{name}-%{version}/build/tizen
504 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
505 popd
506
507 pushd %{buildroot}%{_libdir}
508 for FILE in libdali-adap*.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE.wearable"; done
509 %if 0%{?dali_feedback_plugin_wearable}
510 for FILE in libdali-feedback-plugin.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE.wearable"; done
511 %endif
512 popd
513
514 rm -rf %{buildroot}%{_libdir}/libdali-adap*.so*
515 rm -rf %{buildroot}%{_libdir}/libdali-feedback-plugin.so*
516 %endif
517
518 #######################################################################
519 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
520 # if ivi ||"undefined"
521 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "common" && "%{?profile}" != "mobile"
522 %configure --prefix=$PREFIX --with-jpeg-turbo --enable-gles=%{target_gles_version} \
523            --enable-shaderbincache=DISABLE --enable-profile=IVI \
524 %if 0%{?dali_feedback_plugin_ivi}
525            --enable-feedback \
526 %endif
527 %if 0%{?tizen_2_2_compatibility}
528            --with-tizen-2-2-compatibility \
529 %endif
530 %if %{with wayland}
531            --enable-efl=no \
532 %else
533            --enable-efl=yes \
534 %endif
535 %if 0%{?enable_debug}
536            --enable-debug \
537 %endif
538            --enable-appfw=yes \
539            --with-libuv=/usr/include/node/ \
540            $configure_flags --libdir=%{_libdir}
541
542 # Build.
543 make %{?jobs:-j%jobs}
544
545 pushd %{_builddir}/%{name}-%{version}/build/tizen
546 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
547 popd
548
549 pushd %{buildroot}%{_libdir}
550 for FILE in libdali-adap*.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE.ivi"; done
551 %if 0%{?dali_feedback_plugin_ivi}
552 for FILE in libdali-feedback-plugin.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE.ivi"; done
553 %endif
554 popd
555
556 rm -rf %{buildroot}%{_libdir}/libdali-adap*.so*
557 rm -rf %{buildroot}%{_libdir}/libdali-feedback-plugin.so*
558 %endif
559
560 #######################################################################
561 # common ( build dali_videoplayer_plugin for common uses )
562 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
563 # if common ||"undefined"
564 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
565 %configure --prefix=$PREFIX --with-jpeg-turbo --enable-gles=%{target_gles_version} \
566            --enable-shaderbincache=DISABLE --enable-profile=COMMON \
567 %if 0%{?dali_feedback_plugin_common}
568            --enable-feedback \
569 %endif
570            --enable-videoplayer \
571 %if 0%{?tizen_2_2_compatibility}
572            --with-tizen-2-2-compatibility \
573 %endif
574 %if %{with wayland}
575            --enable-efl=no \
576 %else
577            --enable-efl=yes \
578 %endif
579 %if 0%{?enable_debug}
580            --enable-debug \
581 %endif
582            --enable-appfw=yes \
583            --with-libuv=/usr/include/node/ \
584            $configure_flags --libdir=%{_libdir}
585
586 # Build.
587 make %{?jobs:-j%jobs}
588
589 pushd %{_builddir}/%{name}-%{version}/build/tizen
590 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
591 popd
592
593 pushd %{buildroot}%{_libdir}
594 for FILE in libdali-adap*.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE.common"; done
595 %if 0%{?dali_feedback_plugin_common}
596 for FILE in libdali-feedback-plugin.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE.common"; done
597 %endif
598 popd
599
600 rm -rf %{buildroot}%{_libdir}/libdali-adap*.so*
601 rm -rf %{buildroot}%{_libdir}/libdali-feedback-plugin.so*
602 %endif
603
604 ##############################
605 # Installation
606 ##############################
607 %install
608 rm -rf %{buildroot}
609
610 pushd %{_builddir}/%{name}-%{version}/build/tizen
611 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
612
613 rm -rf %{buildroot}%{_libdir}/libdali-adap*.so*
614 rm -rf %{buildroot}%{_libdir}/libdali-feedback-plugin.so*
615 for FILE in libdali-adap*.so*; do mv "$FILE" "%{buildroot}%{_libdir}/$FILE"; done
616
617 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
618 # if mobile || "undefined"
619 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
620 %if 0%{?dali_feedback_plugin_mobile}
621 for FILE in libdali-feedback-plugin.so*.mobile; do mv $FILE" "$FILE"; done
622 %endif
623 %endif
624
625 # if tv ||"undefined"
626 %if "%{?profile}" != "wearable" && "%{?profile}" != "common" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
627 %if 0%{?dali_feedback_plugin_tv}
628 for FILE in libdali-feedback-plugin.so*.tv; do mv $FILE" "$FILE"; done
629 %endif
630 %endif
631
632 # if wearable || "undefined"
633 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
634 %if 0%{?dali_feedback_plugin_wearable}
635 for FILE in libdali-feedback-plugin.so*.wearable; do mv $FILE" "$FILE"; done
636 %endif
637 %endif
638
639 # if ivi ||"undefined"
640 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "common" && "%{?profile}" != "mobile"
641 %if 0%{?dali_feedback_plugin_ivi}
642 for FILE in libdali-feedback-plugin.so*.ivi; do mv $FILE" "$FILE"; done
643 %endif
644 %endif
645
646 # if common ||"undefined"
647 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
648 %if 0%{?dali_feedback_plugin_common}
649 for FILE in libdali-feedback-plugin.so*.common; do mv $FILE" "$FILE"; done
650 %endif
651 %endif
652
653 popd
654
655 mkdir -p %{buildroot}/usr/share/license
656 cp -af %{_builddir}/%{name}-%{version}/LICENSE %{buildroot}/usr/share/license/%{name}
657
658 ##############################
659 # Upgrade order:
660 # 1 - Pre Install new package
661 # 2 - Install new package
662 # 3 - Post install new package
663 # 4 - Pre uninstall old package
664 # 5 - Remove files not overwritten by new package
665 # 6 - Post uninstall old package
666 ##############################
667
668 %pre
669 exit 0
670
671 ##############################
672 #  Post, Preun, Postun Install new package
673 ##############################
674 %post
675 /sbin/ldconfig
676 exit 0
677
678 %preun
679 exit 0
680
681 %postun
682 /sbin/ldconfig
683 exit 0
684
685 %if %{with wayland}
686 %post dali-video-player-plugin
687 /sbin/ldconfig
688 exit 0
689 %endif
690
691 %if %{with wayland}
692 %postun dali-video-player-plugin
693 /sbin/ldconfig
694 exit 0
695 %endif
696
697 ##############################
698
699 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
700 # if mobile || "undefined"
701 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
702 %post profile_mobile
703 pushd %{_libdir}
704 for FILE in libdali-adap*.so*.mobile; do ln -sf "$FILE" "${FILE%.mobile}"; done
705 popd
706 /sbin/ldconfig
707 exit 0
708
709 %postun profile_mobile
710 /sbin/ldconfig
711 exit 0
712
713 %if 0%{?dali_feedback_plugin_mobile}
714 %post dali-feedback-plugin-profile_mobile
715 pushd %{_libdir}
716 for FILE in libdali-feedback-plugin.so*.mobile; do ln -sf "$FILE" "${FILE%.mobile}"; done
717 popd
718 /sbin/ldconfig
719 exit 0
720 %endif
721
722 %if 0%{?dali_feedback_plugin_mobile}
723 %postun dali-feedback-plugin-profile_mobile
724 /sbin/ldconfig
725 exit 0
726 %endif
727 %endif
728
729 ##############################
730
731 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
732 # if tv ||"undefined"
733 %if "%{?profile}" != "wearable" && "%{?profile}" != "common" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
734 %post profile_tv
735 pushd %{_libdir}
736 for FILE in libdali-adap*.so*.tv; do ln -sf "$FILE" "${FILE%.tv}"; done
737 popd
738 /sbin/ldconfig
739 exit 0
740
741 %postun profile_tv
742 /sbin/ldconfig
743 exit 0
744
745 %if 0%{?dali_feedback_plugin_tv}
746 %post dali-feedback-plugin-profile_tv
747 pushd %{_libdir}
748 for FILE in libdali-feedback-plugin.so*.tv; do ln -sf "$FILE" "${FILE%.tv}"; done
749 popd
750 /sbin/ldconfig
751 exit 0
752 %endif
753
754 %if 0%{?dali_feedback_plugin_tv}
755 %postun dali-feedback-plugin-profile_tv
756 /sbin/ldconfig
757 exit 0
758 %endif
759 %endif
760
761 ##############################
762
763 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
764 # if wearable || "undefined"
765 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
766 %post profile_wearable
767 pushd %{_libdir}
768 for FILE in libdali-adap*.so*.wearable; do ln -sf "$FILE" "${FILE%.wearable}"; done
769 popd
770 /sbin/ldconfig
771 exit 0
772
773 %postun profile_wearable
774 /sbin/ldconfig
775 exit 0
776
777 %if 0%{?dali_feedback_plugin_wearable}
778 %post dali-feedback-plugin-profile_wearable
779 pushd %{_libdir}
780 for FILE in libdali-feedback-plugin.so*.wearable; do ln -sf "$FILE" "${FILE%.wearable}"; done
781 popd
782 /sbin/ldconfig
783 exit 0
784 %endif
785
786 %if 0%{?dali_feedback_plugin_wearable}
787 %postun dali-feedback-plugin-profile_wearable
788 /sbin/ldconfig
789 exit 0
790 %endif
791 %endif
792
793 ##############################
794
795 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
796 # if ivi ||"undefined"
797 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "common" && "%{?profile}" != "mobile"
798 %post profile_ivi
799 pushd %{_libdir}
800 for FILE in libdali-adap*.so*.ivi; do ln -sf "$FILE" "${FILE%.ivi}"; done
801 popd
802 /sbin/ldconfig
803 exit 0
804
805 %postun profile_ivi
806 /sbin/ldconfig
807 exit 0
808
809 %if 0%{?dali_feedback_plugin_ivi}
810 %post dali-feedback-plugin-profile_ivi
811 pushd %{_libdir}
812 for FILE in libdali-feedback-plugin.so*.ivi; do ln -sf "$FILE" "${FILE%.ivi}"; done
813 popd
814 /sbin/ldconfig
815 exit 0
816 %endif
817
818 %if 0%{?dali_feedback_plugin_ivi}
819 %postun dali-feedback-plugin-profile_ivi
820 /sbin/ldconfig
821 exit 0
822 %endif
823 %endif
824
825 ##############################
826
827 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
828 # if common ||"undefined"
829 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
830 %post profile_common
831 pushd %{_libdir}
832 for FILE in libdali-adap*.so*.common; do ln -sf "$FILE" "${FILE%.common}"; done
833 popd
834 /sbin/ldconfig
835 exit 0
836
837 %postun profile_common
838 /sbin/ldconfig
839 exit 0
840
841 %if 0%{?dali_feedback_plugin_common}
842 %post dali-feedback-plugin-profile_common
843 pushd %{_libdir}
844 for FILE in libdali-feedback-plugin.so*.common; do ln -sf "$FILE" "${FILE%.common}"; done
845 popd
846 /sbin/ldconfig
847 exit 0
848 %endif
849
850 %if 0%{?dali_feedback_plugin_common}
851 %postun dali-feedback-plugin-profile_common
852 /sbin/ldconfig
853 exit 0
854 %endif
855 %endif
856
857 ##############################
858 # Files in Binary Packages
859 ##############################
860
861 %files
862 %manifest dali-adaptor.manifest
863 %defattr(-,root,root,-)
864 %defattr(-,app,app,-)
865 %dir %{user_shader_cache_dir}
866 %{_bindir}/*
867 %{_datadir}/license/%{name}
868
869 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
870 # if mobile || "undefined"
871 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
872 %files profile_mobile
873 %manifest dali-adaptor.manifest
874 %defattr(-,root,root,-)
875 %{_libdir}/libdali-adap*.so*.mobile
876
877 %if 0%{?dali_feedback_plugin_mobile}
878 %files dali-feedback-plugin-profile_mobile
879 %manifest dali-adaptor.manifest
880 %defattr(-,root,root,-)
881 %{_libdir}/libdali-feedback-plugin.so*.mobile
882 %{dali_plugin_sound_files}/*
883 %endif
884 %endif
885
886 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
887 # if tv ||"undefined"
888 %if "%{?profile}" != "wearable" && "%{?profile}" != "common" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
889 %files profile_tv
890 %manifest dali-adaptor.manifest
891 %defattr(-,root,root,-)
892 %{_libdir}/libdali-adap*.so*.tv
893
894 %if 0%{?dali_feedback_plugin_tv}
895 %files dali-feedback-plugin-profile_tv
896 %manifest dali-adaptor.manifest
897 %defattr(-,root,root,-)
898 %{_libdir}/libdali-feedback-plugin.so*.tv
899 %{dali_plugin_sound_files}/*
900 %endif
901 %endif
902
903 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
904 # if wearable || "undefined"
905 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
906 %files profile_wearable
907 %manifest dali-adaptor.manifest
908 %defattr(-,root,root,-)
909 %{_libdir}/libdali-adap*.so*.wearable
910
911 %if 0%{?dali_feedback_plugin_wearable}
912 %files dali-feedback-plugin-profile_wearable
913 %manifest dali-adaptor.manifest
914 %defattr(-,root,root,-)
915 %{_libdir}/libdali-feedback-plugin.so*.wearable
916 %{dali_plugin_sound_files}/*
917 %endif
918 %endif
919
920 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
921 # if ivi ||"undefined"
922 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "common" && "%{?profile}" != "mobile"
923 %files profile_ivi
924 %manifest dali-adaptor.manifest
925 %defattr(-,root,root,-)
926 %{_libdir}/libdali-adap*.so*.ivi
927
928 %if 0%{?dali_feedback_plugin_ivi}
929 %files dali-feedback-plugin-profile_ivi
930 %manifest dali-adaptor.manifest
931 %defattr(-,root,root,-)
932 %{_libdir}/libdali-feedback-plugin.so*.ivi
933 %{dali_plugin_sound_files}/*
934 %endif
935 %endif
936
937 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
938 # if common ||"undefined"
939 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
940 %files profile_common
941 %manifest dali-adaptor.manifest
942 %defattr(-,root,root,-)
943 %{_libdir}/libdali-adap*.so*.common
944
945 %if 0%{?dali_feedback_plugin_common}
946 %files dali-feedback-plugin-profile_common
947 %manifest dali-adaptor.manifest
948 %defattr(-,root,root,-)
949 %{_libdir}/libdali-feedback-plugin.so*.common
950 %{dali_plugin_sound_files}/*
951 %endif
952
953 %if %{with wayland}
954 %files dali-video-player-plugin
955 %manifest dali-adaptor.manifest
956 %defattr(-,root,root,-)
957 %{_libdir}/libdali-video-player-plugin.so*
958 %endif
959 %endif
960
961 %files devel
962 %defattr(-,root,root,-)
963 %{dev_include_path}/dali/dali.h
964 %{dev_include_path}/dali/public-api/*
965 %{dev_include_path}/dali/devel-api/*
966 %{dev_include_path}/dali/doc/*
967 %{_libdir}/pkgconfig/dali-adaptor.pc
968 %{_libdir}/pkgconfig/dali-adaptor-uv.pc
969
970 %files integration-devel
971 %defattr(-,root,root,-)
972 %{dev_include_path}/dali/integration-api/adaptors/*
973 %{_libdir}/pkgconfig/dali-adaptor-integration.pc