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