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