Merge "Change to use new AppFW APi for TV profile" 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.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 %define over_tizen_2_2 0
18
19 %else 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 %define over_tizen_2_2 1
25
26 %else 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 %define over_tizen_2_2 0
32
33 %else
34 ## profile == common
35 %define dali_profile COMMON
36 %define dali_feedback_plugin 0
37 %define dali_bullet_plugin 0
38 %define dali_assimp_plugin 0
39 %define over_tizen_2_2 0
40
41 %endif
42
43 Requires(post): /sbin/ldconfig
44 Requires(postun): /sbin/ldconfig
45 Requires:       boost-thread
46 Requires:       giflib
47 BuildRequires:  pkgconfig
48 BuildRequires:  gawk
49 BuildRequires:  pkgconfig(sensor)
50 BuildRequires:  pkgconfig(aul)
51 BuildRequires:  boost-devel
52 BuildRequires:  giflib-devel
53 BuildRequires:  pkgconfig(fontconfig)
54 BuildRequires:  pkgconfig(elementary)
55 BuildRequires:  pkgconfig(capi-appfw-application)
56 BuildRequires:  libjpeg-turbo-devel
57 BuildRequires:  pkgconfig(evas)
58 BuildRequires:  dali-devel
59 BuildRequires:  dali-integration-devel
60 BuildRequires:  libxml2-devel
61 BuildRequires:  vconf-devel
62 BuildRequires:  vconf-keys-devel
63 BuildRequires:  tts-devel
64 BuildRequires:  pkgconfig(dlog)
65 BuildRequires:  libdrm-devel
66 BuildRequires:  pkgconfig(libexif)
67 BuildRequires:  pkgconfig(capi-system-system-settings)
68 BuildRequires:  pkgconfig(libpng)
69 BuildRequires:  pkgconfig(glesv2)
70 BuildRequires:  pkgconfig(egl)
71 BuildRequires:  libcurl-devel
72
73 %if %{with wayland}
74 BuildRequires:  pkgconfig(ecore-wayland)
75 BuildRequires:  pkgconfig(wayland-egl)
76 BuildRequires:  pkgconfig(wayland-client)
77 %else
78 BuildRequires:  pkgconfig(xi)
79 BuildRequires:  pkgconfig(xfixes)
80 BuildRequires:  pkgconfig(xdamage)
81 BuildRequires:  pkgconfig(utilX)
82 %endif
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 %if 0%{?over_tizen_2_2}
169 CFLAGS+=" -DOVER_TIZEN_SDK_2_2"
170 CXXFLAGS+=" -DOVER_TIZEN_SDK_2_2"
171 %endif
172
173 libtoolize --force
174 cd %{_builddir}/%{name}-%{version}/build/tizen && autoreconf --install
175 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}"
176
177 %configure --prefix=$PREFIX --with-jpeg-turbo --enable-gles=20 --enable-profile=%{dali_profile} \
178 %if 0%{?dali_feedback_plugin}
179            --enable-feedback \
180 %endif
181 %if 0%{?dali_bullet_plugin}
182            --enable-bullet \
183 %endif
184 %if 0%{?dali_assimp_plugin}
185            --enable-assimp \
186 %endif
187            $configure_flags --libdir=%{_libdir}
188
189 make %{?jobs:-j%jobs}
190
191 ##############################
192 # Installation
193 ##############################
194 %install
195 rm -rf %{buildroot}
196 cd build/tizen
197 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
198
199 # LICENSE
200 mkdir -p %{buildroot}/usr/share/license
201 cp -af %{_builddir}/%{name}-%{version}/LICENSE %{buildroot}/usr/share/license/%{name}
202
203 ##############################
204 # Upgrade order:
205 # 1 - Pre Install new package
206 # 2 - Install new package
207 # 3 - Post install new package
208 # 4 - Pre uninstall old package
209 # 5 - Remove files not overwritten by new package
210 # 6 - Post uninstall old package
211 ##############################
212
213 %pre
214 rm -f %{user_font_cache_dir}/*
215 rm -f %{user_shader_cache_dir}/*
216 exit 0
217
218 ##############################
219 #  Post Install new package
220 ##############################
221 %post
222 /sbin/ldconfig
223 chown 5000:5000 %{user_font_cache_dir}
224 chown 5000:5000 %{user_shader_cache_dir}
225 exit 0
226
227 %if 0%{?dali_feedback_plugin}
228 %post dali-feedback-plugin
229 /sbin/ldconfig
230 exit 0
231 %endif
232
233 %if 0%{?dali_bullet_plugin}
234 %post dali-bullet-plugin
235 /sbin/ldconfig
236 exit 0
237 %endif
238
239 ##############################
240 #   Pre Uninstall old package
241 ##############################
242 %preun
243 rm -f %{user_font_cache_dir}/*
244 rm -f %{user_shader_cache_dir}/*
245 exit 0
246
247 ##############################
248 #   Post Uninstall old package
249 ##############################
250 %postun
251 /sbin/ldconfig
252 exit 0
253
254 %if 0%{?dali_feedback_plugin}
255 %postun dali-feedback-plugin
256 /sbin/ldconfig
257 exit 0
258 %endif
259
260 %if 0%{?dali_bullet_plugin}
261 %postun dali-bullet-plugin
262 /sbin/ldconfig
263 exit 0
264 %endif
265
266 ##############################
267 # Files in Binary Packages
268 ##############################
269
270 %files
271 %manifest dali-adaptor.manifest
272 %defattr(-,root,root,-)
273 %{_libdir}/libdali-adap*.so*
274 %defattr(-,app,app,-)
275 %dir %{user_font_cache_dir}
276 %dir %{user_shader_cache_dir}
277 %{_bindir}/*
278 %{_datadir}/license/%{name}
279
280 %files devel
281 %defattr(-,root,root,-)
282 %{dev_include_path}/dali/*
283 %{_libdir}/pkgconfig/dali*.pc
284
285 %if 0%{?dali_feedback_plugin}
286 %files dali-feedback-plugin
287 %defattr(-,root,root,-)
288 %{_libdir}/libdali-feedback-plugin.so*
289 %{dali_plugin_sound_files}/*
290 %{dali_plugin_theme_files}/*
291 %endif
292
293 %if 0%{?dali_bullet_plugin}
294 %files dali-bullet-plugin
295 %defattr(-,root,root,-)
296 %{_libdir}/libdali-bullet-plugin.so*
297 %endif