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}" == "ivi"
59 %define dali_profile IVI
60 %define dali_feedback_plugin 0
61 %define shaderbincache_flag DISABLE
62 BuildRequires: pkgconfig(glesv2)
63 %define gles_requirement_setup 1
66 %if "%{profile}" == "common"
67 %define dali_profile COMMON
68 %define dali_feedback_plugin 0
69 %define tizen_2_2_compatibility 0
70 %define shaderbincache_flag DISABLE
71 BuildRequires: pkgconfig(glesv2)
72 %define gles_requirement_setup 1
75 # If we have not set a BuildRequires for the gles version, default it here.
76 %{!?gles_requirement_setup: BuildRequires: pkgconfig(glesv2)}
78 BuildRequires: pkgconfig
80 BuildRequires: pkgconfig(aul)
81 BuildRequires: giflib-devel
82 BuildRequires: pkgconfig(fontconfig)
83 BuildRequires: libjpeg-turbo-devel
84 BuildRequires: dali-devel
85 BuildRequires: dali-integration-devel
86 BuildRequires: pkgconfig(vconf)
87 BuildRequires: tts-devel
88 BuildRequires: pkgconfig(dlog)
89 BuildRequires: libdrm-devel
90 BuildRequires: pkgconfig(libexif)
91 BuildRequires: pkgconfig(libpng)
92 BuildRequires: pkgconfig(egl)
93 BuildRequires: libcurl-devel
94 BuildRequires: pkgconfig(harfbuzz)
95 BuildRequires: fribidi-devel
97 %if 0%{?tizen_2_2_compatibility} != 1
98 BuildRequires: pkgconfig(capi-system-info)
99 BuildRequires: pkgconfig(capi-system-sensor)
102 # Tizen currently does not have libuv as a separate libuv package
103 # So we have to look into the uv headers bundled inside node-js
104 BuildRequires: nodejs-devel
109 ####### BUILDING FOR WAYLAND #######
110 BuildRequires: pkgconfig(wayland-egl)
111 BuildRequires: pkgconfig(wayland-client)
112 BuildRequires: wayland-devel
113 # Currently Tizen Common we use does not have wayland extensions like xdg-shell
114 %if "%{profile}" != "common"
115 BuildRequires: wayland-extension-client-devel
118 # dali-adaptor-uv uses libuv mainloop and has its own wayland client (it needs wayland-client headers).
119 BuildRequires: libxkbcommon-devel
121 # dali-adaptor uses ecore mainloop
122 BuildRequires: pkgconfig(ecore-wayland)
124 # dali-adaptor needs tbm_surface in tizen 3.0 wayland
125 BuildRequires: pkgconfig(libtbm)
127 # tpkp-curl (certificate pinning for libcurl functions) is only available in Tizen 3.0
128 BuildRequires: pkgconfig(tpkp-curl)
130 ####### BUILDING FOR X11#######
132 BuildRequires: pkgconfig(egl)
133 BuildRequires: pkgconfig(xext)
134 BuildRequires: pkgconfig(xi)
135 BuildRequires: pkgconfig(xfixes)
136 BuildRequires: pkgconfig(xdamage)
137 BuildRequires: pkgconfig(utilX)
141 BuildRequires: pkgconfig(evas)
142 BuildRequires: pkgconfig(elementary)
143 BuildRequires: pkgconfig(capi-appfw-application)
144 BuildRequires: pkgconfig(capi-system-system-settings)
146 %if 0%{?over_tizen_2_2}
147 BuildRequires: pkgconfig(capi-system-info)
153 The DALi Tizen Adaptor provides a Tizen specific implementation of the dali-core
154 platform abstraction and application shell
156 ##############################
158 ##############################
160 Summary: Development components for the DALi Tizen Adaptor
161 Group: Development/Building
162 Requires: %{name} = %{version}-%{release}
163 Requires: %{name}-integration-devel = %{version}-%{release}
166 Development components for the DALi Tizen Adaptor - public headers and package configs
168 ##############################
170 ##############################
171 %package integration-devel
172 Summary: Integration development package for the Adaptor
173 Group: Development/Building
174 Requires: %{name} = %{version}-%{release}
176 %description integration-devel
177 Integration development package for the Adaptor - headers for integrating with an adaptor library.
179 ##############################
180 # Dali Feedback Plugin
181 ##############################
182 %package dali-feedback-plugin
183 Summary: Plugin to play haptic and audio feedback for Dali
184 Group: System/Libraries
185 %if 0%{?dali_feedback_plugin}
186 #Requires: libdeviced
187 BuildRequires: pkgconfig(mm-sound)
188 BuildRequires: pkgconfig(haptic)
189 BuildRequires: libfeedback-devel
192 %description dali-feedback-plugin
193 Feedback plugin to play haptic and audio feedback for Dali
195 ##############################
197 ##############################
200 %define dali_data_rw_dir /usr/share/dali/
201 %define dali_data_ro_dir /usr/share/dali/
202 %define user_shader_cache_dir %{dali_data_ro_dir}/core/shaderbin/
203 %define font_preloaded_path /usr/share/fonts/
204 %define font_downloaded_path /opt/share/fonts/
205 %define font_application_path /usr/share/app_fonts/
206 %define font_configuration_file /opt/etc/fonts/conf.avail/99-slp.conf
207 %define dali_plugin_sound_files %{dali_data_ro_dir}/plugins/sounds/
209 %define dev_include_path %{_includedir}
211 ##############################
213 ##############################
216 CXXFLAGS+=" -Wall -g -Os -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections "
217 LDFLAGS+=" -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--gc-sections -Wl,-Bsymbolic-functions "
220 CXXFLAGS+=" -D_ARCH_ARM_ -lgcc"
225 CXXFLAGS+=" -DWAYLAND"
226 configure_flags="--enable-wayland"
229 %if 0%{?tizen_2_2_compatibility}
230 CFLAGS+=" -DTIZEN_SDK_2_2_COMPATIBILITY"
231 CXXFLAGS+=" -DTIZEN_SDK_2_2_COMPATIBILITY"
235 cd %{_builddir}/%{name}-%{version}/build/tizen
238 DALI_DATA_RW_DIR="%{dali_data_rw_dir}" ; export DALI_DATA_RW_DIR
239 DALI_DATA_RO_DIR="%{dali_data_ro_dir}" ; export DALI_DATA_RO_DIR
240 FONT_PRELOADED_PATH="%{font_preloaded_path}" ; export FONT_PRELOADED_PATH
241 FONT_DOWNLOADED_PATH="%{font_downloaded_path}" ; export FONT_DOWNLOADED_PATH
242 FONT_APPLICATION_PATH="%{font_application_path}" ; export FONT_APPLICATION_PATH
243 FONT_CONFIGURATION_FILE="%{font_configuration_file}" ; export FONT_CONFIGURATION_FILE
245 # Default to GLES 2.0 if not specified.
246 %{!?target_gles_version: %define target_gles_version 20}
248 #--enable-efl=no \ # only affects dali-adaptor-uv
249 #--enable-appfw=yes \ # affects both dali-adaptor & dali-adaptor-uv
250 #--with-libuv=/usr/include/node/ \ # only affects dali-adaptor-uv
252 # Set up the build via configure.
253 %configure --prefix=$PREFIX --with-jpeg-turbo --enable-gles=%{target_gles_version} --enable-shaderbincache=%{shaderbincache_flag} --enable-profile=%{dali_profile} \
254 %if 0%{?dali_feedback_plugin}
257 %if 0%{?tizen_2_2_compatibility}
258 --with-tizen-2-2-compatibility \
266 --with-libuv=/usr/include/node/ \
267 $configure_flags --libdir=%{_libdir}
270 make %{?jobs:-j%jobs}
272 ##############################
274 ##############################
278 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
281 mkdir -p %{buildroot}/usr/share/license
282 cp -af %{_builddir}/%{name}-%{version}/LICENSE %{buildroot}/usr/share/license/%{name}
284 ##############################
286 # 1 - Pre Install new package
287 # 2 - Install new package
288 # 3 - Post install new package
289 # 4 - Pre uninstall old package
290 # 5 - Remove files not overwritten by new package
291 # 6 - Post uninstall old package
292 ##############################
297 ##############################
298 # Post Install new package
299 ##############################
304 %if 0%{?dali_feedback_plugin}
305 %post dali-feedback-plugin
310 ##############################
311 # Pre Uninstall old package
312 ##############################
316 ##############################
317 # Post Uninstall old package
318 ##############################
323 %if 0%{?dali_feedback_plugin}
324 %postun dali-feedback-plugin
329 ##############################
330 # Files in Binary Packages
331 ##############################
334 %manifest dali-adaptor.manifest
335 %defattr(-,root,root,-)
336 %{_libdir}/libdali-adap*.so*
337 %defattr(-,app,app,-)
338 %dir %{user_shader_cache_dir}
340 %{_datadir}/license/%{name}
343 %defattr(-,root,root,-)
344 %{dev_include_path}/dali/dali.h
345 %{dev_include_path}/dali/public-api/*
346 %{dev_include_path}/dali/devel-api/*
347 %{dev_include_path}/dali/doc/*
348 %{_libdir}/pkgconfig/dali-adaptor.pc
349 %{_libdir}/pkgconfig/dali-adaptor-uv.pc
351 %files integration-devel
352 %defattr(-,root,root,-)
353 %{dev_include_path}/dali/integration-api/adaptors/*
354 %{_libdir}/pkgconfig/dali-adaptor-integration.pc
356 %if 0%{?dali_feedback_plugin}
357 %files dali-feedback-plugin
358 %defattr(-,root,root,-)
359 %{_libdir}/libdali-feedback-plugin.so*
360 %{dali_plugin_sound_files}/*