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