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