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