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}" == "common"
64 %define dali_profile COMMON
65 %define dali_feedback_plugin 0
66 %define dali_videoplayer_plugin 0
67 %define tizen_2_2_compatibility 1
68 %define shaderbincache_flag DISABLE
69 BuildRequires: pkgconfig(glesv2)
70 %define gles_requirement_setup 1
73 # If we have not set a BuildRequires for the gles version, default it here.
74 %{!?gles_requirement_setup: BuildRequires: pkgconfig(glesv2)}
76 BuildRequires: pkgconfig
78 BuildRequires: pkgconfig(aul)
79 BuildRequires: giflib-devel
80 BuildRequires: pkgconfig(fontconfig)
81 BuildRequires: libjpeg-turbo-devel
82 BuildRequires: dali-devel
83 BuildRequires: dali-integration-devel
84 BuildRequires: pkgconfig(vconf)
85 BuildRequires: tts-devel
86 BuildRequires: pkgconfig(dlog)
87 BuildRequires: libdrm-devel
88 BuildRequires: pkgconfig(libexif)
89 BuildRequires: pkgconfig(libpng)
90 BuildRequires: pkgconfig(egl)
91 BuildRequires: libcurl-devel
92 BuildRequires: pkgconfig(harfbuzz)
93 BuildRequires: fribidi-devel
95 %if 0%{?tizen_2_2_compatibility} != 1
96 BuildRequires: pkgconfig(capi-system-info)
97 BuildRequires: pkgconfig(capi-system-sensor)
100 # Tizen currently does not have libuv as a separate libuv package
101 # So we have to look into the uv headers bundled inside node-js
102 BuildRequires: nodejs-devel
107 ####### BUILDING FOR WAYLAND #######
108 BuildRequires: pkgconfig(wayland-egl)
109 BuildRequires: pkgconfig(wayland-client)
110 BuildRequires: wayland-devel
111 # Currently Tizen Common we use does not have wayland extensions like xdg-shell
112 %if "%{profile}" != "common"
113 BuildRequires: wayland-extension-client-devel
116 # dali-adaptor-uv uses libuv mainloop and has its own wayland client (it needs wayland-client headers).
117 BuildRequires: libxkbcommon-devel
119 # dali-adaptor uses ecore mainloop
120 BuildRequires: pkgconfig(ecore-wayland)
122 # dali-adaptor needs tbm_surface in tizen 3.0 wayland
123 BuildRequires: pkgconfig(libtbm)
125 # tpkp-curl (certificate pinning for libcurl functions) is only available in Tizen 3.0
126 BuildRequires: pkgconfig(tpkp-curl)
128 ####### BUILDING FOR X11#######
130 BuildRequires: pkgconfig(egl)
131 BuildRequires: pkgconfig(xext)
132 BuildRequires: pkgconfig(xi)
133 BuildRequires: pkgconfig(xfixes)
134 BuildRequires: pkgconfig(xdamage)
135 BuildRequires: pkgconfig(utilX)
139 BuildRequires: pkgconfig(evas)
140 BuildRequires: pkgconfig(elementary)
141 BuildRequires: pkgconfig(capi-appfw-application)
142 BuildRequires: pkgconfig(capi-system-system-settings)
144 %if 0%{?over_tizen_2_2}
145 BuildRequires: pkgconfig(capi-system-info)
151 The DALi Tizen Adaptor provides a Tizen specific implementation of the dali-core
152 platform abstraction and application shell
154 ##############################
156 ##############################
158 Summary: Development components for the DALi Tizen Adaptor
159 Group: Development/Building
160 Requires: %{name} = %{version}-%{release}
161 Requires: %{name}-integration-devel = %{version}-%{release}
164 Development components for the DALi Tizen Adaptor - public headers and package configs
166 ##############################
168 ##############################
169 %package integration-devel
170 Summary: Integration development package for the Adaptor
171 Group: Development/Building
172 Requires: %{name} = %{version}-%{release}
174 %description integration-devel
175 Integration development package for the Adaptor - headers for integrating with an adaptor library.
177 ##############################
178 # Dali Feedback Plugin
179 ##############################
180 %package dali-feedback-plugin
181 Summary: Plugin to play haptic and audio feedback for Dali
182 Group: System/Libraries
183 %if 0%{?dali_feedback_plugin}
184 #Requires: libdeviced
185 BuildRequires: pkgconfig(mm-sound)
186 #BuildRequires: pkgconfig(haptic)
187 BuildRequires: libfeedback-devel
190 %description dali-feedback-plugin
191 Feedback plugin to play haptic and audio feedback for Dali
193 ##############################
194 # Dali VideoPlayer Plugin
195 ##############################
198 %package dali-video-player-plugin
199 Summary: Plugin to play a video file for Dali
200 Group: System/Libraries
201 %if 0%{?dali_videoplayer_plugin}
202 BuildRequires: pkgconfig(capi-media-player)
205 %description dali-video-player-plugin
206 VideoPlayer plugin to play a video file for Dali
209 ##############################
211 ##############################
214 %define dali_data_rw_dir /usr/share/dali/
215 %define dali_data_ro_dir /usr/share/dali/
216 %define user_shader_cache_dir %{dali_data_ro_dir}/core/shaderbin/
217 %define font_preloaded_path /usr/share/fonts/
218 %define font_downloaded_path /opt/share/fonts/
219 %define font_application_path /usr/share/app_fonts/
220 %define font_configuration_file /opt/etc/fonts/conf.avail/99-slp.conf
221 %define dali_plugin_sound_files %{dali_data_ro_dir}/plugins/sounds/
223 %define dev_include_path %{_includedir}
225 ##############################
227 ##############################
230 CXXFLAGS+=" -Wall -g -Os -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections -DGL_GLEXT_PROTOTYPES"
231 LDFLAGS+=" -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--gc-sections -Wl,-Bsymbolic-functions "
234 CXXFLAGS+=" -D_ARCH_ARM_ -lgcc"
239 CXXFLAGS+=" -DWAYLAND"
240 configure_flags="--enable-wayland"
243 %if 0%{?tizen_2_2_compatibility}
244 CFLAGS+=" -DTIZEN_SDK_2_2_COMPATIBILITY"
245 CXXFLAGS+=" -DTIZEN_SDK_2_2_COMPATIBILITY"
249 cd %{_builddir}/%{name}-%{version}/build/tizen
252 DALI_DATA_RW_DIR="%{dali_data_rw_dir}" ; export DALI_DATA_RW_DIR
253 DALI_DATA_RO_DIR="%{dali_data_ro_dir}" ; export DALI_DATA_RO_DIR
254 FONT_PRELOADED_PATH="%{font_preloaded_path}" ; export FONT_PRELOADED_PATH
255 FONT_DOWNLOADED_PATH="%{font_downloaded_path}" ; export FONT_DOWNLOADED_PATH
256 FONT_APPLICATION_PATH="%{font_application_path}" ; export FONT_APPLICATION_PATH
257 FONT_CONFIGURATION_FILE="%{font_configuration_file}" ; export FONT_CONFIGURATION_FILE
259 # Default to GLES 2.0 if not specified.
260 %{!?target_gles_version: %define target_gles_version 20}
262 #--enable-efl=no \ # only affects dali-adaptor-uv
263 #--enable-appfw=yes \ # affects both dali-adaptor & dali-adaptor-uv
264 #--with-libuv=/usr/include/node/ \ # only affects dali-adaptor-uv
266 # Set up the build via configure.
267 %configure --prefix=$PREFIX --with-jpeg-turbo --enable-gles=%{target_gles_version} --enable-shaderbincache=%{shaderbincache_flag} --enable-profile=%{dali_profile} \
268 %if 0%{?dali_feedback_plugin}
271 %if 0%{?dali_videoplayer_plugin}
272 --enable-videoplayer \
274 %if 0%{?tizen_2_2_compatibility}
275 --with-tizen-2-2-compatibility \
282 %if 0%{?enable_debug}
286 --with-libuv=/usr/include/node/ \
287 $configure_flags --libdir=%{_libdir}
290 make %{?jobs:-j%jobs}
292 ##############################
294 ##############################
298 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
301 mkdir -p %{buildroot}/usr/share/license
302 cp -af %{_builddir}/%{name}-%{version}/LICENSE %{buildroot}/usr/share/license/%{name}
304 ##############################
306 # 1 - Pre Install new package
307 # 2 - Install new package
308 # 3 - Post install new package
309 # 4 - Pre uninstall old package
310 # 5 - Remove files not overwritten by new package
311 # 6 - Post uninstall old package
312 ##############################
317 ##############################
318 # Post Install new package
319 ##############################
324 %if 0%{?dali_feedback_plugin}
325 %post dali-feedback-plugin
331 %if 0%{?dali_videoplayer_plugin}
332 %post dali-video-player-plugin
338 ##############################
339 # Pre Uninstall old package
340 ##############################
344 ##############################
345 # Post Uninstall old package
346 ##############################
351 %if 0%{?dali_feedback_plugin}
352 %postun dali-feedback-plugin
358 %if 0%{?dali_videoplayer_plugin}
359 %postun dali-video-player-plugin
365 ##############################
366 # Files in Binary Packages
367 ##############################
370 %manifest dali-adaptor.manifest
371 %defattr(-,root,root,-)
372 %{_libdir}/libdali-adap*.so*
373 %defattr(-,app,app,-)
374 %dir %{user_shader_cache_dir}
376 %{_datadir}/license/%{name}
379 %defattr(-,root,root,-)
380 %{dev_include_path}/dali/dali.h
381 %{dev_include_path}/dali/public-api/*
382 %{dev_include_path}/dali/devel-api/*
383 %{dev_include_path}/dali/doc/*
384 %{_libdir}/pkgconfig/dali-adaptor.pc
385 %{_libdir}/pkgconfig/dali-adaptor-uv.pc
387 %files integration-devel
388 %defattr(-,root,root,-)
389 %{dev_include_path}/dali/integration-api/adaptors/*
390 %{_libdir}/pkgconfig/dali-adaptor-integration.pc
392 %if 0%{?dali_feedback_plugin}
393 %files dali-feedback-plugin
394 %defattr(-,root,root,-)
395 %{_libdir}/libdali-feedback-plugin.so*
396 %{dali_plugin_sound_files}/*
400 %if 0%{?dali_videoplayer_plugin}
401 %files dali-video-player-plugin
402 %manifest dali-adaptor.manifest
403 %defattr(-,root,root,-)
404 %{_libdir}/libdali-video-player-plugin.so*