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