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