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