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