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