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 BuildRequires: pkgconfig(capi-appfw-watch-application)
56 BuildRequires: pkgconfig(appcore-watch)
57 %define gles_requirement_setup 1
60 %if "%{profile}" == "common"
61 %define dali_profile COMMON
62 %define dali_feedback_plugin 0
63 %define tizen_2_2_compatibility 1
64 %define shaderbincache_flag DISABLE
65 BuildRequires: pkgconfig(glesv2)
66 %define gles_requirement_setup 1
69 # If we have not set a BuildRequires for the gles version, default it here.
70 %{!?gles_requirement_setup: BuildRequires: pkgconfig(glesv2)}
72 BuildRequires: pkgconfig
74 BuildRequires: pkgconfig(aul)
75 BuildRequires: giflib-devel
76 BuildRequires: pkgconfig(fontconfig)
77 BuildRequires: libjpeg-turbo-devel
78 BuildRequires: dali-devel
79 BuildRequires: dali-integration-devel
80 BuildRequires: pkgconfig(vconf)
81 BuildRequires: tts-devel
82 BuildRequires: pkgconfig(dlog)
83 BuildRequires: libdrm-devel
84 BuildRequires: pkgconfig(libexif)
85 BuildRequires: pkgconfig(libpng)
86 BuildRequires: pkgconfig(egl)
87 BuildRequires: libcurl-devel
88 BuildRequires: pkgconfig(harfbuzz)
89 BuildRequires: fribidi-devel
91 %if 0%{?tizen_2_2_compatibility} != 1
92 BuildRequires: pkgconfig(capi-system-info)
93 BuildRequires: pkgconfig(capi-system-sensor)
96 # Tizen currently does not have libuv as a separate libuv package
97 # So we have to look into the uv headers bundled inside node-js
98 BuildRequires: nodejs-devel
103 ####### BUILDING FOR WAYLAND #######
104 BuildRequires: pkgconfig(wayland-egl)
105 BuildRequires: pkgconfig(wayland-client)
106 BuildRequires: wayland-devel
107 # Currently Tizen Common we use does not have wayland extensions like xdg-shell
108 %if "%{profile}" != "common"
109 BuildRequires: wayland-extension-client-devel
112 # dali-adaptor-uv uses libuv mainloop and has its own wayland client (it needs wayland-client headers).
113 BuildRequires: libxkbcommon-devel
115 # dali-adaptor uses ecore mainloop
116 BuildRequires: pkgconfig(ecore-wayland)
118 # dali-adaptor needs tbm_surface in tizen 3.0 wayland
119 BuildRequires: pkgconfig(libtbm)
121 # tpkp-curl (certificate pinning for libcurl functions) is only available in Tizen 3.0
122 BuildRequires: pkgconfig(tpkp-curl)
124 ####### BUILDING FOR X11#######
126 BuildRequires: pkgconfig(egl)
127 BuildRequires: pkgconfig(xext)
128 BuildRequires: pkgconfig(xi)
129 BuildRequires: pkgconfig(xfixes)
130 BuildRequires: pkgconfig(xdamage)
131 BuildRequires: pkgconfig(utilX)
135 BuildRequires: pkgconfig(evas)
136 BuildRequires: pkgconfig(elementary)
137 BuildRequires: pkgconfig(capi-appfw-application)
138 BuildRequires: pkgconfig(capi-system-system-settings)
140 %if 0%{?over_tizen_2_2}
141 BuildRequires: pkgconfig(capi-system-info)
147 The DALi Tizen Adaptor provides a Tizen specific implementation of the dali-core
148 platform abstraction and application shell
150 ##############################
152 ##############################
154 Summary: Development components for the DALi Tizen Adaptor
155 Group: Development/Building
156 Requires: %{name} = %{version}-%{release}
157 Requires: %{name}-integration-devel = %{version}-%{release}
160 Development components for the DALi Tizen Adaptor - public headers and package configs
162 ##############################
164 ##############################
165 %package integration-devel
166 Summary: Integration development package for the Adaptor
167 Group: Development/Building
168 Requires: %{name} = %{version}-%{release}
170 %description integration-devel
171 Integration development package for the Adaptor - headers for integrating with an adaptor library.
173 ##############################
174 # Dali Feedback Plugin
175 ##############################
176 %package dali-feedback-plugin
177 Summary: Plugin to play haptic and audio feedback for Dali
178 Group: System/Libraries
179 %if 0%{?dali_feedback_plugin}
180 #Requires: libdeviced
181 BuildRequires: pkgconfig(mm-sound)
182 BuildRequires: pkgconfig(haptic)
183 BuildRequires: libfeedback-devel
186 %description dali-feedback-plugin
187 Feedback plugin to play haptic and audio feedback for Dali
189 ##############################
191 ##############################
194 %define dali_data_rw_dir /usr/share/dali/
195 %define dali_data_ro_dir /usr/share/dali/
196 %define user_shader_cache_dir %{dali_data_ro_dir}/core/shaderbin/
197 %define font_preloaded_path /usr/share/fonts/
198 %define font_downloaded_path /opt/share/fonts/
199 %define font_application_path /usr/share/app_fonts/
200 %define font_configuration_file /opt/etc/fonts/conf.avail/99-slp.conf
201 %define dali_plugin_sound_files %{dali_data_ro_dir}/plugins/sounds/
203 %define dev_include_path %{_includedir}
205 ##############################
207 ##############################
210 CXXFLAGS+=" -Wall -g -Os -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections -DGL_GLEXT_PROTOTYPES"
211 LDFLAGS+=" -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--gc-sections -Wl,-Bsymbolic-functions "
214 CXXFLAGS+=" -D_ARCH_ARM_ -lgcc"
219 CXXFLAGS+=" -DWAYLAND"
220 configure_flags="--enable-wayland"
223 %if 0%{?tizen_2_2_compatibility}
224 CFLAGS+=" -DTIZEN_SDK_2_2_COMPATIBILITY"
225 CXXFLAGS+=" -DTIZEN_SDK_2_2_COMPATIBILITY"
229 cd %{_builddir}/%{name}-%{version}/build/tizen
232 DALI_DATA_RW_DIR="%{dali_data_rw_dir}" ; export DALI_DATA_RW_DIR
233 DALI_DATA_RO_DIR="%{dali_data_ro_dir}" ; export DALI_DATA_RO_DIR
234 FONT_PRELOADED_PATH="%{font_preloaded_path}" ; export FONT_PRELOADED_PATH
235 FONT_DOWNLOADED_PATH="%{font_downloaded_path}" ; export FONT_DOWNLOADED_PATH
236 FONT_APPLICATION_PATH="%{font_application_path}" ; export FONT_APPLICATION_PATH
237 FONT_CONFIGURATION_FILE="%{font_configuration_file}" ; export FONT_CONFIGURATION_FILE
239 # Default to GLES 2.0 if not specified.
240 %{!?target_gles_version: %define target_gles_version 20}
242 #--enable-efl=no \ # only affects dali-adaptor-uv
243 #--enable-appfw=yes \ # affects both dali-adaptor & dali-adaptor-uv
244 #--with-libuv=/usr/include/node/ \ # only affects dali-adaptor-uv
246 # Set up the build via configure.
247 %configure --prefix=$PREFIX --with-jpeg-turbo --enable-gles=%{target_gles_version} --enable-shaderbincache=%{shaderbincache_flag} --enable-profile=%{dali_profile} \
248 %if 0%{?dali_feedback_plugin}
251 %if 0%{?tizen_2_2_compatibility}
252 --with-tizen-2-2-compatibility \
259 %if 0%{?enable_debug}
263 --with-libuv=/usr/include/node/ \
264 $configure_flags --libdir=%{_libdir}
267 make %{?jobs:-j%jobs}
269 ##############################
271 ##############################
275 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
278 mkdir -p %{buildroot}/usr/share/license
279 cp -af %{_builddir}/%{name}-%{version}/LICENSE %{buildroot}/usr/share/license/%{name}
281 ##############################
283 # 1 - Pre Install new package
284 # 2 - Install new package
285 # 3 - Post install new package
286 # 4 - Pre uninstall old package
287 # 5 - Remove files not overwritten by new package
288 # 6 - Post uninstall old package
289 ##############################
294 ##############################
295 # Post Install new package
296 ##############################
301 %if 0%{?dali_feedback_plugin}
302 %post dali-feedback-plugin
307 ##############################
308 # Pre Uninstall old package
309 ##############################
313 ##############################
314 # Post Uninstall old package
315 ##############################
320 %if 0%{?dali_feedback_plugin}
321 %postun dali-feedback-plugin
326 ##############################
327 # Files in Binary Packages
328 ##############################
331 %manifest dali-adaptor.manifest
332 %defattr(-,root,root,-)
333 %{_libdir}/libdali-adap*.so*
334 %defattr(-,app,app,-)
335 %dir %{user_shader_cache_dir}
337 %{_datadir}/license/%{name}
340 %defattr(-,root,root,-)
341 %{dev_include_path}/dali/dali.h
342 %{dev_include_path}/dali/public-api/*
343 %{dev_include_path}/dali/devel-api/*
344 %{dev_include_path}/dali/doc/*
345 %{_libdir}/pkgconfig/dali-adaptor.pc
346 %{_libdir}/pkgconfig/dali-adaptor-uv.pc
348 %files integration-devel
349 %defattr(-,root,root,-)
350 %{dev_include_path}/dali/integration-api/adaptors/*
351 %{_libdir}/pkgconfig/dali-adaptor-integration.pc
353 %if 0%{?dali_feedback_plugin}
354 %files dali-feedback-plugin
355 %defattr(-,root,root,-)
356 %{_libdir}/libdali-feedback-plugin.so*
357 %{dali_plugin_sound_files}/*