46791a1bac30e30d32b6be9f41607e7cab890fa4
[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.11
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 %else
78 BuildRequires:  pkgconfig(xext)
79 BuildRequires:  pkgconfig(xi)
80 BuildRequires:  pkgconfig(xfixes)
81 BuildRequires:  pkgconfig(xdamage)
82 BuildRequires:  pkgconfig(utilX)
83 %endif
84
85 BuildRequires:  pkgconfig(harfbuzz)
86 BuildRequires:  fribidi-devel
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 Requires:   %{name}-integration-devel = %{version}-%{release}
100
101 %description devel
102 Development components for the DALi Tizen Adaptor - public headers and package configs
103
104 ##############################
105 # integration-devel
106 ##############################
107 %package integration-devel
108 Summary:    Integration development package for the Adaptor
109 Group:      Development/Building
110 Requires:   %{name} = %{version}-%{release}
111
112 %description integration-devel
113 Integration development package for the Adaptor - headers for integrating with an adaptor library.
114
115 ##############################
116 # Dali Feedback Plugin
117 ##############################
118 %package dali-feedback-plugin
119 Summary:    Plugin to play haptic and audio feedback for Dali
120 Group:      System/Libraries
121 %if 0%{?dali_feedback_plugin}
122 #Requires:       libdeviced
123 BuildRequires:  pkgconfig(mm-sound)
124 BuildRequires:  pkgconfig(haptic)
125 BuildRequires:  libfeedback-devel
126 %endif
127
128 %description dali-feedback-plugin
129 Feedback plugin to play haptic and audio feedback for Dali
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_shader_cache_dir    %{dali_data_ro_dir}/core/shaderbin/
139 %define font_preloaded_path      /usr/share/fonts/
140 %define font_downloaded_path     /opt/share/fonts/
141 %define font_application_path    /usr/share/app_fonts/
142 %define font_configuration_file  /opt/etc/fonts/conf.avail/99-slp.conf
143 %define dali_plugin_sound_files  %{dali_data_ro_dir}/plugins/sounds/
144
145 %define dev_include_path %{_includedir}
146
147 ##############################
148 # Build
149 ##############################
150 %build
151 PREFIX+="/usr"
152 CXXFLAGS+=" -Wall -g -Os -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections "
153 LDFLAGS+=" -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--gc-sections -Wl,-Bsymbolic-functions "
154
155 %ifarch %{arm}
156 CXXFLAGS+=" -D_ARCH_ARM_ -lgcc"
157 %endif
158
159 %if %{with wayland}
160 CFLAGS+=" -DWAYLAND"
161 CXXFLAGS+=" -DWAYLAND"
162 configure_flags="--enable-wayland"
163 %endif
164
165 %if 0%{?tizen_2_2_compatibility}
166 CFLAGS+=" -DTIZEN_SDK_2_2_COMPATIBILITY"
167 CXXFLAGS+=" -DTIZEN_SDK_2_2_COMPATIBILITY"
168 %endif
169
170 libtoolize --force
171 cd %{_builddir}/%{name}-%{version}/build/tizen
172 autoreconf --install
173
174 DALI_DATA_RW_DIR="%{dali_data_rw_dir}" ; export DALI_DATA_RW_DIR
175 DALI_DATA_RO_DIR="%{dali_data_ro_dir}"  ; export DALI_DATA_RO_DIR
176 FONT_PRELOADED_PATH="%{font_preloaded_path}" ; export FONT_PRELOADED_PATH
177 FONT_DOWNLOADED_PATH="%{font_downloaded_path}" ; export FONT_DOWNLOADED_PATH
178 FONT_APPLICATION_PATH="%{font_application_path}"  ; export FONT_APPLICATION_PATH
179 FONT_CONFIGURATION_FILE="%{font_configuration_file}" ; export FONT_CONFIGURATION_FILE
180
181 %configure --prefix=$PREFIX --with-jpeg-turbo --enable-gles=20 --enable-shaderbincache=%{shaderbincache_flag} --enable-profile=%{dali_profile} \
182 %if 0%{?dali_feedback_plugin}
183            --enable-feedback \
184 %endif
185 %if 0%{?tizen_2_2_compatibility}
186            --with-tizen-2-2-compatibility \
187 %endif
188            $configure_flags --libdir=%{_libdir}
189
190 make %{?jobs:-j%jobs}
191
192 ##############################
193 # Installation
194 ##############################
195 %install
196 rm -rf %{buildroot}
197 cd build/tizen
198 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
199
200 # LICENSE
201 mkdir -p %{buildroot}/usr/share/license
202 cp -af %{_builddir}/%{name}-%{version}/LICENSE %{buildroot}/usr/share/license/%{name}
203
204 ##############################
205 # Upgrade order:
206 # 1 - Pre Install new package
207 # 2 - Install new package
208 # 3 - Post install new package
209 # 4 - Pre uninstall old package
210 # 5 - Remove files not overwritten by new package
211 # 6 - Post uninstall old package
212 ##############################
213
214 %pre
215 exit 0
216
217 ##############################
218 #  Post Install new package
219 ##############################
220 %post
221 /sbin/ldconfig
222 exit 0
223
224 %if 0%{?dali_feedback_plugin}
225 %post dali-feedback-plugin
226 /sbin/ldconfig
227 exit 0
228 %endif
229
230 ##############################
231 #   Pre Uninstall old package
232 ##############################
233 %preun
234 exit 0
235
236 ##############################
237 #   Post Uninstall old package
238 ##############################
239 %postun
240 /sbin/ldconfig
241 exit 0
242
243 %if 0%{?dali_feedback_plugin}
244 %postun dali-feedback-plugin
245 /sbin/ldconfig
246 exit 0
247 %endif
248
249 ##############################
250 # Files in Binary Packages
251 ##############################
252
253 %files
254 %manifest dali-adaptor.manifest
255 %defattr(-,root,root,-)
256 %{_libdir}/libdali-adap*.so*
257 %defattr(-,app,app,-)
258 %dir %{user_shader_cache_dir}
259 %{_bindir}/*
260 %{_datadir}/license/%{name}
261
262 %files devel
263 %defattr(-,root,root,-)
264 %{dev_include_path}/dali/dali.h
265 %{dev_include_path}/dali/public-api/*
266 %{dev_include_path}/dali/devel-api/*
267 %{dev_include_path}/dali/doc/*
268 %{_libdir}/pkgconfig/dali.pc
269
270 %files integration-devel
271 %defattr(-,root,root,-)
272 %{dev_include_path}/dali/integration-api/adaptors/*
273 %{_libdir}/pkgconfig/dali-adaptor-integration.pc
274
275 %if 0%{?dali_feedback_plugin}
276 %files dali-feedback-plugin
277 %defattr(-,root,root,-)
278 %{_libdir}/libdali-feedback-plugin.so*
279 %{dali_plugin_sound_files}/*
280 %endif
281