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