DALi Version 1.1.15
[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.1.15
6 Release:    1
7 Group:      System/Libraries
8 License:    Apache-2.0, BSD-2.0, MIT
9 URL:        https://review.tizen.org/git/?p=platform/core/uifw/dali-adaptor.git;a=summary
10 Source0:    %{name}-%{version}.tar.gz
11
12 # Get the profile from tizen_profile_name if it exists.
13 %if 0%{?tizen_profile_name:1}
14 %define profile %{tizen_profile_name}
15 %endif
16
17 %if "%{profile}" == "mobile"
18 %define dali_profile MOBILE
19 %define dali_feedback_plugin 0
20 %define shaderbincache_flag DISABLE
21 %endif
22
23 %if "%{profile}" == "tv"
24 %define dali_profile TV
25 %define dali_feedback_plugin 0
26 %define shaderbincache_flag ENABLE
27 %endif
28
29 %if "%{profile}" == "wearable"
30 %define dali_profile WEARABLE
31 %define dali_feedback_plugin 0
32 %define shaderbincache_flag DISABLE
33 %endif
34
35 %if "%{profile}" == "common"
36 %define dali_profile COMMON
37 %define dali_feedback_plugin 0
38 %define tizen_2_2_compatibility 1
39 %define shaderbincache_flag DISABLE
40 %endif
41
42 Requires(post): /sbin/ldconfig
43 Requires(postun): /sbin/ldconfig
44 Requires:       giflib
45 BuildRequires:  pkgconfig
46 BuildRequires:  gawk
47 BuildRequires:  pkgconfig(sensor)
48 BuildRequires:  pkgconfig(aul)
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:  pkgconfig(vconf)
58 BuildRequires:  tts-devel
59 BuildRequires:  pkgconfig(dlog)
60 BuildRequires:  libdrm-devel
61 BuildRequires:  pkgconfig(libexif)
62 BuildRequires:  pkgconfig(capi-system-system-settings)
63 BuildRequires:  pkgconfig(libpng)
64 BuildRequires:  pkgconfig(glesv2)
65 BuildRequires:  pkgconfig(egl)
66 BuildRequires:  libcurl-devel
67
68
69 %if 0%{?tizen_2_2_compatibility} != 1
70 BuildRequires:  pkgconfig(capi-system-info)
71 %endif
72
73 %if %{with wayland}
74 BuildRequires:  pkgconfig(ecore-wayland)
75 BuildRequires:  pkgconfig(wayland-egl)
76 BuildRequires:  pkgconfig(wayland-client)
77 BuildRequires:  wayland-devel
78 # Currently Tizen Common does not use wayland extensions like xdg-shell
79 %if "%{profile}" != "common"
80 BuildRequires:  pkgconfig(wayland-extension-client)
81 BuildRequires:  wayland-extension-client-devel
82 %endif
83 %else
84 BuildRequires:  pkgconfig(xext)
85 BuildRequires:  pkgconfig(xi)
86 BuildRequires:  pkgconfig(xfixes)
87 BuildRequires:  pkgconfig(xdamage)
88 BuildRequires:  pkgconfig(utilX)
89 %endif
90
91 BuildRequires:  pkgconfig(harfbuzz)
92 BuildRequires:  fribidi-devel
93
94 %description
95 The DALi Tizen Adaptor provides a Tizen specific implementation of the dali-core
96 platform abstraction and application shell
97
98 ##############################
99 # devel
100 ##############################
101 %package devel
102 Summary:    Development components for the DALi Tizen Adaptor
103 Group:      Development/Building
104 Requires:   %{name} = %{version}-%{release}
105 Requires:   %{name}-integration-devel = %{version}-%{release}
106
107 %description devel
108 Development components for the DALi Tizen Adaptor - public headers and package configs
109
110 ##############################
111 # integration-devel
112 ##############################
113 %package integration-devel
114 Summary:    Integration development package for the Adaptor
115 Group:      Development/Building
116 Requires:   %{name} = %{version}-%{release}
117
118 %description integration-devel
119 Integration development package for the Adaptor - headers for integrating with an adaptor library.
120
121 ##############################
122 # Dali Feedback Plugin
123 ##############################
124 %package dali-feedback-plugin
125 Summary:    Plugin to play haptic and audio feedback for Dali
126 Group:      System/Libraries
127 %if 0%{?dali_feedback_plugin}
128 #Requires:       libdeviced
129 BuildRequires:  pkgconfig(mm-sound)
130 BuildRequires:  pkgconfig(haptic)
131 BuildRequires:  libfeedback-devel
132 %endif
133
134 %description dali-feedback-plugin
135 Feedback plugin to play haptic and audio feedback for Dali
136
137 ##############################
138 # Preparation
139 ##############################
140 %prep
141 %setup -q
142 %define dali_data_rw_dir         /usr/share/dali/
143 %define dali_data_ro_dir         /usr/share/dali/
144 %define user_shader_cache_dir    %{dali_data_ro_dir}/core/shaderbin/
145 %define font_preloaded_path      /usr/share/fonts/
146 %define font_downloaded_path     /opt/share/fonts/
147 %define font_application_path    /usr/share/app_fonts/
148 %define font_configuration_file  /opt/etc/fonts/conf.avail/99-slp.conf
149 %define dali_plugin_sound_files  %{dali_data_ro_dir}/plugins/sounds/
150
151 %define dev_include_path %{_includedir}
152
153 ##############################
154 # Build
155 ##############################
156 %build
157 PREFIX+="/usr"
158 CXXFLAGS+=" -Wall -g -Os -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections "
159 LDFLAGS+=" -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--gc-sections -Wl,-Bsymbolic-functions "
160
161 %ifarch %{arm}
162 CXXFLAGS+=" -D_ARCH_ARM_ -lgcc"
163 %endif
164
165 %if %{with wayland}
166 CFLAGS+=" -DWAYLAND"
167 CXXFLAGS+=" -DWAYLAND"
168 configure_flags="--enable-wayland"
169 %endif
170
171 %if 0%{?tizen_2_2_compatibility}
172 CFLAGS+=" -DTIZEN_SDK_2_2_COMPATIBILITY"
173 CXXFLAGS+=" -DTIZEN_SDK_2_2_COMPATIBILITY"
174 %endif
175
176 libtoolize --force
177 cd %{_builddir}/%{name}-%{version}/build/tizen
178 autoreconf --install
179
180 DALI_DATA_RW_DIR="%{dali_data_rw_dir}" ; export DALI_DATA_RW_DIR
181 DALI_DATA_RO_DIR="%{dali_data_ro_dir}"  ; export DALI_DATA_RO_DIR
182 FONT_PRELOADED_PATH="%{font_preloaded_path}" ; export FONT_PRELOADED_PATH
183 FONT_DOWNLOADED_PATH="%{font_downloaded_path}" ; export FONT_DOWNLOADED_PATH
184 FONT_APPLICATION_PATH="%{font_application_path}"  ; export FONT_APPLICATION_PATH
185 FONT_CONFIGURATION_FILE="%{font_configuration_file}" ; export FONT_CONFIGURATION_FILE
186
187 %configure --prefix=$PREFIX --with-jpeg-turbo --enable-gles=20 --enable-shaderbincache=%{shaderbincache_flag} --enable-profile=%{dali_profile} \
188 %if 0%{?dali_feedback_plugin}
189            --enable-feedback \
190 %endif
191 %if 0%{?tizen_2_2_compatibility}
192            --with-tizen-2-2-compatibility \
193 %endif
194            $configure_flags --libdir=%{_libdir}
195
196 make %{?jobs:-j%jobs}
197
198 ##############################
199 # Installation
200 ##############################
201 %install
202 rm -rf %{buildroot}
203 cd build/tizen
204 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
205
206 # LICENSE
207 mkdir -p %{buildroot}/usr/share/license
208 cp -af %{_builddir}/%{name}-%{version}/LICENSE %{buildroot}/usr/share/license/%{name}
209
210 ##############################
211 # Upgrade order:
212 # 1 - Pre Install new package
213 # 2 - Install new package
214 # 3 - Post install new package
215 # 4 - Pre uninstall old package
216 # 5 - Remove files not overwritten by new package
217 # 6 - Post uninstall old package
218 ##############################
219
220 %pre
221 exit 0
222
223 ##############################
224 #  Post Install new package
225 ##############################
226 %post
227 /sbin/ldconfig
228 exit 0
229
230 %if 0%{?dali_feedback_plugin}
231 %post dali-feedback-plugin
232 /sbin/ldconfig
233 exit 0
234 %endif
235
236 ##############################
237 #   Pre Uninstall old package
238 ##############################
239 %preun
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 ##############################
256 # Files in Binary Packages
257 ##############################
258
259 %files
260 %manifest dali-adaptor.manifest
261 %defattr(-,root,root,-)
262 %{_libdir}/libdali-adap*.so*
263 %defattr(-,app,app,-)
264 %dir %{user_shader_cache_dir}
265 %{_bindir}/*
266 %{_datadir}/license/%{name}
267
268 %files devel
269 %defattr(-,root,root,-)
270 %{dev_include_path}/dali/dali.h
271 %{dev_include_path}/dali/public-api/*
272 %{dev_include_path}/dali/devel-api/*
273 %{dev_include_path}/dali/doc/*
274 %{_libdir}/pkgconfig/dali.pc
275
276 %files integration-devel
277 %defattr(-,root,root,-)
278 %{dev_include_path}/dali/integration-api/adaptors/*
279 %{_libdir}/pkgconfig/dali-adaptor-integration.pc
280
281 %if 0%{?dali_feedback_plugin}
282 %files dali-feedback-plugin
283 %defattr(-,root,root,-)
284 %{_libdir}/libdali-feedback-plugin.so*
285 %{dali_plugin_sound_files}/*
286 %endif
287