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 it exists.
29 %if 0%{?tizen_profile_name:1}
30 %define profile %{tizen_profile_name}
33 %if "%{profile}" == "mobile"
34 %define dali_profile MOBILE
35 %define dali_feedback_plugin 0
36 %define shaderbincache_flag DISABLE
37 BuildRequires: pkgconfig(gles20)
38 %define gles_requirement_setup 1
41 %if "%{profile}" == "tv"
42 %define dali_profile TV
43 %define dali_feedback_plugin 0
44 %define shaderbincache_flag ENABLE
45 BuildRequires: pkgconfig(glesv2)
46 %define gles_requirement_setup 1
49 %if "%{profile}" == "wearable"
50 %define dali_profile WEARABLE
51 %define dali_feedback_plugin 0
52 %define shaderbincache_flag DISABLE
53 BuildRequires: pkgconfig(gles20)
54 %define gles_requirement_setup 1
57 %if "%{profile}" == "common"
58 %define dali_profile COMMON
59 %define dali_feedback_plugin 0
60 %define tizen_2_2_compatibility 1
61 %define shaderbincache_flag DISABLE
62 BuildRequires: pkgconfig(glesv2)
63 %define gles_requirement_setup 1
66 # If we have not set a BuildRequires for the gles version, default it here.
67 %{!?gles_requirement_setup: BuildRequires: pkgconfig(glesv2)}
69 BuildRequires: pkgconfig
71 BuildRequires: pkgconfig(sensor)
72 BuildRequires: pkgconfig(aul)
73 BuildRequires: giflib-devel
74 BuildRequires: pkgconfig(fontconfig)
75 BuildRequires: libjpeg-turbo-devel
76 BuildRequires: dali-devel
77 BuildRequires: dali-integration-devel
78 BuildRequires: pkgconfig(vconf)
79 BuildRequires: tts-devel
80 BuildRequires: pkgconfig(dlog)
81 BuildRequires: libdrm-devel
82 BuildRequires: pkgconfig(libexif)
83 BuildRequires: pkgconfig(libpng)
84 BuildRequires: pkgconfig(egl)
85 BuildRequires: libcurl-devel
86 BuildRequires: pkgconfig(harfbuzz)
87 BuildRequires: fribidi-devel
89 %if 0%{?tizen_2_2_compatibility} != 1
90 BuildRequires: pkgconfig(capi-system-info)
93 # Tizen currently does not have libuv as a separate libuv package
94 # So we have to look into the uv headers bundled inside node-js
95 BuildRequires: nodejs-devel
100 ####### BUILDING FOR WAYLAND #######
101 BuildRequires: pkgconfig(wayland-egl)
102 BuildRequires: pkgconfig(wayland-client)
103 BuildRequires: wayland-devel
104 # Currently Tizen Common we use does not have wayland extensions like xdg-shell
105 %if "%{profile}" != "common"
106 BuildRequires: wayland-extension-client-devel
109 # dali-adaptor-uv uses libuv mainloop and has its own wayland client (it needs wayland-client headers).
110 BuildRequires: libxkbcommon-devel
112 # dali-adaptor uses ecore mainloop
113 BuildRequires: pkgconfig(ecore-wayland)
115 # dali-adaptor needs tbm_surface in tizen 3.0 wayland
116 BuildRequires: pkgconfig(libtbm)
118 # tpkp-curl (certificate pinning for libcurl functions) is only available in Tizen 3.0
119 BuildRequires: pkgconfig(tpkp-curl)
121 ####### BUILDING FOR X11#######
123 BuildRequires: pkgconfig(egl)
124 BuildRequires: pkgconfig(xext)
125 BuildRequires: pkgconfig(xi)
126 BuildRequires: pkgconfig(xfixes)
127 BuildRequires: pkgconfig(xdamage)
128 BuildRequires: pkgconfig(utilX)
132 BuildRequires: pkgconfig(evas)
133 BuildRequires: pkgconfig(elementary)
134 BuildRequires: pkgconfig(capi-appfw-application)
135 BuildRequires: pkgconfig(capi-system-system-settings)
137 %if 0%{?over_tizen_2_2}
138 BuildRequires: pkgconfig(capi-system-info)
144 The DALi Tizen Adaptor provides a Tizen specific implementation of the dali-core
145 platform abstraction and application shell
147 ##############################
149 ##############################
151 Summary: Development components for the DALi Tizen Adaptor
152 Group: Development/Building
153 Requires: %{name} = %{version}-%{release}
154 Requires: %{name}-integration-devel = %{version}-%{release}
157 Development components for the DALi Tizen Adaptor - public headers and package configs
159 ##############################
161 ##############################
162 %package integration-devel
163 Summary: Integration development package for the Adaptor
164 Group: Development/Building
165 Requires: %{name} = %{version}-%{release}
167 %description integration-devel
168 Integration development package for the Adaptor - headers for integrating with an adaptor library.
170 ##############################
171 # Dali Feedback Plugin
172 ##############################
173 %package dali-feedback-plugin
174 Summary: Plugin to play haptic and audio feedback for Dali
175 Group: System/Libraries
176 %if 0%{?dali_feedback_plugin}
177 #Requires: libdeviced
178 BuildRequires: pkgconfig(mm-sound)
179 BuildRequires: pkgconfig(haptic)
180 BuildRequires: libfeedback-devel
183 %description dali-feedback-plugin
184 Feedback plugin to play haptic and audio feedback for Dali
186 ##############################
188 ##############################
191 %define dali_data_rw_dir /usr/share/dali/
192 %define dali_data_ro_dir /usr/share/dali/
193 %define user_shader_cache_dir %{dali_data_ro_dir}/core/shaderbin/
194 %define font_preloaded_path /usr/share/fonts/
195 %define font_downloaded_path /opt/share/fonts/
196 %define font_application_path /usr/share/app_fonts/
197 %define font_configuration_file /opt/etc/fonts/conf.avail/99-slp.conf
198 %define dali_plugin_sound_files %{dali_data_ro_dir}/plugins/sounds/
200 %define dev_include_path %{_includedir}
202 ##############################
204 ##############################
207 CXXFLAGS+=" -Wall -g -Os -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections "
208 LDFLAGS+=" -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--gc-sections -Wl,-Bsymbolic-functions "
211 CXXFLAGS+=" -D_ARCH_ARM_ -lgcc"
216 CXXFLAGS+=" -DWAYLAND"
217 configure_flags="--enable-wayland"
220 %if 0%{?tizen_2_2_compatibility}
221 CFLAGS+=" -DTIZEN_SDK_2_2_COMPATIBILITY"
222 CXXFLAGS+=" -DTIZEN_SDK_2_2_COMPATIBILITY"
226 cd %{_builddir}/%{name}-%{version}/build/tizen
229 DALI_DATA_RW_DIR="%{dali_data_rw_dir}" ; export DALI_DATA_RW_DIR
230 DALI_DATA_RO_DIR="%{dali_data_ro_dir}" ; export DALI_DATA_RO_DIR
231 FONT_PRELOADED_PATH="%{font_preloaded_path}" ; export FONT_PRELOADED_PATH
232 FONT_DOWNLOADED_PATH="%{font_downloaded_path}" ; export FONT_DOWNLOADED_PATH
233 FONT_APPLICATION_PATH="%{font_application_path}" ; export FONT_APPLICATION_PATH
234 FONT_CONFIGURATION_FILE="%{font_configuration_file}" ; export FONT_CONFIGURATION_FILE
236 # Default to GLES 2.0 if not specified.
237 %{!?target_gles_version: %define target_gles_version 20}
239 #--enable-efl=no \ # only affects dali-adaptor-uv
240 #--enable-appfw=yes \ # affects both dali-adaptor & dali-adaptor-uv
241 #--with-libuv=/usr/include/node/ \ # only affects dali-adaptor-uv
243 # Set up the build via configure.
244 %configure --prefix=$PREFIX --with-jpeg-turbo --enable-gles=%{target_gles_version} --enable-shaderbincache=%{shaderbincache_flag} --enable-profile=%{dali_profile} \
245 %if 0%{?dali_feedback_plugin}
248 %if 0%{?tizen_2_2_compatibility}
249 --with-tizen-2-2-compatibility \
257 --with-libuv=/usr/include/node/ \
258 $configure_flags --libdir=%{_libdir}
261 make %{?jobs:-j%jobs}
263 ##############################
265 ##############################
269 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
272 mkdir -p %{buildroot}/usr/share/license
273 cp -af %{_builddir}/%{name}-%{version}/LICENSE %{buildroot}/usr/share/license/%{name}
275 ##############################
277 # 1 - Pre Install new package
278 # 2 - Install new package
279 # 3 - Post install new package
280 # 4 - Pre uninstall old package
281 # 5 - Remove files not overwritten by new package
282 # 6 - Post uninstall old package
283 ##############################
288 ##############################
289 # Post Install new package
290 ##############################
295 %if 0%{?dali_feedback_plugin}
296 %post dali-feedback-plugin
301 ##############################
302 # Pre Uninstall old package
303 ##############################
307 ##############################
308 # Post Uninstall old package
309 ##############################
314 %if 0%{?dali_feedback_plugin}
315 %postun dali-feedback-plugin
320 ##############################
321 # Files in Binary Packages
322 ##############################
325 %manifest dali-adaptor.manifest
326 %defattr(-,root,root,-)
327 %{_libdir}/libdali-adap*.so*
328 %defattr(-,app,app,-)
329 %dir %{user_shader_cache_dir}
331 %{_datadir}/license/%{name}
334 %defattr(-,root,root,-)
335 %{dev_include_path}/dali/dali.h
336 %{dev_include_path}/dali/public-api/*
337 %{dev_include_path}/dali/devel-api/*
338 %{dev_include_path}/dali/doc/*
339 %{_libdir}/pkgconfig/dali-adaptor.pc
340 %{_libdir}/pkgconfig/dali-adaptor-uv.pc
342 %files integration-devel
343 %defattr(-,root,root,-)
344 %{dev_include_path}/dali/integration-api/adaptors/*
345 %{_libdir}/pkgconfig/dali-adaptor-integration.pc
347 %if 0%{?dali_feedback_plugin}
348 %files dali-feedback-plugin
349 %defattr(-,root,root,-)
350 %{_libdir}/libdali-feedback-plugin.so*
351 %{dali_plugin_sound_files}/*