Enable Freetype Bitmap (Emoji) support from configure.ac
[platform/core/uifw/dali-adaptor.git] / packaging / dali-adaptor.spec
1 %bcond_with wayland
2
3 Name:       dali-adaptor
4 Summary:    The DALi Tizen Adaptor
5 Version:    1.0.37
6 Release:    1
7 Group:      System/Libraries
8 License:    Apache-2.0
9 URL:        https://review.tizen.org/git/?p=platform/core/uifw/dali-adaptor.git;a=summary
10 Source0:    %{name}-%{version}.tar.gz
11
12 %if "%{profile}" == "mobile"
13 %define dali_profile MOBILE
14 %define dali_feedback_plugin 0
15 %define dali_bullet_plugin 0
16 %define dali_assimp_plugin 0
17 %define over_tizen_2_2 0
18 %define shaderbincache_flag DISABLE
19 %endif
20
21 %if "%{profile}" == "tv"
22 %define dali_profile TV
23 %define dali_feedback_plugin 0
24 %define dali_bullet_plugin 0
25 %define dali_assimp_plugin 0
26 %define over_tizen_2_2 1
27 %define shaderbincache_flag ENABLE
28 %endif
29
30 %if "%{profile}" == "wearable"
31 %define dali_profile WEARABLE
32 %define dali_feedback_plugin 0
33 %define dali_bullet_plugin 0
34 %define dali_assimp_plugin 0
35 %define over_tizen_2_2 0
36 %define shaderbincache_flag DISABLE
37 %endif
38
39 %if "%{profile}" == "common"
40 %define dali_profile COMMON
41 %define dali_feedback_plugin 0
42 %define dali_bullet_plugin 0
43 %define dali_assimp_plugin 0
44 %define over_tizen_2_2 0
45
46 %define shaderbincache_flag DISABLE
47 %endif
48
49 Requires(post): /sbin/ldconfig
50 Requires(postun): /sbin/ldconfig
51 Requires:       boost-thread
52 Requires:       giflib
53 BuildRequires:  pkgconfig
54 BuildRequires:  gawk
55 BuildRequires:  pkgconfig(sensor)
56 BuildRequires:  pkgconfig(aul)
57 BuildRequires:  boost-devel
58 BuildRequires:  giflib-devel
59 BuildRequires:  pkgconfig(fontconfig)
60 BuildRequires:  pkgconfig(elementary)
61 BuildRequires:  pkgconfig(capi-appfw-application)
62 BuildRequires:  libjpeg-turbo-devel
63 BuildRequires:  pkgconfig(evas)
64 BuildRequires:  dali-devel
65 BuildRequires:  dali-integration-devel
66 BuildRequires:  libxml2-devel
67 BuildRequires:  vconf-devel
68 BuildRequires:  vconf-keys-devel
69 BuildRequires:  tts-devel
70 BuildRequires:  pkgconfig(dlog)
71 BuildRequires:  libdrm-devel
72 BuildRequires:  pkgconfig(libexif)
73 BuildRequires:  pkgconfig(capi-system-system-settings)
74 BuildRequires:  pkgconfig(libpng)
75 BuildRequires:  pkgconfig(glesv2)
76 BuildRequires:  pkgconfig(egl)
77 BuildRequires:  libcurl-devel
78
79
80 %if 0%{?over_tizen_2_2}
81 BuildRequires:  pkgconfig(capi-system-info)
82 %endif
83
84 %if %{with wayland}
85 BuildRequires:  pkgconfig(ecore-wayland)
86 BuildRequires:  pkgconfig(wayland-egl)
87 BuildRequires:  pkgconfig(wayland-client)
88 %else
89 BuildRequires:  pkgconfig(xi)
90 BuildRequires:  pkgconfig(xfixes)
91 BuildRequires:  pkgconfig(xdamage)
92 BuildRequires:  pkgconfig(utilX)
93 %endif
94
95 BuildRequires:  pkgconfig(harfbuzz)
96 BuildRequires:  fribidi-devel
97
98 %if 0%{?dali_assimp_plugin}
99 BuildRequires:  pkgconfig(assimp)
100 %endif
101
102 %description
103 The DALi Tizen Adaptor provides a Tizen specific implementation of the dali-core
104 platform abstraction and application shell
105
106 ##############################
107 # devel
108 ##############################
109 %package devel
110 Summary:    Development components for the DALi Tizen Adaptor
111 Group:      Development/Building
112 Requires:   %{name} = %{version}-%{release}
113 Requires:   %{name}-integration-devel = %{version}-%{release}
114
115 %description devel
116 Development components for the DALi Tizen Adaptor - public headers and package configs
117
118 ##############################
119 # integration-devel
120 ##############################
121 %package integration-devel
122 Summary:    Integration development package for the Adaptor
123 Group:      Development/Building
124 Requires:   %{name} = %{version}-%{release}
125
126 %description integration-devel
127 Integration development package for the Adaptor - headers for integrating with an adaptor library.
128
129 ##############################
130 # Dali Feedback Plugin
131 ##############################
132 %package dali-feedback-plugin
133 Summary:    Plugin to play haptic and audio feedback for Dali
134 Group:      System/Libraries
135 %if 0%{?dali_feedback_plugin}
136 #Requires:       libdeviced
137 BuildRequires:  pkgconfig(mm-sound)
138 BuildRequires:  pkgconfig(haptic)
139 BuildRequires:  libfeedback-devel
140 %endif
141
142 %description dali-feedback-plugin
143 Feedback plugin to play haptic and audio feedback for Dali
144
145 ##############################
146 # Dali Dynamics/Bullet Plugin
147 ##############################
148 %package dali-bullet-plugin
149 Summary:    Plugin to provide physics
150 Group:      System/Libraries
151 %if 0%{?dali_bullet_plugin}
152 BuildRequires:  pkgconfig(bullet)
153 %endif
154
155 %description dali-bullet-plugin
156 Dynamics plugin to wrap the libBulletDynamics libraries
157
158 ##############################
159 # Preparation
160 ##############################
161 %prep
162 %setup -q
163 %define dali_data_rw_dir         /usr/share/dali/
164 %define dali_data_ro_dir         /usr/share/dali/
165 %define user_font_cache_dir      %{dali_data_rw_dir}/glyphcache/
166 %define user_shader_cache_dir    %{dali_data_ro_dir}/core/shaderbin/
167 %define font_preloaded_path      /usr/share/fonts/
168 %define font_downloaded_path     /opt/share/fonts/
169 %define font_application_path    /usr/share/app_fonts/
170 %define font_configuration_file  /opt/etc/fonts/conf.avail/99-slp.conf
171 %define dali_plugin_sound_files  %{dali_data_ro_dir}/plugins/sounds/
172 %define dali_plugin_theme_files  %{dali_data_ro_dir}/themes/feedback-themes/
173
174 %define dev_include_path %{_includedir}
175
176 ##############################
177 # Build
178 ##############################
179 %build
180 PREFIX+="/usr"
181 CXXFLAGS+=" -Wall -g -Os -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections "
182 LDFLAGS+=" -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--gc-sections -Wl,-Bsymbolic-functions "
183
184 %ifarch %{arm}
185 CXXFLAGS+=" -D_ARCH_ARM_ -lgcc"
186 %endif
187
188 %if %{with wayland}
189 CFLAGS+=" -DWAYLAND"
190 CXXFLAGS+=" -DWAYLAND"
191 configure_flags="--enable-wayland"
192 %endif
193
194 %if 0%{?over_tizen_2_2}
195 CFLAGS+=" -DOVER_TIZEN_SDK_2_2"
196 CXXFLAGS+=" -DOVER_TIZEN_SDK_2_2"
197 %endif
198
199 libtoolize --force
200 cd %{_builddir}/%{name}-%{version}/build/tizen && autoreconf --install
201 cd %{_builddir}/%{name}-%{version}/build/tizen && CXXFLAGS=$CXXFLAGS LDFLAGS=$LDFLAGS DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}" FONT_PRELOADED_PATH="%{font_preloaded_path}" FONT_DOWNLOADED_PATH="%{font_downloaded_path}" FONT_APPLICATION_PATH="%{font_application_path}" FONT_CONFIGURATION_FILE="%{font_configuration_file}"
202
203 %configure --prefix=$PREFIX --with-jpeg-turbo --enable-gles=20 --enable-shaderbincache=%{shaderbincache_flag} --enable-profile=%{dali_profile} \
204 %if 0%{?dali_feedback_plugin}
205            --enable-feedback \
206 %endif
207 %if 0%{?dali_bullet_plugin}
208            --enable-bullet \
209 %endif
210 %if 0%{?dali_assimp_plugin}
211            --enable-assimp \
212 %endif
213 %if 0%{?over_tizen_2_2}
214            --with-over-tizen_2_2 \
215 %endif
216            $configure_flags --libdir=%{_libdir}
217
218 make %{?jobs:-j%jobs}
219
220 ##############################
221 # Installation
222 ##############################
223 %install
224 rm -rf %{buildroot}
225 cd build/tizen
226 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
227
228 # LICENSE
229 mkdir -p %{buildroot}/usr/share/license
230 cp -af %{_builddir}/%{name}-%{version}/LICENSE %{buildroot}/usr/share/license/%{name}
231
232 ##############################
233 # Upgrade order:
234 # 1 - Pre Install new package
235 # 2 - Install new package
236 # 3 - Post install new package
237 # 4 - Pre uninstall old package
238 # 5 - Remove files not overwritten by new package
239 # 6 - Post uninstall old package
240 ##############################
241
242 %pre
243 rm -f %{user_font_cache_dir}/*
244 exit 0
245
246 ##############################
247 #  Post Install new package
248 ##############################
249 %post
250 /sbin/ldconfig
251 chown 5000:5000 %{user_font_cache_dir}
252 exit 0
253
254 %if 0%{?dali_feedback_plugin}
255 %post dali-feedback-plugin
256 /sbin/ldconfig
257 exit 0
258 %endif
259
260 %if 0%{?dali_bullet_plugin}
261 %post dali-bullet-plugin
262 /sbin/ldconfig
263 exit 0
264 %endif
265
266 ##############################
267 #   Pre Uninstall old package
268 ##############################
269 %preun
270 rm -f %{user_font_cache_dir}/*
271 exit 0
272
273 ##############################
274 #   Post Uninstall old package
275 ##############################
276 %postun
277 /sbin/ldconfig
278 exit 0
279
280 %if 0%{?dali_feedback_plugin}
281 %postun dali-feedback-plugin
282 /sbin/ldconfig
283 exit 0
284 %endif
285
286 %if 0%{?dali_bullet_plugin}
287 %postun dali-bullet-plugin
288 /sbin/ldconfig
289 exit 0
290 %endif
291
292 ##############################
293 # Files in Binary Packages
294 ##############################
295
296 %files
297 %manifest dali-adaptor.manifest
298 %defattr(-,root,root,-)
299 %{_libdir}/libdali-adap*.so*
300 %defattr(-,app,app,-)
301 %dir %{user_font_cache_dir}
302 %dir %{user_shader_cache_dir}
303 %{_bindir}/*
304 %{_datadir}/license/%{name}
305
306 %files devel
307 %defattr(-,root,root,-)
308 %{dev_include_path}/dali/dali.h
309 %{dev_include_path}/dali/public-api/*
310 %{_libdir}/pkgconfig/dali.pc
311
312 %files integration-devel
313 %defattr(-,root,root,-)
314 %{dev_include_path}/dali/integration-api/adaptors/*
315 %{_libdir}/pkgconfig/dali-adaptor-integration.pc
316
317 %if 0%{?dali_feedback_plugin}
318 %files dali-feedback-plugin
319 %defattr(-,root,root,-)
320 %{_libdir}/libdali-feedback-plugin.so*
321 %{dali_plugin_sound_files}/*
322 %{dali_plugin_theme_files}/*
323 %endif
324
325 %if 0%{?dali_bullet_plugin}
326 %files dali-bullet-plugin
327 %defattr(-,root,root,-)
328 %{_libdir}/libdali-bullet-plugin.so*
329 %endif