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