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