DALi Version 1.1.45
[platform/core/uifw/dali-adaptor.git] / packaging / dali-adaptor.spec
1 # NOTES
2 # This spec file is used to build DALi Adaptor for different Tizen Profiles
3 # Current profiles are:  Mobile, TV, Wearable, Common
4 #
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
7 #
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
11
12
13 %bcond_with wayland
14
15 Name:       dali-adaptor
16 Summary:    The DALi Tizen Adaptor
17 Version:    1.1.45
18 Release:    1
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
23
24 Requires(post): /sbin/ldconfig
25 Requires(postun): /sbin/ldconfig
26 Requires:       giflib
27
28 #need libtzplatform-config for directory if tizen version is 3.x
29
30 %if "%{tizen_version_major}" == "3"
31 BuildRequires:  pkgconfig(libtzplatform-config)
32 %endif
33
34
35 # Get the profile from tizen_profile_name if tizen version is 2.x and tizen_profile_name exists.
36
37 %if "%{tizen_version_major}" == "2" && 0%{?tizen_profile_name:1}
38 %define profile %{tizen_profile_name}
39 %endif
40
41 %if "%{profile}" == "mobile"
42 %define dali_profile MOBILE
43 %define dali_feedback_plugin 0
44 %define dali_videoplayer_plugin 1
45 %define shaderbincache_flag DISABLE
46 BuildRequires:  pkgconfig(gles20)
47 %define gles_requirement_setup 1
48 %endif
49
50 %if "%{profile}" == "tv"
51 %define dali_profile TV
52 %define dali_feedback_plugin 0
53 %define dali_videoplayer_plugin 1
54 %define shaderbincache_flag ENABLE
55 BuildRequires:  pkgconfig(glesv2)
56 %define gles_requirement_setup 1
57 %endif
58
59 %if "%{profile}" == "wearable"
60 %define dali_profile WEARABLE
61 %define dali_feedback_plugin 0
62 %define dali_videoplayer_plugin 1
63 %define shaderbincache_flag DISABLE
64 BuildRequires:  pkgconfig(gles20)
65 BuildRequires:  pkgconfig(capi-appfw-watch-application)
66 BuildRequires:  pkgconfig(appcore-watch)
67 %define gles_requirement_setup 1
68 %endif
69
70 %if "%{profile}" == "common"
71 %define dali_profile COMMON
72 %define dali_feedback_plugin 0
73 %define dali_videoplayer_plugin 1
74 %define tizen_2_2_compatibility 0
75 %define shaderbincache_flag DISABLE
76 BuildRequires:  pkgconfig(glesv2)
77 %define gles_requirement_setup 1
78 %endif
79
80 # If we have not set a BuildRequires for the gles version, default it here.
81 %{!?gles_requirement_setup: BuildRequires:  pkgconfig(glesv2)}
82
83 BuildRequires:  pkgconfig
84 BuildRequires:  gawk
85 BuildRequires:  pkgconfig(aul)
86 BuildRequires:  giflib-devel
87 BuildRequires:  pkgconfig(fontconfig)
88 BuildRequires:  libjpeg-turbo-devel
89 BuildRequires:  dali-devel
90 BuildRequires:  dali-integration-devel
91 BuildRequires:  pkgconfig(vconf)
92 BuildRequires:  tts-devel
93 BuildRequires:  pkgconfig(dlog)
94 BuildRequires:  libdrm-devel
95 BuildRequires:  pkgconfig(libexif)
96 BuildRequires:  pkgconfig(libpng)
97 BuildRequires:  pkgconfig(egl)
98 BuildRequires:  libcurl-devel
99 BuildRequires:  pkgconfig(harfbuzz)
100 BuildRequires:  fribidi-devel
101
102 %if 0%{?tizen_2_2_compatibility} != 1
103 BuildRequires:  pkgconfig(capi-system-info)
104 BuildRequires:  pkgconfig(capi-system-sensor)
105 %endif
106
107 # Tizen currently does not have libuv as a separate libuv package
108 # So we have to look into the uv headers bundled inside node-js
109 BuildRequires:  nodejs-devel
110
111
112 %if %{with wayland}
113
114 ####### BUILDING FOR WAYLAND #######
115 BuildRequires:  pkgconfig(wayland-egl)
116 BuildRequires:  pkgconfig(wayland-client)
117 BuildRequires:  wayland-devel
118 # Currently Tizen Common we use does not have wayland extensions like xdg-shell
119 %if "%{profile}" != "common"
120 BuildRequires:  wayland-extension-client-devel
121 %endif
122
123 # dali-adaptor-uv uses libuv mainloop and has its own wayland client (it needs wayland-client headers).
124 BuildRequires:  libxkbcommon-devel
125
126 # dali-adaptor uses ecore mainloop
127 BuildRequires:  pkgconfig(ecore-wayland)
128
129 # dali-adaptor needs tbm_surface in tizen 3.0 wayland
130 BuildRequires:  pkgconfig(libtbm)
131
132 # tpkp-curl (certificate pinning for libcurl functions) is only available in Tizen 3.0
133 BuildRequires:  pkgconfig(tpkp-curl)
134
135 ####### BUILDING FOR X11#######
136 %else
137 BuildRequires:  pkgconfig(egl)
138 BuildRequires:  pkgconfig(xext)
139 BuildRequires:  pkgconfig(xi)
140 BuildRequires:  pkgconfig(xfixes)
141 BuildRequires:  pkgconfig(xdamage)
142 BuildRequires:  pkgconfig(utilX)
143 %endif
144
145 # for dali-adaptor
146 BuildRequires:  pkgconfig(evas)
147 BuildRequires:  pkgconfig(elementary)
148 BuildRequires:  pkgconfig(capi-appfw-application)
149 BuildRequires:  pkgconfig(capi-system-system-settings)
150
151 %if 0%{?over_tizen_2_2}
152 BuildRequires:  pkgconfig(capi-system-info)
153 %endif
154
155
156
157 %description
158 The DALi Tizen Adaptor provides a Tizen specific implementation of the dali-core
159 platform abstraction and application shell
160
161 ##############################
162 # devel
163 ##############################
164 %package devel
165 Summary:    Development components for the DALi Tizen Adaptor
166 Group:      Development/Building
167 Requires:   %{name} = %{version}-%{release}
168 Requires:   %{name}-integration-devel = %{version}-%{release}
169
170 %description devel
171 Development components for the DALi Tizen Adaptor - public headers and package configs
172
173 ##############################
174 # integration-devel
175 ##############################
176 %package integration-devel
177 Summary:    Integration development package for the Adaptor
178 Group:      Development/Building
179 Requires:   %{name} = %{version}-%{release}
180
181 %description integration-devel
182 Integration development package for the Adaptor - headers for integrating with an adaptor library.
183
184 ##############################
185 # Dali Feedback Plugin
186 ##############################
187 %package dali-feedback-plugin
188 Summary:    Plugin to play haptic and audio feedback for Dali
189 Group:      System/Libraries
190 %if 0%{?dali_feedback_plugin}
191 #Requires:       libdeviced
192 BuildRequires:  pkgconfig(mm-sound)
193 #BuildRequires:  pkgconfig(haptic)
194 BuildRequires:  libfeedback-devel
195 %endif
196
197 %description dali-feedback-plugin
198 Feedback plugin to play haptic and audio feedback for Dali
199
200 ##############################
201 # Dali VideoPlayer Plugin
202 ##############################
203 %if %{with wayland}
204
205 %package dali-video-player-plugin
206 Summary:    Plugin to play a video file for Dali
207 Group:      System/Libraries
208 %if 0%{?dali_videoplayer_plugin}
209 BuildRequires:  pkgconfig(capi-media-player)
210 %endif
211
212 %description dali-video-player-plugin
213 VideoPlayer plugin to play a video file for Dali
214 %endif
215
216 ##############################
217 # Preparation
218 ##############################
219 %prep
220 %setup -q
221
222 #Use TZ_PATH when tizen version is 3.x
223
224 %if "%{tizen_version_major}" == "2"
225 %define dali_data_rw_dir         /usr/share/dali/
226 %define dali_data_ro_dir         /usr/share/dali/
227 %define font_preloaded_path      /usr/share/fonts/
228 %define font_downloaded_path     /opt/share/fonts/
229 %define font_application_path    /usr/share/app_fonts/
230 %define font_configuration_file  /opt/etc/fonts/conf.avail/99-slp.conf
231 %else
232 %define dali_data_rw_dir         %TZ_SYS_RO_SHARE/dali/
233 %define dali_data_ro_dir         %TZ_SYS_RO_SHARE/dali/
234 %define font_preloaded_path      %TZ_SYS_RO_SHARE/fonts/
235 %define font_downloaded_path     %TZ_SYS_SHARE/fonts/
236 %define font_application_path    %TZ_SYS_RO_SHARE/app_fonts/
237 %define font_configuration_file  %TZ_SYS_ETC/fonts/conf.avail/99-slp.conf
238 %endif
239
240 %define user_shader_cache_dir    %{dali_data_ro_dir}/core/shaderbin/
241 %define dali_plugin_sound_files  %{dali_data_ro_dir}/plugins/sounds/
242 %define dev_include_path %{_includedir}
243
244 ##############################
245 # Build
246 ##############################
247 %build
248 PREFIX+="/usr"
249 CXXFLAGS+=" -Wall -g -Os -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections -DGL_GLEXT_PROTOTYPES"
250 LDFLAGS+=" -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--gc-sections -Wl,-Bsymbolic-functions "
251
252 %ifarch %{arm}
253 CXXFLAGS+=" -D_ARCH_ARM_ -lgcc"
254 %endif
255
256 %if %{with wayland}
257 CFLAGS+=" -DWAYLAND"
258 CXXFLAGS+=" -DWAYLAND"
259 configure_flags="--enable-wayland"
260 %endif
261
262 %if 0%{?tizen_2_2_compatibility}
263 CFLAGS+=" -DTIZEN_SDK_2_2_COMPATIBILITY"
264 CXXFLAGS+=" -DTIZEN_SDK_2_2_COMPATIBILITY"
265 %endif
266
267 libtoolize --force
268 cd %{_builddir}/%{name}-%{version}/build/tizen
269 autoreconf --install
270
271 DALI_DATA_RW_DIR="%{dali_data_rw_dir}" ; export DALI_DATA_RW_DIR
272 DALI_DATA_RO_DIR="%{dali_data_ro_dir}"  ; export DALI_DATA_RO_DIR
273 FONT_PRELOADED_PATH="%{font_preloaded_path}" ; export FONT_PRELOADED_PATH
274 FONT_DOWNLOADED_PATH="%{font_downloaded_path}" ; export FONT_DOWNLOADED_PATH
275 FONT_APPLICATION_PATH="%{font_application_path}"  ; export FONT_APPLICATION_PATH
276 FONT_CONFIGURATION_FILE="%{font_configuration_file}" ; export FONT_CONFIGURATION_FILE
277
278 # Default to GLES 2.0 if not specified.
279 %{!?target_gles_version: %define target_gles_version 20}
280
281 #--enable-efl=no \ # only affects dali-adaptor-uv
282 #--enable-appfw=yes \ # affects both dali-adaptor & dali-adaptor-uv
283 #--with-libuv=/usr/include/node/ \ # only affects dali-adaptor-uv
284
285 # Set up the build via configure.
286 %configure --prefix=$PREFIX --with-jpeg-turbo --enable-gles=%{target_gles_version} --enable-shaderbincache=%{shaderbincache_flag} --enable-profile=%{dali_profile} \
287 %if 0%{?dali_feedback_plugin}
288            --enable-feedback \
289 %endif
290 %if 0%{?dali_videoplayer_plugin}
291            --enable-videoplayer \
292 %endif
293 %if 0%{?tizen_2_2_compatibility}
294            --with-tizen-2-2-compatibility \
295 %endif
296 %if %{with wayland}
297            --enable-efl=no \
298 %else
299            --enable-efl=yes \
300 %endif
301 %if 0%{?enable_debug}
302            --enable-debug \
303 %endif
304            --enable-appfw=yes \
305            --with-libuv=/usr/include/node/ \
306            $configure_flags --libdir=%{_libdir}
307
308 # Build.
309 make %{?jobs:-j%jobs}
310
311 ##############################
312 # Installation
313 ##############################
314 %install
315 rm -rf %{buildroot}
316 cd build/tizen
317 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
318
319 # LICENSE
320 mkdir -p %{buildroot}/usr/share/license
321 cp -af %{_builddir}/%{name}-%{version}/LICENSE %{buildroot}/usr/share/license/%{name}
322
323 ##############################
324 # Upgrade order:
325 # 1 - Pre Install new package
326 # 2 - Install new package
327 # 3 - Post install new package
328 # 4 - Pre uninstall old package
329 # 5 - Remove files not overwritten by new package
330 # 6 - Post uninstall old package
331 ##############################
332
333 %pre
334 exit 0
335
336 ##############################
337 #  Post Install new package
338 ##############################
339 %post
340 /sbin/ldconfig
341 exit 0
342
343 %if 0%{?dali_feedback_plugin}
344 %post dali-feedback-plugin
345 /sbin/ldconfig
346 exit 0
347 %endif
348
349 %if %{with wayland}
350 %if 0%{?dali_videoplayer_plugin}
351 %post dali-video-player-plugin
352 /sbin/ldconfig
353 exit 0
354 %endif
355 %endif
356
357 ##############################
358 #   Pre Uninstall old package
359 ##############################
360 %preun
361 exit 0
362
363 ##############################
364 #   Post Uninstall old package
365 ##############################
366 %postun
367 /sbin/ldconfig
368 exit 0
369
370 %if 0%{?dali_feedback_plugin}
371 %postun dali-feedback-plugin
372 /sbin/ldconfig
373 exit 0
374 %endif
375
376 %if %{with wayland}
377 %if 0%{?dali_videoplayer_plugin}
378 %postun dali-video-player-plugin
379 /sbin/ldconfig
380 exit 0
381 %endif
382 %endif
383
384 ##############################
385 # Files in Binary Packages
386 ##############################
387
388 %files
389 %manifest dali-adaptor.manifest
390 %defattr(-,root,root,-)
391 %{_libdir}/libdali-adap*.so*
392 %defattr(-,app,app,-)
393 %dir %{user_shader_cache_dir}
394 %{_bindir}/*
395 %{_datadir}/license/%{name}
396
397 %files devel
398 %defattr(-,root,root,-)
399 %{dev_include_path}/dali/dali.h
400 %{dev_include_path}/dali/public-api/*
401 %{dev_include_path}/dali/devel-api/*
402 %{dev_include_path}/dali/doc/*
403 %{_libdir}/pkgconfig/dali-adaptor.pc
404 %{_libdir}/pkgconfig/dali-adaptor-uv.pc
405
406 %files integration-devel
407 %defattr(-,root,root,-)
408 %{dev_include_path}/dali/integration-api/adaptors/*
409 %{_libdir}/pkgconfig/dali-adaptor-integration.pc
410
411 %if 0%{?dali_feedback_plugin}
412 %files dali-feedback-plugin
413 %defattr(-,root,root,-)
414 %{_libdir}/libdali-feedback-plugin.so*
415 %{dali_plugin_sound_files}/*
416 %endif
417
418 %if %{with wayland}
419 %if 0%{?dali_videoplayer_plugin}
420 %files dali-video-player-plugin
421 %manifest dali-adaptor.manifest
422 %defattr(-,root,root,-)
423 %{_libdir}/libdali-video-player-plugin.so*
424 %endif
425 %endif