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