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