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