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 # Get the profile from tizen_profile_name if tizen version is 2.x and tizen_profile_name exists.
30 %if "%{tizen_version_major}" == "2" && 0%{?tizen_profile_name:1}
31 %define profile %{tizen_profile_name}
34 %if "%{profile}" == "mobile"
35 %define dali_profile MOBILE
36 %define dali_feedback_plugin 0
37 %define dali_videoplayer_plugin 1
38 %define shaderbincache_flag DISABLE
39 BuildRequires: pkgconfig(gles20)
40 %define gles_requirement_setup 1
43 %if "%{profile}" == "tv"
44 %define dali_profile TV
45 %define dali_feedback_plugin 0
46 %define dali_videoplayer_plugin 1
47 %define shaderbincache_flag ENABLE
48 BuildRequires: pkgconfig(glesv2)
49 %define gles_requirement_setup 1
52 %if "%{profile}" == "wearable"
53 %define dali_profile WEARABLE
54 %define dali_feedback_plugin 0
55 %define dali_videoplayer_plugin 1
56 %define shaderbincache_flag DISABLE
57 BuildRequires: pkgconfig(gles20)
58 BuildRequires: pkgconfig(capi-appfw-watch-application)
59 BuildRequires: pkgconfig(appcore-watch)
60 %define gles_requirement_setup 1
63 %if "%{profile}" == "ivi"
64 %define dali_profile IVI
65 %define dali_feedback_plugin 0
66 %define shaderbincache_flag DISABLE
67 BuildRequires: pkgconfig(glesv2)
68 %define gles_requirement_setup 1
71 %if "%{profile}" == "common"
72 %define dali_profile COMMON
73 %define dali_feedback_plugin 0
74 %define dali_videoplayer_plugin 1
75 %define tizen_2_2_compatibility 0
76 %define shaderbincache_flag DISABLE
77 BuildRequires: pkgconfig(glesv2)
78 %define gles_requirement_setup 1
81 # If we have not set a BuildRequires for the gles version, default it here.
82 %{!?gles_requirement_setup: BuildRequires: pkgconfig(glesv2)}
84 BuildRequires: pkgconfig
86 BuildRequires: pkgconfig(aul)
87 BuildRequires: giflib-devel
88 BuildRequires: pkgconfig(fontconfig)
89 BuildRequires: libjpeg-turbo-devel
90 BuildRequires: dali-devel
91 BuildRequires: dali-integration-devel
92 BuildRequires: pkgconfig(vconf)
93 BuildRequires: tts-devel
94 BuildRequires: pkgconfig(dlog)
95 BuildRequires: libdrm-devel
96 BuildRequires: pkgconfig(libexif)
97 BuildRequires: pkgconfig(libpng)
98 BuildRequires: pkgconfig(egl)
99 BuildRequires: libcurl-devel
100 BuildRequires: pkgconfig(harfbuzz)
101 BuildRequires: fribidi-devel
103 %if 0%{?tizen_2_2_compatibility} != 1
104 BuildRequires: pkgconfig(capi-system-info)
105 BuildRequires: pkgconfig(capi-system-sensor)
108 # Tizen currently does not have libuv as a separate libuv package
109 # So we have to look into the uv headers bundled inside node-js
110 BuildRequires: nodejs-devel
115 ####### BUILDING FOR WAYLAND #######
116 BuildRequires: pkgconfig(wayland-egl)
117 BuildRequires: pkgconfig(wayland-client)
118 BuildRequires: wayland-devel
119 # Currently Tizen Common we use does not have wayland extensions like xdg-shell
120 %if "%{profile}" != "common"
121 BuildRequires: wayland-extension-client-devel
124 # dali-adaptor-uv uses libuv mainloop and has its own wayland client (it needs wayland-client headers).
125 BuildRequires: libxkbcommon-devel
127 # dali-adaptor uses ecore mainloop
128 BuildRequires: pkgconfig(ecore-wayland)
130 # dali-adaptor needs tbm_surface in tizen 3.0 wayland
131 BuildRequires: pkgconfig(libtbm)
133 # tpkp-curl (certificate pinning for libcurl functions) is only available in Tizen 3.0
134 BuildRequires: pkgconfig(tpkp-curl)
136 ####### BUILDING FOR X11#######
138 BuildRequires: pkgconfig(egl)
139 BuildRequires: pkgconfig(xext)
140 BuildRequires: pkgconfig(xi)
141 BuildRequires: pkgconfig(xfixes)
142 BuildRequires: pkgconfig(xdamage)
143 BuildRequires: pkgconfig(utilX)
147 BuildRequires: pkgconfig(evas)
148 BuildRequires: pkgconfig(elementary)
149 BuildRequires: pkgconfig(capi-appfw-application)
150 BuildRequires: pkgconfig(capi-system-system-settings)
152 %if 0%{?over_tizen_2_2}
153 BuildRequires: pkgconfig(capi-system-info)
159 The DALi Tizen Adaptor provides a Tizen specific implementation of the dali-core
160 platform abstraction and application shell
162 ##############################
164 ##############################
166 Summary: Development components for the DALi Tizen Adaptor
167 Group: Development/Building
168 Requires: %{name} = %{version}-%{release}
169 Requires: %{name}-integration-devel = %{version}-%{release}
172 Development components for the DALi Tizen Adaptor - public headers and package configs
174 ##############################
176 ##############################
177 %package integration-devel
178 Summary: Integration development package for the Adaptor
179 Group: Development/Building
180 Requires: %{name} = %{version}-%{release}
182 %description integration-devel
183 Integration development package for the Adaptor - headers for integrating with an adaptor library.
185 ##############################
186 # Dali Feedback Plugin
187 ##############################
188 %package dali-feedback-plugin
189 Summary: Plugin to play haptic and audio feedback for Dali
190 Group: System/Libraries
191 %if 0%{?dali_feedback_plugin}
192 #Requires: libdeviced
193 BuildRequires: pkgconfig(mm-sound)
194 #BuildRequires: pkgconfig(haptic)
195 BuildRequires: libfeedback-devel
198 %description dali-feedback-plugin
199 Feedback plugin to play haptic and audio feedback for Dali
201 ##############################
202 # Dali VideoPlayer Plugin
203 ##############################
206 %package dali-video-player-plugin
207 Summary: Plugin to play a video file for Dali
208 Group: System/Libraries
209 %if 0%{?dali_videoplayer_plugin}
210 BuildRequires: pkgconfig(capi-media-player)
213 %description dali-video-player-plugin
214 VideoPlayer plugin to play a video file for Dali
217 ##############################
219 ##############################
222 %define dali_data_rw_dir /usr/share/dali/
223 %define dali_data_ro_dir /usr/share/dali/
224 %define user_shader_cache_dir %{dali_data_ro_dir}/core/shaderbin/
225 %define font_preloaded_path /usr/share/fonts/
226 %define font_downloaded_path /opt/share/fonts/
227 %define font_application_path /usr/share/app_fonts/
228 %define font_configuration_file /opt/etc/fonts/conf.avail/99-slp.conf
229 %define dali_plugin_sound_files %{dali_data_ro_dir}/plugins/sounds/
231 %define dev_include_path %{_includedir}
233 ##############################
235 ##############################
238 CXXFLAGS+=" -Wall -g -Os -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections -DGL_GLEXT_PROTOTYPES"
239 LDFLAGS+=" -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--gc-sections -Wl,-Bsymbolic-functions "
242 CXXFLAGS+=" -D_ARCH_ARM_ -lgcc"
247 CXXFLAGS+=" -DWAYLAND"
248 configure_flags="--enable-wayland"
251 %if 0%{?tizen_2_2_compatibility}
252 CFLAGS+=" -DTIZEN_SDK_2_2_COMPATIBILITY"
253 CXXFLAGS+=" -DTIZEN_SDK_2_2_COMPATIBILITY"
257 cd %{_builddir}/%{name}-%{version}/build/tizen
260 DALI_DATA_RW_DIR="%{dali_data_rw_dir}" ; export DALI_DATA_RW_DIR
261 DALI_DATA_RO_DIR="%{dali_data_ro_dir}" ; export DALI_DATA_RO_DIR
262 FONT_PRELOADED_PATH="%{font_preloaded_path}" ; export FONT_PRELOADED_PATH
263 FONT_DOWNLOADED_PATH="%{font_downloaded_path}" ; export FONT_DOWNLOADED_PATH
264 FONT_APPLICATION_PATH="%{font_application_path}" ; export FONT_APPLICATION_PATH
265 FONT_CONFIGURATION_FILE="%{font_configuration_file}" ; export FONT_CONFIGURATION_FILE
267 # Default to GLES 2.0 if not specified.
268 %{!?target_gles_version: %define target_gles_version 20}
270 #--enable-efl=no \ # only affects dali-adaptor-uv
271 #--enable-appfw=yes \ # affects both dali-adaptor & dali-adaptor-uv
272 #--with-libuv=/usr/include/node/ \ # only affects dali-adaptor-uv
274 # Set up the build via configure.
275 %configure --prefix=$PREFIX --with-jpeg-turbo --enable-gles=%{target_gles_version} --enable-shaderbincache=%{shaderbincache_flag} --enable-profile=%{dali_profile} \
276 %if 0%{?dali_feedback_plugin}
279 %if 0%{?dali_videoplayer_plugin}
280 --enable-videoplayer \
282 %if 0%{?tizen_2_2_compatibility}
283 --with-tizen-2-2-compatibility \
290 %if 0%{?enable_debug}
294 --with-libuv=/usr/include/node/ \
295 $configure_flags --libdir=%{_libdir}
298 make %{?jobs:-j%jobs}
300 ##############################
302 ##############################
306 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
309 mkdir -p %{buildroot}/usr/share/license
310 cp -af %{_builddir}/%{name}-%{version}/LICENSE %{buildroot}/usr/share/license/%{name}
312 ##############################
314 # 1 - Pre Install new package
315 # 2 - Install new package
316 # 3 - Post install new package
317 # 4 - Pre uninstall old package
318 # 5 - Remove files not overwritten by new package
319 # 6 - Post uninstall old package
320 ##############################
325 ##############################
326 # Post Install new package
327 ##############################
332 %if 0%{?dali_feedback_plugin}
333 %post dali-feedback-plugin
339 %if 0%{?dali_videoplayer_plugin}
340 %post dali-video-player-plugin
346 ##############################
347 # Pre Uninstall old package
348 ##############################
352 ##############################
353 # Post Uninstall old package
354 ##############################
359 %if 0%{?dali_feedback_plugin}
360 %postun dali-feedback-plugin
366 %if 0%{?dali_videoplayer_plugin}
367 %postun dali-video-player-plugin
373 ##############################
374 # Files in Binary Packages
375 ##############################
378 %manifest dali-adaptor.manifest
379 %defattr(-,root,root,-)
380 %{_libdir}/libdali-adap*.so*
381 %defattr(-,app,app,-)
382 %dir %{user_shader_cache_dir}
384 %{_datadir}/license/%{name}
387 %defattr(-,root,root,-)
388 %{dev_include_path}/dali/dali.h
389 %{dev_include_path}/dali/public-api/*
390 %{dev_include_path}/dali/devel-api/*
391 %{dev_include_path}/dali/doc/*
392 %{_libdir}/pkgconfig/dali-adaptor.pc
393 %{_libdir}/pkgconfig/dali-adaptor-uv.pc
395 %files integration-devel
396 %defattr(-,root,root,-)
397 %{dev_include_path}/dali/integration-api/adaptors/*
398 %{_libdir}/pkgconfig/dali-adaptor-integration.pc
400 %if 0%{?dali_feedback_plugin}
401 %files dali-feedback-plugin
402 %defattr(-,root,root,-)
403 %{_libdir}/libdali-feedback-plugin.so*
404 %{dali_plugin_sound_files}/*
408 %if 0%{?dali_videoplayer_plugin}
409 %files dali-video-player-plugin
410 %manifest dali-adaptor.manifest
411 %defattr(-,root,root,-)
412 %{_libdir}/libdali-video-player-plugin.so*