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