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 shaderbincache_flag DISABLE
38 BuildRequires: pkgconfig(gles20)
39 %define gles_requirement_setup 1
42 %if "%{profile}" == "tv"
43 %define dali_profile TV
44 %define dali_feedback_plugin 0
45 %define shaderbincache_flag ENABLE
46 BuildRequires: pkgconfig(glesv2)
47 %define gles_requirement_setup 1
50 %if "%{profile}" == "wearable"
51 %define dali_profile WEARABLE
52 %define dali_feedback_plugin 0
53 %define shaderbincache_flag DISABLE
54 BuildRequires: pkgconfig(gles20)
55 %define gles_requirement_setup 1
58 %if "%{profile}" == "common"
59 %define dali_profile COMMON
60 %define dali_feedback_plugin 0
61 %define tizen_2_2_compatibility 1
62 %define shaderbincache_flag DISABLE
63 BuildRequires: pkgconfig(glesv2)
64 %define gles_requirement_setup 1
67 # If we have not set a BuildRequires for the gles version, default it here.
68 %{!?gles_requirement_setup: BuildRequires: pkgconfig(glesv2)}
70 BuildRequires: pkgconfig
72 BuildRequires: pkgconfig(sensor)
73 BuildRequires: pkgconfig(aul)
74 BuildRequires: giflib-devel
75 BuildRequires: pkgconfig(fontconfig)
76 BuildRequires: libjpeg-turbo-devel
77 BuildRequires: dali-devel
78 BuildRequires: dali-integration-devel
79 BuildRequires: pkgconfig(vconf)
80 BuildRequires: tts-devel
81 BuildRequires: pkgconfig(dlog)
82 BuildRequires: libdrm-devel
83 BuildRequires: pkgconfig(libexif)
84 BuildRequires: pkgconfig(libpng)
85 BuildRequires: pkgconfig(egl)
86 BuildRequires: libcurl-devel
87 BuildRequires: pkgconfig(harfbuzz)
88 BuildRequires: fribidi-devel
90 %if 0%{?tizen_2_2_compatibility} != 1
91 BuildRequires: pkgconfig(capi-system-info)
94 # Tizen currently does not have libuv as a separate libuv package
95 # So we have to look into the uv headers bundled inside node-js
96 BuildRequires: nodejs-devel
101 ####### BUILDING FOR WAYLAND #######
102 BuildRequires: pkgconfig(wayland-egl)
103 BuildRequires: pkgconfig(wayland-client)
104 BuildRequires: wayland-devel
105 # Currently Tizen Common we use does not have wayland extensions like xdg-shell
106 %if "%{profile}" != "common"
107 BuildRequires: wayland-extension-client-devel
110 # dali-adaptor-uv uses libuv mainloop and has its own wayland client (it needs wayland-client headers).
111 BuildRequires: libxkbcommon-devel
113 # dali-adaptor uses ecore mainloop
114 BuildRequires: pkgconfig(ecore-wayland)
116 # dali-adaptor needs tbm_surface in tizen 3.0 wayland
117 BuildRequires: pkgconfig(libtbm)
119 # tpkp-curl (certificate pinning for libcurl functions) is only available in Tizen 3.0
120 BuildRequires: pkgconfig(tpkp-curl)
122 ####### BUILDING FOR X11#######
124 BuildRequires: pkgconfig(egl)
125 BuildRequires: pkgconfig(xext)
126 BuildRequires: pkgconfig(xi)
127 BuildRequires: pkgconfig(xfixes)
128 BuildRequires: pkgconfig(xdamage)
129 BuildRequires: pkgconfig(utilX)
133 BuildRequires: pkgconfig(evas)
134 BuildRequires: pkgconfig(elementary)
135 BuildRequires: pkgconfig(capi-appfw-application)
136 BuildRequires: pkgconfig(capi-system-system-settings)
138 %if 0%{?over_tizen_2_2}
139 BuildRequires: pkgconfig(capi-system-info)
145 The DALi Tizen Adaptor provides a Tizen specific implementation of the dali-core
146 platform abstraction and application shell
148 ##############################
150 ##############################
152 Summary: Development components for the DALi Tizen Adaptor
153 Group: Development/Building
154 Requires: %{name} = %{version}-%{release}
155 Requires: %{name}-integration-devel = %{version}-%{release}
158 Development components for the DALi Tizen Adaptor - public headers and package configs
160 ##############################
162 ##############################
163 %package integration-devel
164 Summary: Integration development package for the Adaptor
165 Group: Development/Building
166 Requires: %{name} = %{version}-%{release}
168 %description integration-devel
169 Integration development package for the Adaptor - headers for integrating with an adaptor library.
171 ##############################
172 # Dali Feedback Plugin
173 ##############################
174 %package dali-feedback-plugin
175 Summary: Plugin to play haptic and audio feedback for Dali
176 Group: System/Libraries
177 %if 0%{?dali_feedback_plugin}
178 #Requires: libdeviced
179 BuildRequires: pkgconfig(mm-sound)
180 BuildRequires: pkgconfig(haptic)
181 BuildRequires: libfeedback-devel
184 %description dali-feedback-plugin
185 Feedback plugin to play haptic and audio feedback for Dali
187 ##############################
189 ##############################
192 %define dali_data_rw_dir /usr/share/dali/
193 %define dali_data_ro_dir /usr/share/dali/
194 %define user_shader_cache_dir %{dali_data_ro_dir}/core/shaderbin/
195 %define font_preloaded_path /usr/share/fonts/
196 %define font_downloaded_path /opt/share/fonts/
197 %define font_application_path /usr/share/app_fonts/
198 %define font_configuration_file /opt/etc/fonts/conf.avail/99-slp.conf
199 %define dali_plugin_sound_files %{dali_data_ro_dir}/plugins/sounds/
201 %define dev_include_path %{_includedir}
203 ##############################
205 ##############################
208 CXXFLAGS+=" -Wall -g -Os -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections "
209 LDFLAGS+=" -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--gc-sections -Wl,-Bsymbolic-functions "
212 CXXFLAGS+=" -D_ARCH_ARM_ -lgcc"
217 CXXFLAGS+=" -DWAYLAND"
218 configure_flags="--enable-wayland"
221 %if 0%{?tizen_2_2_compatibility}
222 CFLAGS+=" -DTIZEN_SDK_2_2_COMPATIBILITY"
223 CXXFLAGS+=" -DTIZEN_SDK_2_2_COMPATIBILITY"
227 cd %{_builddir}/%{name}-%{version}/build/tizen
230 DALI_DATA_RW_DIR="%{dali_data_rw_dir}" ; export DALI_DATA_RW_DIR
231 DALI_DATA_RO_DIR="%{dali_data_ro_dir}" ; export DALI_DATA_RO_DIR
232 FONT_PRELOADED_PATH="%{font_preloaded_path}" ; export FONT_PRELOADED_PATH
233 FONT_DOWNLOADED_PATH="%{font_downloaded_path}" ; export FONT_DOWNLOADED_PATH
234 FONT_APPLICATION_PATH="%{font_application_path}" ; export FONT_APPLICATION_PATH
235 FONT_CONFIGURATION_FILE="%{font_configuration_file}" ; export FONT_CONFIGURATION_FILE
237 # Default to GLES 2.0 if not specified.
238 %{!?target_gles_version: %define target_gles_version 20}
240 #--enable-efl=no \ # only affects dali-adaptor-uv
241 #--enable-appfw=yes \ # affects both dali-adaptor & dali-adaptor-uv
242 #--with-libuv=/usr/include/node/ \ # only affects dali-adaptor-uv
244 # Set up the build via configure.
245 %configure --prefix=$PREFIX --with-jpeg-turbo --enable-gles=%{target_gles_version} --enable-shaderbincache=%{shaderbincache_flag} --enable-profile=%{dali_profile} \
246 %if 0%{?dali_feedback_plugin}
249 %if 0%{?tizen_2_2_compatibility}
250 --with-tizen-2-2-compatibility \
258 --with-libuv=/usr/include/node/ \
259 $configure_flags --libdir=%{_libdir}
262 make %{?jobs:-j%jobs}
264 ##############################
266 ##############################
270 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
273 mkdir -p %{buildroot}/usr/share/license
274 cp -af %{_builddir}/%{name}-%{version}/LICENSE %{buildroot}/usr/share/license/%{name}
276 ##############################
278 # 1 - Pre Install new package
279 # 2 - Install new package
280 # 3 - Post install new package
281 # 4 - Pre uninstall old package
282 # 5 - Remove files not overwritten by new package
283 # 6 - Post uninstall old package
284 ##############################
289 ##############################
290 # Post Install new package
291 ##############################
296 %if 0%{?dali_feedback_plugin}
297 %post dali-feedback-plugin
302 ##############################
303 # Pre Uninstall old package
304 ##############################
308 ##############################
309 # Post Uninstall old package
310 ##############################
315 %if 0%{?dali_feedback_plugin}
316 %postun dali-feedback-plugin
321 ##############################
322 # Files in Binary Packages
323 ##############################
326 %manifest dali-adaptor.manifest
327 %defattr(-,root,root,-)
328 %{_libdir}/libdali-adap*.so*
329 %defattr(-,app,app,-)
330 %dir %{user_shader_cache_dir}
332 %{_datadir}/license/%{name}
335 %defattr(-,root,root,-)
336 %{dev_include_path}/dali/dali.h
337 %{dev_include_path}/dali/public-api/*
338 %{dev_include_path}/dali/devel-api/*
339 %{dev_include_path}/dali/doc/*
340 %{_libdir}/pkgconfig/dali-adaptor.pc
341 %{_libdir}/pkgconfig/dali-adaptor-uv.pc
343 %files integration-devel
344 %defattr(-,root,root,-)
345 %{dev_include_path}/dali/integration-api/adaptors/*
346 %{_libdir}/pkgconfig/dali-adaptor-integration.pc
348 %if 0%{?dali_feedback_plugin}
349 %files dali-feedback-plugin
350 %defattr(-,root,root,-)
351 %{_libdir}/libdali-feedback-plugin.so*
352 %{dali_plugin_sound_files}/*