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
16 Summary: The DALi Tizen Adaptor
19 Group: System/Libraries
20 License: Apache-2.0 and BSD-2-Clause and MIT
21 URL: https://review.tizen.org/git/?p=platform/core/uifw/dali-adaptor.git;a=summary
22 Source0: %{name}-%{version}.tar.gz
24 Requires(post): /sbin/ldconfig
25 Requires(postun): /sbin/ldconfig
28 #need libtzplatform-config for directory if tizen version is 3.x
30 %if 0%{?tizen_version_major} >= 3
31 %define tizen_platform_config_supported 1
32 BuildRequires: pkgconfig(libtzplatform-config)
36 # Get the profile from tizen_profile_name if tizen version is 2.x and tizen_profile_name exists.
38 %if "%{tizen_version_major}" == "2" && 0%{?tizen_profile_name:1}
39 %define profile %{tizen_profile_name}
42 %if "%{profile}" == "mobile"
43 %define dali_profile MOBILE
44 %define dali_feedback_plugin 0
45 %define dali_videoplayer_plugin 1
46 %define shaderbincache_flag DISABLE
47 BuildRequires: pkgconfig(gles20)
48 %define gles_requirement_setup 1
51 %if "%{profile}" == "tv"
52 %define dali_profile TV
53 %define dali_feedback_plugin 0
54 %define dali_videoplayer_plugin 1
55 %define shaderbincache_flag DISABLE
56 BuildRequires: pkgconfig(glesv2)
57 %define gles_requirement_setup 1
60 %if "%{profile}" == "wearable"
61 %define dali_profile WEARABLE
62 %define dali_feedback_plugin 0
63 %define dali_videoplayer_plugin 1
64 %define shaderbincache_flag DISABLE
65 BuildRequires: pkgconfig(gles20)
66 BuildRequires: pkgconfig(capi-appfw-watch-application)
67 BuildRequires: pkgconfig(appcore-watch)
68 %define gles_requirement_setup 1
71 %if "%{profile}" == "ivi"
72 %define dali_profile IVI
73 %define dali_feedback_plugin 0
74 %define dali_videoplayer_plugin 1
75 %define shaderbincache_flag DISABLE
76 BuildRequires: pkgconfig(glesv2)
77 %define gles_requirement_setup 1
80 %if "%{profile}" == "common"
81 %define dali_profile COMMON
82 %define dali_feedback_plugin 0
83 %define dali_videoplayer_plugin 1
84 %define tizen_2_2_compatibility 0
85 %define shaderbincache_flag DISABLE
86 BuildRequires: pkgconfig(glesv2)
87 %define gles_requirement_setup 1
90 # If we have not set a BuildRequires for the gles version, default it here.
91 %{!?gles_requirement_setup: BuildRequires: pkgconfig(glesv2)}
93 BuildRequires: pkgconfig
95 BuildRequires: pkgconfig(aul)
96 BuildRequires: giflib-devel
97 BuildRequires: pkgconfig(fontconfig)
98 BuildRequires: libjpeg-turbo-devel
99 BuildRequires: dali-devel
100 BuildRequires: dali-integration-devel
101 BuildRequires: pkgconfig(vconf)
102 BuildRequires: tts-devel
103 BuildRequires: pkgconfig(dlog)
104 BuildRequires: libdrm-devel
105 BuildRequires: pkgconfig(libexif)
106 BuildRequires: pkgconfig(libpng)
107 BuildRequires: pkgconfig(egl)
108 BuildRequires: libcurl-devel
109 BuildRequires: pkgconfig(harfbuzz)
110 BuildRequires: fribidi-devel
112 %if 0%{?tizen_2_2_compatibility} != 1
113 BuildRequires: pkgconfig(capi-system-info)
114 BuildRequires: pkgconfig(capi-system-sensor)
117 # Tizen currently does not have libuv as a separate libuv package
118 # So we have to look into the uv headers bundled inside node-js
119 BuildRequires: nodejs-devel
124 ####### BUILDING FOR WAYLAND #######
125 BuildRequires: pkgconfig(wayland-egl)
126 BuildRequires: pkgconfig(wayland-client)
127 BuildRequires: wayland-devel
128 # Currently Tizen Common we use does not have wayland extensions like xdg-shell
129 %if "%{profile}" != "common"
130 BuildRequires: wayland-extension-client-devel
133 # dali-adaptor-uv uses libuv mainloop and has its own wayland client (it needs wayland-client headers).
134 BuildRequires: libxkbcommon-devel
136 # dali-adaptor uses ecore mainloop
137 BuildRequires: pkgconfig(ecore-wayland)
139 # dali-adaptor needs tbm_surface in tizen 3.0 wayland
140 BuildRequires: pkgconfig(libtbm)
142 # tpkp-curl (certificate pinning for libcurl functions) is only available in Tizen 3.0
143 BuildRequires: pkgconfig(tpkp-curl)
145 ####### BUILDING FOR X11#######
147 BuildRequires: pkgconfig(egl)
148 BuildRequires: pkgconfig(xext)
149 BuildRequires: pkgconfig(xi)
150 BuildRequires: pkgconfig(xfixes)
151 BuildRequires: pkgconfig(xdamage)
152 BuildRequires: pkgconfig(utilX)
156 BuildRequires: pkgconfig(evas)
157 BuildRequires: pkgconfig(elementary)
158 BuildRequires: pkgconfig(capi-appfw-application)
159 BuildRequires: pkgconfig(capi-system-system-settings)
161 %if 0%{?over_tizen_2_2}
162 BuildRequires: pkgconfig(capi-system-info)
168 The DALi Tizen Adaptor provides a Tizen specific implementation of the dali-core
169 platform abstraction and application shell
171 ##############################
173 ##############################
175 Summary: Development components for the DALi Tizen Adaptor
176 Group: Development/Building
177 Requires: %{name} = %{version}-%{release}
178 Requires: %{name}-integration-devel = %{version}-%{release}
181 Development components for the DALi Tizen Adaptor - public headers and package configs
183 ##############################
185 ##############################
186 %package integration-devel
187 Summary: Integration development package for the Adaptor
188 Group: Development/Building
189 Requires: %{name} = %{version}-%{release}
191 %description integration-devel
192 Integration development package for the Adaptor - headers for integrating with an adaptor library.
194 ##############################
195 # Dali Feedback Plugin
196 ##############################
197 %package dali-feedback-plugin
198 Summary: Plugin to play haptic and audio feedback for Dali
199 Group: System/Libraries
200 %if 0%{?dali_feedback_plugin}
201 #Requires: libdeviced
202 BuildRequires: pkgconfig(mm-sound)
203 #BuildRequires: pkgconfig(haptic)
204 BuildRequires: libfeedback-devel
207 %description dali-feedback-plugin
208 Feedback plugin to play haptic and audio feedback for Dali
210 ##############################
211 # Dali VideoPlayer Plugin
212 ##############################
215 %package dali-video-player-plugin
216 Summary: Plugin to play a video file for Dali
217 Group: System/Libraries
218 %if 0%{?dali_videoplayer_plugin}
219 BuildRequires: pkgconfig(capi-media-player)
222 %description dali-video-player-plugin
223 VideoPlayer plugin to play a video file for Dali
226 ##############################
228 ##############################
232 #Use TZ_PATH when tizen version is 3.x or greater
234 %if 0%{?tizen_version_major} >= 3
235 %define dali_data_rw_dir %TZ_SYS_RO_SHARE/dali/
236 %define dali_data_ro_dir %TZ_SYS_RO_SHARE/dali/
237 %define font_preloaded_path %TZ_SYS_RO_SHARE/fonts/
238 %define font_downloaded_path %TZ_SYS_SHARE/fonts/
239 %define font_application_path %TZ_SYS_RO_SHARE/app_fonts/
240 %define font_configuration_file %TZ_SYS_ETC/fonts/conf.avail/99-slp.conf
242 %define dali_data_rw_dir /usr/share/dali/
243 %define dali_data_ro_dir /usr/share/dali/
244 %define font_preloaded_path /usr/share/fonts/
245 %define font_downloaded_path /opt/share/fonts/
246 %define font_application_path /usr/share/app_fonts/
247 %define font_configuration_file /opt/etc/fonts/conf.avail/99-slp.conf
250 %define user_shader_cache_dir %{dali_data_ro_dir}/core/shaderbin/
251 %define dali_plugin_sound_files %{dali_data_ro_dir}/plugins/sounds/
252 %define dev_include_path %{_includedir}
254 ##############################
256 ##############################
259 CXXFLAGS+=" -Wall -g -Os -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections -DGL_GLEXT_PROTOTYPES"
260 LDFLAGS+=" -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--gc-sections -Wl,-Bsymbolic-functions "
263 CXXFLAGS+=" -D_ARCH_ARM_ -lgcc"
268 CXXFLAGS+=" -DWAYLAND"
269 configure_flags="--enable-wayland"
272 %if 0%{?tizen_2_2_compatibility}
273 CFLAGS+=" -DTIZEN_SDK_2_2_COMPATIBILITY"
274 CXXFLAGS+=" -DTIZEN_SDK_2_2_COMPATIBILITY"
278 cd %{_builddir}/%{name}-%{version}/build/tizen
281 DALI_DATA_RW_DIR="%{dali_data_rw_dir}" ; export DALI_DATA_RW_DIR
282 DALI_DATA_RO_DIR="%{dali_data_ro_dir}" ; export DALI_DATA_RO_DIR
283 FONT_PRELOADED_PATH="%{font_preloaded_path}" ; export FONT_PRELOADED_PATH
284 FONT_DOWNLOADED_PATH="%{font_downloaded_path}" ; export FONT_DOWNLOADED_PATH
285 FONT_APPLICATION_PATH="%{font_application_path}" ; export FONT_APPLICATION_PATH
286 FONT_CONFIGURATION_FILE="%{font_configuration_file}" ; export FONT_CONFIGURATION_FILE
287 %if 0%{?tizen_platform_config_supported}
288 TIZEN_PLATFORM_CONFIG_SUPPORTED="%{tizen_platform_config_supported}" ; export TIZEN_PLATFORM_CONFIG_SUPPORTED
291 # Default to GLES 2.0 if not specified.
292 %{!?target_gles_version: %define target_gles_version 20}
294 #--enable-efl=no \ # only affects dali-adaptor-uv
295 #--enable-appfw=yes \ # affects both dali-adaptor & dali-adaptor-uv
296 #--with-libuv=/usr/include/node/ \ # only affects dali-adaptor-uv
298 # Set up the build via configure.
299 %configure --prefix=$PREFIX --with-jpeg-turbo --enable-gles=%{target_gles_version} --enable-shaderbincache=%{shaderbincache_flag} --enable-profile=%{dali_profile} \
300 %if 0%{?dali_feedback_plugin}
303 %if 0%{?dali_videoplayer_plugin}
304 --enable-videoplayer \
306 %if 0%{?tizen_2_2_compatibility}
307 --with-tizen-2-2-compatibility \
314 %if 0%{?enable_debug}
318 --with-libuv=/usr/include/node/ \
319 $configure_flags --libdir=%{_libdir}
322 make %{?jobs:-j%jobs}
324 ##############################
326 ##############################
330 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
333 ##############################
335 # 1 - Pre Install new package
336 # 2 - Install new package
337 # 3 - Post install new package
338 # 4 - Pre uninstall old package
339 # 5 - Remove files not overwritten by new package
340 # 6 - Post uninstall old package
341 ##############################
346 ##############################
347 # Post Install new package
348 ##############################
353 %if 0%{?dali_feedback_plugin}
354 %post dali-feedback-plugin
360 %if 0%{?dali_videoplayer_plugin}
361 %post dali-video-player-plugin
367 ##############################
368 # Pre Uninstall old package
369 ##############################
373 ##############################
374 # Post Uninstall old package
375 ##############################
380 %if 0%{?dali_feedback_plugin}
381 %postun dali-feedback-plugin
387 %if 0%{?dali_videoplayer_plugin}
388 %postun dali-video-player-plugin
394 ##############################
395 # Files in Binary Packages
396 ##############################
399 %manifest dali-adaptor.manifest
400 %defattr(-,root,root,-)
401 %{_libdir}/libdali-adap*.so*
402 %defattr(-,app,app,-)
403 %dir %{user_shader_cache_dir}
408 %defattr(-,root,root,-)
409 %{dev_include_path}/dali/dali.h
410 %{dev_include_path}/dali/public-api/*
411 %{dev_include_path}/dali/devel-api/*
412 %{dev_include_path}/dali/doc/*
413 %{_libdir}/pkgconfig/dali-adaptor.pc
414 %{_libdir}/pkgconfig/dali-adaptor-uv.pc
416 %files integration-devel
417 %defattr(-,root,root,-)
418 %{dev_include_path}/dali/integration-api/adaptors/*
419 %{_libdir}/pkgconfig/dali-adaptor-integration.pc
421 %if 0%{?dali_feedback_plugin}
422 %files dali-feedback-plugin
423 %defattr(-,root,root,-)
424 %{_libdir}/libdali-feedback-plugin.so*
425 %{dali_plugin_sound_files}/*
429 %if 0%{?dali_videoplayer_plugin}
430 %files dali-video-player-plugin
431 %manifest dali-adaptor.manifest
432 %defattr(-,root,root,-)
433 %{_libdir}/libdali-video-player-plugin.so*