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