DALi Version 1.1.18
[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.18
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 # tpkp-curl (certificate pinning for libcurl functions) is only available in Tizen 3.0
116 BuildRequires:  pkgconfig(tpkp-curl)
117
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 # for dali-adaptor
129 BuildRequires:  pkgconfig(evas)
130 BuildRequires:  pkgconfig(elementary)
131 BuildRequires:  pkgconfig(capi-appfw-application)
132 BuildRequires:  pkgconfig(capi-system-system-settings)
133
134 %if 0%{?over_tizen_2_2}
135 BuildRequires:  pkgconfig(capi-system-info)
136 %endif
137
138
139
140 %description
141 The DALi Tizen Adaptor provides a Tizen specific implementation of the dali-core
142 platform abstraction and application shell
143
144 ##############################
145 # devel
146 ##############################
147 %package devel
148 Summary:    Development components for the DALi Tizen Adaptor
149 Group:      Development/Building
150 Requires:   %{name} = %{version}-%{release}
151 Requires:   %{name}-integration-devel = %{version}-%{release}
152
153 %description devel
154 Development components for the DALi Tizen Adaptor - public headers and package configs
155
156 ##############################
157 # integration-devel
158 ##############################
159 %package integration-devel
160 Summary:    Integration development package for the Adaptor
161 Group:      Development/Building
162 Requires:   %{name} = %{version}-%{release}
163
164 %description integration-devel
165 Integration development package for the Adaptor - headers for integrating with an adaptor library.
166
167 ##############################
168 # Dali Feedback Plugin
169 ##############################
170 %package dali-feedback-plugin
171 Summary:    Plugin to play haptic and audio feedback for Dali
172 Group:      System/Libraries
173 %if 0%{?dali_feedback_plugin}
174 #Requires:       libdeviced
175 BuildRequires:  pkgconfig(mm-sound)
176 BuildRequires:  pkgconfig(haptic)
177 BuildRequires:  libfeedback-devel
178 %endif
179
180 %description dali-feedback-plugin
181 Feedback plugin to play haptic and audio feedback for Dali
182
183 ##############################
184 # Preparation
185 ##############################
186 %prep
187 %setup -q
188 %define dali_data_rw_dir         /usr/share/dali/
189 %define dali_data_ro_dir         /usr/share/dali/
190 %define user_shader_cache_dir    %{dali_data_ro_dir}/core/shaderbin/
191 %define font_preloaded_path      /usr/share/fonts/
192 %define font_downloaded_path     /opt/share/fonts/
193 %define font_application_path    /usr/share/app_fonts/
194 %define font_configuration_file  /opt/etc/fonts/conf.avail/99-slp.conf
195 %define dali_plugin_sound_files  %{dali_data_ro_dir}/plugins/sounds/
196
197 %define dev_include_path %{_includedir}
198
199 ##############################
200 # Build
201 ##############################
202 %build
203 PREFIX+="/usr"
204 CXXFLAGS+=" -Wall -g -Os -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections "
205 LDFLAGS+=" -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--gc-sections -Wl,-Bsymbolic-functions "
206
207 %ifarch %{arm}
208 CXXFLAGS+=" -D_ARCH_ARM_ -lgcc"
209 %endif
210
211 %if %{with wayland}
212 CFLAGS+=" -DWAYLAND"
213 CXXFLAGS+=" -DWAYLAND"
214 configure_flags="--enable-wayland"
215 %endif
216
217 %if 0%{?tizen_2_2_compatibility}
218 CFLAGS+=" -DTIZEN_SDK_2_2_COMPATIBILITY"
219 CXXFLAGS+=" -DTIZEN_SDK_2_2_COMPATIBILITY"
220 %endif
221
222 libtoolize --force
223 cd %{_builddir}/%{name}-%{version}/build/tizen
224 autoreconf --install
225
226 DALI_DATA_RW_DIR="%{dali_data_rw_dir}" ; export DALI_DATA_RW_DIR
227 DALI_DATA_RO_DIR="%{dali_data_ro_dir}"  ; export DALI_DATA_RO_DIR
228 FONT_PRELOADED_PATH="%{font_preloaded_path}" ; export FONT_PRELOADED_PATH
229 FONT_DOWNLOADED_PATH="%{font_downloaded_path}" ; export FONT_DOWNLOADED_PATH
230 FONT_APPLICATION_PATH="%{font_application_path}"  ; export FONT_APPLICATION_PATH
231 FONT_CONFIGURATION_FILE="%{font_configuration_file}" ; export FONT_CONFIGURATION_FILE
232
233 # Default to GLES 2.0 if not specified.
234 %{!?target_gles_version: %define target_gles_version 20}
235
236 #--enable-efl=no \ # only affects dali-adaptor-uv
237 #--enable-appfw=yes \ # affects both dali-adaptor & dali-adaptor-uv
238 #--with-libuv=/usr/include/node/ \ # only affects dali-adaptor-uv
239
240 # Set up the build via configure.
241 %configure --prefix=$PREFIX --with-jpeg-turbo --enable-gles=%{target_gles_version} --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 %{with wayland}
249            --enable-efl=no \
250 %else
251            --enable-efl=yes \
252 %endif
253            --enable-appfw=yes \
254            --with-libuv=/usr/include/node/ \
255            $configure_flags --libdir=%{_libdir}
256
257 # Build.
258 make %{?jobs:-j%jobs}
259
260 ##############################
261 # Installation
262 ##############################
263 %install
264 rm -rf %{buildroot}
265 cd build/tizen
266 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
267
268 # LICENSE
269 mkdir -p %{buildroot}/usr/share/license
270 cp -af %{_builddir}/%{name}-%{version}/LICENSE %{buildroot}/usr/share/license/%{name}
271
272 ##############################
273 # Upgrade order:
274 # 1 - Pre Install new package
275 # 2 - Install new package
276 # 3 - Post install new package
277 # 4 - Pre uninstall old package
278 # 5 - Remove files not overwritten by new package
279 # 6 - Post uninstall old package
280 ##############################
281
282 %pre
283 exit 0
284
285 ##############################
286 #  Post Install new package
287 ##############################
288 %post
289 /sbin/ldconfig
290 exit 0
291
292 %if 0%{?dali_feedback_plugin}
293 %post dali-feedback-plugin
294 /sbin/ldconfig
295 exit 0
296 %endif
297
298 ##############################
299 #   Pre Uninstall old package
300 ##############################
301 %preun
302 exit 0
303
304 ##############################
305 #   Post Uninstall old package
306 ##############################
307 %postun
308 /sbin/ldconfig
309 exit 0
310
311 %if 0%{?dali_feedback_plugin}
312 %postun dali-feedback-plugin
313 /sbin/ldconfig
314 exit 0
315 %endif
316
317 ##############################
318 # Files in Binary Packages
319 ##############################
320
321 %files
322 %manifest dali-adaptor.manifest
323 %defattr(-,root,root,-)
324 %{_libdir}/libdali-adap*.so*
325 %defattr(-,app,app,-)
326 %dir %{user_shader_cache_dir}
327 %{_bindir}/*
328 %{_datadir}/license/%{name}
329
330 %files devel
331 %defattr(-,root,root,-)
332 %{dev_include_path}/dali/dali.h
333 %{dev_include_path}/dali/public-api/*
334 %{dev_include_path}/dali/devel-api/*
335 %{dev_include_path}/dali/doc/*
336 %{_libdir}/pkgconfig/dali-adaptor.pc
337 %{_libdir}/pkgconfig/dali-adaptor-uv.pc
338
339 %files integration-devel
340 %defattr(-,root,root,-)
341 %{dev_include_path}/dali/integration-api/adaptors/*
342 %{_libdir}/pkgconfig/dali-adaptor-integration.pc
343
344 %if 0%{?dali_feedback_plugin}
345 %files dali-feedback-plugin
346 %defattr(-,root,root,-)
347 %{_libdir}/libdali-feedback-plugin.so*
348 %{dali_plugin_sound_files}/*
349 %endif
350