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