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