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