2 # This spec file is used to build DALi Adaptor for different Tizen Profiles
3 # Current profiles are: Mobile, TV, Wearable, Common
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
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
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)$
19 Summary: The DALi Tizen Adaptor
22 Group: System/Libraries
23 License: Apache-2.0 and BSD-3-Clause and MIT
24 URL: https://review.tizen.org/git/?p=platform/core/uifw/dali-adaptor.git;a=summary
25 Source0: %{name}-%{version}.tar.gz
27 Requires(post): /sbin/ldconfig
28 Requires(postun): /sbin/ldconfig
31 %define tizen_platform_config_supported 1
32 BuildRequires: pkgconfig(libtzplatform-config)
34 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
35 # if wearable || "undefined"
36 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
37 BuildRequires: pkgconfig(capi-appfw-watch-application)
38 BuildRequires: pkgconfig(appcore-watch)
41 BuildRequires: pkgconfig(screen_connector_provider)
42 BuildRequires: pkgconfig(gles20)
43 BuildRequires: pkgconfig(glesv2)
44 BuildRequires: pkgconfig(ttrace)
46 BuildRequires: dali2-devel
47 BuildRequires: dali2-integration-devel
49 BuildRequires: pkgconfig
52 BuildRequires: giflib-devel
53 BuildRequires: pkgconfig(fontconfig)
54 BuildRequires: libjpeg-turbo-devel
55 BuildRequires: pkgconfig(vconf)
56 BuildRequires: tts-devel
57 BuildRequires: pkgconfig(dlog)
58 BuildRequires: libdrm-devel
59 BuildRequires: pkgconfig(libexif)
60 BuildRequires: pkgconfig(libpng)
61 BuildRequires: pkgconfig(egl)
62 BuildRequires: libcurl-devel
63 BuildRequires: pkgconfig(harfbuzz)
64 BuildRequires: hyphen-devel
65 BuildRequires: fribidi-devel
67 BuildRequires: pkgconfig(capi-system-info)
68 BuildRequires: pkgconfig(capi-system-sensor)
70 BuildRequires: pkgconfig(cairo)
72 BuildRequires: pkgconfig(wayland-egl)
73 BuildRequires: pkgconfig(wayland-client)
74 BuildRequires: pkgconfig(input-method-client)
75 BuildRequires: wayland-devel
76 BuildRequires: wayland-extension-client-devel
78 # WebP support only from Tizen 6 onwards
79 %if 0%{?tizen_version_major} >= 6
80 BuildRequires: pkgconfig(libwebp)
81 BuildRequires: pkgconfig(libwebpdecoder)
82 BuildRequires: pkgconfig(libwebpdemux)
83 BuildRequires: pkgconfig(libwebpmux)
86 # We use ecore mainloop
87 %if 0%{?tizen_version_major} >= 5
88 BuildRequires: pkgconfig(ecore-wl2)
89 BuildRequires: pkgconfig(wayland-egl-tizen)
91 BuildRequires: pkgconfig(ecore-wayland)
94 # We need tbm_surface in tizen 3.0 wayland
95 BuildRequires: pkgconfig(libtbm)
98 BuildRequires: pkgconfig(app-core-ui-cpp)
99 BuildRequires: pkgconfig(appcore-widget-base)
100 BuildRequires: pkgconfig(bundle)
101 BuildRequires: pkgconfig(capi-appfw-app-common)
102 BuildRequires: pkgconfig(capi-appfw-app-control)
103 BuildRequires: pkgconfig(ecore-imf)
105 BuildRequires: pkgconfig(capi-system-system-settings)
107 # for ATSPI (Accessibility) support
108 BuildRequires: pkgconfig(eldbus)
110 # for feedback plugin
111 BuildRequires: pkgconfig(mm-sound)
112 BuildRequires: pkgconfig(feedback)
113 BuildRequires: pkgconfig(component-based-core-base)
116 %if ( 0%{?tizen_version_major} == 6 && 0%{?tizen_version_minor} >= 5 ) || 0%{?tizen_version_major} >= 7
117 BuildRequires: pkgconfig(thorvg)
121 %if "%{vd_asan}" == "1" || "%{asan}" == "1"
122 BuildRequires: asan-force-options
123 BuildRequires: asan-build-env
124 BuildRequires: libasan
128 Requires: %{name}-compat = %{version}-%{release}
129 Recommends: %{name}-profile_common = %{version}-%{release}
132 The DALi Tizen Adaptor provides a Tizen specific implementation of the dali-core
133 platform abstraction and application shell
135 ###########################################
136 # Dali adapter for profiles
137 ###########################################
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 Summary: The DALi Tizen Adaptor for mobile
144 Provides: %{name}-compat = %{version}-%{release}
145 Conflicts: %{name}-profile_tv
146 Conflicts: %{name}-profile_wearable
147 Conflicts: %{name}-profile_ivi
148 Conflicts: %{name}-profile_common
150 %description profile_mobile
151 The DALi Tizen Adaptor for mobile.
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"
158 Summary: The DALi Tizen Adaptor for tv
159 Provides: %{name}-compat = %{version}-%{release}
160 Conflicts: %{name}-profile_mobile
161 Conflicts: %{name}-profile_wearable
162 Conflicts: %{name}-profile_ivi
163 Conflicts: %{name}-profile_common
165 %description profile_tv
166 The DALi Tizen Adaptor for tv.
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 Summary: The DALi Tizen Adaptor for wearable
174 Provides: %{name}-compat = %{version}-%{release}
175 Conflicts: %{name}-profile_mobile
176 Conflicts: %{name}-profile_tv
177 Conflicts: %{name}-profile_ivi
178 Conflicts: %{name}-profile_common
180 %description profile_wearable
181 The DALi Tizen Adaptor for wearable.
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"
188 Summary: The DALi Tizen Adaptor for ivi
189 Provides: %{name}-compat = %{version}-%{release}
190 Conflicts: %{name}-profile_mobile
191 Conflicts: %{name}-profile_wearable
192 Conflicts: %{name}-profile_tv
193 Conflicts: %{name}-profile_common
195 %description profile_ivi
196 The DALi Tizen Adaptor for ivi.
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 Summary: The DALi Tizen Adaptor for common
205 Provides: %{name}-compat = %{version}-%{release}
206 Conflicts: %{name}-profile_mobile
207 Conflicts: %{name}-profile_wearable
208 Conflicts: %{name}-profile_tv
209 Conflicts: %{name}-profile_ivi
211 %description profile_common
212 The DALi Tizen Adaptor for common.
215 ##############################
217 ##############################
219 Summary: Development components for the DALi Tizen Adaptor
220 Group: Development/Building
221 Requires: %{name} = %{version}-%{release}
222 Requires: %{name}-integration-devel = %{version}-%{release}
225 Development components for the DALi Tizen Adaptor - public headers and package configs
227 ##############################
229 ##############################
230 %package integration-devel
231 Summary: Integration development package for the Adaptor
232 Group: Development/Building
233 Requires: %{name} = %{version}-%{release}
235 %description integration-devel
236 Integration development package for the Adaptor - headers for integrating with an adaptor library.
238 ##############################
239 # Dali Feedback Plugin
240 ##############################
241 %package dali2-feedback-plugin
242 Summary: Plugin to play haptic and audio feedback for Dali
243 Group: System/Libraries
244 Requires: %{name} = %{version}-%{release}
245 %description dali2-feedback-plugin
246 Feedback plugin to play haptic and audio feedback for Dali
248 #Use TZ_PATH when tizen version is 3.x or greater
249 %define dali_data_rw_dir %TZ_SYS_RO_SHARE/dali/
250 %define dali_data_ro_dir %TZ_SYS_RO_SHARE/dali/
251 %define font_preloaded_path %TZ_SYS_RO_SHARE/fonts/
252 %define font_downloaded_path %TZ_SYS_SHARE/fonts/
253 %define font_application_path %TZ_SYS_RO_SHARE/app_fonts/
254 %define font_configuration_file %TZ_SYS_ETC/fonts/conf.avail/99-slp.conf
256 %define user_shader_cache_dir %{dali_data_ro_dir}/core/shaderbin/
257 %define dali_plugin_sound_files /plugins/sounds/
259 ##############################
261 ##############################
266 ##############################
268 ##############################
271 CXXFLAGS+=" -Wall -g -Os -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections -DGL_GLEXT_PROTOTYPES"
272 LDFLAGS+=" -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--gc-sections -lttrace -Wl,-Bsymbolic-functions "
275 CXXFLAGS+=" -D_ARCH_ARM_ -lgcc"
279 CXXFLAGS+=" -DWAYLAND"
280 cmake_flags=" -DENABLE_WAYLAND=ON -DENABLE_ATSPI=ON -DENABLE_TRACE=ON"
282 # Use this conditional when Tizen version is 5.x or greater
283 %if 0%{?tizen_version_major} >= 5
284 CXXFLAGS+=" -DOVER_TIZEN_VERSION_5"
286 # Need Ecore-Wayland2 when Tizen version is 5.x or greater
287 CFLAGS+=" -DECORE_WAYLAND2 -DEFL_BETA_API_SUPPORT"
288 CXXFLAGS+=" -DECORE_WAYLAND2 -DEFL_BETA_API_SUPPORT"
289 cmake_flags+=" -DENABLE_ECORE_WAYLAND2=ON"
292 # Use this conditional when Tizen version is 7.x or greater
293 %if 0%{?tizen_version_major} >= 7
294 CXXFLAGS+=" -DOVER_TIZEN_VERSION_7"
297 # Use this conditional when Tizen version is 8.x or greater
298 %if 0%{?tizen_version_major} >= 8
299 CXXFLAGS+=" -DOVER_TIZEN_VERSION_8"
302 %if "%{vd_asan}" == "1" || "%{asan}" == "1"
303 CFLAGS+=" -fsanitize=address"
304 CXXFLAGS+=" -fsanitize=address"
305 LDFLAGS+=" -fsanitize=address"
308 %if 0%{?enable_debug}
309 cmake_flags+=" -DCMAKE_BUILD_TYPE=Debug"
312 %if 0%{?enable_logging}
313 cmake_flags+=" -DENABLE_NETWORK_LOGGING=ON"
317 cd %{_builddir}/%{name}-%{version}/build/tizen
319 DALI_DATA_RW_DIR="%{dali_data_rw_dir}" ; export DALI_DATA_RW_DIR
320 DALI_DATA_RO_DIR="%{dali_data_ro_dir}" ; export DALI_DATA_RO_DIR
321 FONT_PRELOADED_PATH="%{font_preloaded_path}" ; export FONT_PRELOADED_PATH
322 FONT_DOWNLOADED_PATH="%{font_downloaded_path}" ; export FONT_DOWNLOADED_PATH
323 FONT_APPLICATION_PATH="%{font_application_path}" ; export FONT_APPLICATION_PATH
324 FONT_CONFIGURATION_FILE="%{font_configuration_file}" ; export FONT_CONFIGURATION_FILE
325 %if 0%{?tizen_platform_config_supported}
326 TIZEN_PLATFORM_CONFIG_SUPPORTED="%{tizen_platform_config_supported}" ; export TIZEN_PLATFORM_CONFIG_SUPPORTED
329 cmake_flags+=" -DCMAKE_INSTALL_PREFIX=$PREFIX"
330 cmake_flags+=" -DCMAKE_INSTALL_LIBDIR=%{_libdir}"
331 cmake_flags+=" -DCMAKE_INSTALL_INCLUDEDIR=%{_includedir}"
332 cmake_flags+=" -DENABLE_TIZEN_MAJOR_VERSION=%{tizen_version_major}"
333 cmake_flags+=" -DENABLE_FEEDBACK=YES"
334 cmake_flags+=" -DENABLE_APPFW=YES"
335 cmake_flags+=" -DCOMPONENT_APPLICATION_SUPPORT=YES"
337 # Set up the build via Cmake
338 #######################################################################
339 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
340 # if mobile || "undefined"
341 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
346 cmake -DENABLE_PROFILE=MOBILE $cmake_flags ..
349 make %{?jobs:-j%jobs}
354 #######################################################################
355 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
356 # if tv ||"undefined"
357 %if "%{?profile}" != "wearable" && "%{?profile}" != "common" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
362 cmake -DENABLE_PROFILE=TV $cmake_flags ..
365 make %{?jobs:-j%jobs}
370 #######################################################################
371 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
372 # if wearable || "undefined"
373 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
378 cmake -DENABLE_PROFILE=WEARABLE $cmake_flags ..
381 make %{?jobs:-j%jobs}
386 #######################################################################
387 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
388 # if ivi ||"undefined"
389 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "common" && "%{?profile}" != "mobile"
394 cmake -DENABLE_PROFILE=IVI $cmake_flags ..
397 make %{?jobs:-j%jobs}
402 #######################################################################
404 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
405 # if common ||"undefined"
406 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
411 cmake -DENABLE_PROFILE=COMMON $cmake_flags ..
414 make %{?jobs:-j%jobs}
419 ##############################
421 ##############################
425 pushd %{_builddir}/%{name}-%{version}/build/tizen
427 # if mobile || "undefined"
428 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
431 %if "%{?profile}" != "mobile"
432 pushd %{buildroot}%{_libdir}
433 cp libdali2-adaptor.so.*.*.* libdali2-adaptor.so.mobile # If we're only building this profile, then there's no need to copy the lib
435 make clean # So that we can gather symbol/size information for only one profile if we're building all profiles
440 # if tv ||"undefined"
441 %if "%{?profile}" != "wearable" && "%{?profile}" != "common" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
444 %if "%{?profile}" != "tv"
445 pushd %{buildroot}%{_libdir}
446 cp libdali2-adaptor.so.*.*.* libdali2-adaptor.so.tv # If we're only building this profile, then there's no need to copy the lib
448 make clean # So that we can gather symbol/size information for only one profile if we're building all profiles
453 # if wearable || "undefined"
454 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
457 %if "%{?profile}" != "wearable"
458 pushd %{buildroot}%{_libdir}
459 cp libdali2-adaptor.so.*.*.* libdali2-adaptor.so.wearable # If we're only building this profile, then there's no need to copy the lib
461 make clean # So that we can gather symbol/size information for only one profile if we're building all profiles
466 # if ivi ||"undefined"
467 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "common" && "%{?profile}" != "mobile"
470 %if "%{?profile}" != "ivi"
471 pushd %{buildroot}%{_libdir}
472 cp libdali2-adaptor.so.*.*.* libdali2-adaptor.so.ivi # If we're only building this profile, then there's no need to copy the lib
474 make clean # So that we can gather symbol/size information for only one profile if we're building all profiles
479 # if common ||"undefined"
480 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
483 # No clean so we can gather symbol/size information for the common profile
487 # Create a symbolic link in integration-api to preserve legacy repo build
488 pushd %{buildroot}%{_includedir}/dali/integration-api
489 ln -sf adaptor-framework adaptors
492 ##############################
494 # 1 - Pre Install new package
495 # 2 - Install new package
496 # 3 - Post install new package
497 # 4 - Pre uninstall old package
498 # 5 - Remove files not overwritten by new package
499 # 6 - Post uninstall old package
500 ##############################
502 ##############################
503 # Adaptor package Commands
509 for i in mobile tv wearable ivi; do [[ -f libdali2-adaptor.so.$i ]] && ln -sf libdali2-adaptor.so.$i libdali2-adaptor.so.2.0.0; done
521 ##############################
522 # Mobile Profile Commands
523 # if mobile || "undefined"
524 # No need to create a symbolic link on install required if only building this profile
525 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
527 %if "%{?profile}" != "mobile"
529 ln -sf libdali2-adaptor.so.mobile libdali2-adaptor.so.2.0.0
535 %postun profile_mobile
540 ##############################
541 # TV Profile Commands
542 # No need to create a symbolic link on install required if only building this profile
543 %if "%{?profile}" != "wearable" && "%{?profile}" != "common" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
545 %if "%{?profile}" != "tv"
547 ln -sf libdali2-adaptor.so.tv libdali2-adaptor.so.2.0.0
558 ##############################
559 # Wearable Profile Commands
560 # No need to create a symbolic link on install required if only building this profile
561 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
562 %post profile_wearable
563 %if "%{?profile}" != "wearable"
565 ln -sf libdali2-adaptor.so.wearable libdali2-adaptor.so.2.0.0
571 %postun profile_wearable
576 ##############################
577 # IVI Profile Commands
578 # No need to create a symbolic link on install required if only building this profile
579 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "common" && "%{?profile}" != "mobile"
581 %if "%{?profile}" != "ivi"
583 ln -sf libdali2-adaptor.so.ivi libdali2-adaptor.so.2.0.0
594 ##############################
595 # Common Profile Commands
596 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
601 %postun profile_common
606 ##############################
607 # Files in Binary Packages
608 ##############################
611 %manifest dali-adaptor.manifest
612 %defattr(-,root,root,-)
613 %dir %{user_shader_cache_dir}
616 %defattr(-,root,root,-)
617 %{_libdir}/libdali2-adaptor.so
618 %{_libdir}/libdali2-adaptor.so.2
619 %{_libdir}/libdali2-adaptor.so.2.0.0
621 #################################################
623 %files dali2-feedback-plugin
624 %manifest dali-adaptor.manifest
625 %defattr(-,root,root,-)
626 %{_libdir}/libdali2-feedback-plugin.so*
627 %{dali_plugin_sound_files}/*
629 #################################################
631 # if common ||"undefined"
632 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
633 %files profile_common
634 %manifest dali-adaptor.manifest
635 # default .so files are housed in the main pkg.
638 # if mobile || "undefined"
639 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
640 %files profile_mobile
641 %manifest dali-adaptor.manifest
642 %defattr(-,root,root,-)
643 %if "%{?profile}" != "mobile"
644 %{_libdir}/libdali2-adaptor.so.mobile
648 # if tv ||"undefined"
649 %if "%{?profile}" != "wearable" && "%{?profile}" != "common" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
651 %manifest dali-adaptor.manifest
652 %defattr(-,root,root,-)
653 %if "%{?profile}" != "tv"
654 %{_libdir}/libdali2-adaptor.so.tv
658 # if wearable || "undefined"
659 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
660 %files profile_wearable
661 %manifest dali-adaptor.manifest
662 %defattr(-,root,root,-)
663 %if "%{?profile}" != "wearable"
664 %{_libdir}/libdali2-adaptor.so.wearable
668 # if ivi ||"undefined"
669 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "common" && "%{?profile}" != "mobile"
671 %manifest dali-adaptor.manifest
672 %defattr(-,root,root,-)
673 %if "%{?profile}" != "ivi"
674 %{_libdir}/libdali2-adaptor.so.ivi
679 %defattr(-,root,root,-)
680 %{_includedir}/dali/dali.h
681 %{_includedir}/dali/public-api/*
682 %{_includedir}/dali/devel-api/*
683 %{_includedir}/dali/doc/*
684 %{_libdir}/pkgconfig/dali2-adaptor.pc
686 %files integration-devel
687 %defattr(-,root,root,-)
688 %{_includedir}/dali/integration-api/adaptor-framework/*
689 %{_includedir}/dali/integration-api/adaptors
690 %{_libdir}/pkgconfig/dali2-adaptor-integration.pc