252e49b65d5d67e55e08f72b801d915438992c24
[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.9
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 over_tizen_2_2 1
21 %define shaderbincache_flag DISABLE
22 %endif
23
24 %if "%{profile}" == "tv"
25 %define dali_profile TV
26 %define dali_feedback_plugin 0
27 %define over_tizen_2_2 1
28 %define shaderbincache_flag ENABLE
29 %endif
30
31 %if "%{profile}" == "wearable"
32 %define dali_profile WEARABLE
33 %define dali_feedback_plugin 0
34 %define over_tizen_2_2 1
35 %define shaderbincache_flag DISABLE
36 %endif
37
38 %if "%{profile}" == "common"
39 %define dali_profile COMMON
40 %define dali_feedback_plugin 0
41 %define over_tizen_2_2 0
42 %define shaderbincache_flag DISABLE
43 %endif
44
45 Requires(post): /sbin/ldconfig
46 Requires(postun): /sbin/ldconfig
47 Requires:       giflib
48 BuildRequires:  pkgconfig
49 BuildRequires:  gawk
50 BuildRequires:  pkgconfig(sensor)
51 BuildRequires:  pkgconfig(aul)
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:  pkgconfig(vconf)
61 BuildRequires:  tts-devel
62 BuildRequires:  pkgconfig(dlog)
63 BuildRequires:  libdrm-devel
64 BuildRequires:  pkgconfig(libexif)
65 BuildRequires:  pkgconfig(capi-system-system-settings)
66 BuildRequires:  pkgconfig(libpng)
67 BuildRequires:  pkgconfig(glesv2)
68 BuildRequires:  pkgconfig(egl)
69 BuildRequires:  libcurl-devel
70
71
72 %if 0%{?over_tizen_2_2}
73 BuildRequires:  pkgconfig(capi-system-info)
74 %endif
75
76 %if %{with wayland}
77 BuildRequires:  pkgconfig(ecore-wayland)
78 BuildRequires:  pkgconfig(wayland-egl)
79 BuildRequires:  pkgconfig(wayland-client)
80 %else
81 BuildRequires:  pkgconfig(xext)
82 BuildRequires:  pkgconfig(xi)
83 BuildRequires:  pkgconfig(xfixes)
84 BuildRequires:  pkgconfig(xdamage)
85 BuildRequires:  pkgconfig(utilX)
86 %endif
87
88 BuildRequires:  pkgconfig(harfbuzz)
89 BuildRequires:  fribidi-devel
90
91 %description
92 The DALi Tizen Adaptor provides a Tizen specific implementation of the dali-core
93 platform abstraction and application shell
94
95 ##############################
96 # devel
97 ##############################
98 %package devel
99 Summary:    Development components for the DALi Tizen Adaptor
100 Group:      Development/Building
101 Requires:   %{name} = %{version}-%{release}
102 Requires:   %{name}-integration-devel = %{version}-%{release}
103
104 %description devel
105 Development components for the DALi Tizen Adaptor - public headers and package configs
106
107 ##############################
108 # integration-devel
109 ##############################
110 %package integration-devel
111 Summary:    Integration development package for the Adaptor
112 Group:      Development/Building
113 Requires:   %{name} = %{version}-%{release}
114
115 %description integration-devel
116 Integration development package for the Adaptor - headers for integrating with an adaptor library.
117
118 ##############################
119 # Dali Feedback Plugin
120 ##############################
121 %package dali-feedback-plugin
122 Summary:    Plugin to play haptic and audio feedback for Dali
123 Group:      System/Libraries
124 %if 0%{?dali_feedback_plugin}
125 #Requires:       libdeviced
126 BuildRequires:  pkgconfig(mm-sound)
127 BuildRequires:  pkgconfig(haptic)
128 BuildRequires:  libfeedback-devel
129 %endif
130
131 %description dali-feedback-plugin
132 Feedback plugin to play haptic and audio feedback for Dali
133
134 ##############################
135 # Preparation
136 ##############################
137 %prep
138 %setup -q
139 %define dali_data_rw_dir         /usr/share/dali/
140 %define dali_data_ro_dir         /usr/share/dali/
141 %define user_shader_cache_dir    %{dali_data_ro_dir}/core/shaderbin/
142 %define font_preloaded_path      /usr/share/fonts/
143 %define font_downloaded_path     /opt/share/fonts/
144 %define font_application_path    /usr/share/app_fonts/
145 %define font_configuration_file  /opt/etc/fonts/conf.avail/99-slp.conf
146 %define dali_plugin_sound_files  %{dali_data_ro_dir}/plugins/sounds/
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
175 autoreconf --install
176
177 DALI_DATA_RW_DIR="%{dali_data_rw_dir}" ; export DALI_DATA_RW_DIR
178 DALI_DATA_RO_DIR="%{dali_data_ro_dir}"  ; export DALI_DATA_RO_DIR
179 FONT_PRELOADED_PATH="%{font_preloaded_path}" ; export FONT_PRELOADED_PATH
180 FONT_DOWNLOADED_PATH="%{font_downloaded_path}" ; export FONT_DOWNLOADED_PATH
181 FONT_APPLICATION_PATH="%{font_application_path}"  ; export FONT_APPLICATION_PATH
182 FONT_CONFIGURATION_FILE="%{font_configuration_file}" ; export FONT_CONFIGURATION_FILE
183
184 %configure --prefix=$PREFIX --with-jpeg-turbo --enable-gles=20 --enable-shaderbincache=%{shaderbincache_flag} --enable-profile=%{dali_profile} \
185 %if 0%{?dali_feedback_plugin}
186            --enable-feedback \
187 %endif
188 %if 0%{?over_tizen_2_2}
189            --with-over-tizen_2_2 \
190 %endif
191            $configure_flags --libdir=%{_libdir}
192
193 make %{?jobs:-j%jobs}
194
195 ##############################
196 # Installation
197 ##############################
198 %install
199 rm -rf %{buildroot}
200 cd build/tizen
201 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
202
203 # LICENSE
204 mkdir -p %{buildroot}/usr/share/license
205 cp -af %{_builddir}/%{name}-%{version}/LICENSE %{buildroot}/usr/share/license/%{name}
206
207 ##############################
208 # Upgrade order:
209 # 1 - Pre Install new package
210 # 2 - Install new package
211 # 3 - Post install new package
212 # 4 - Pre uninstall old package
213 # 5 - Remove files not overwritten by new package
214 # 6 - Post uninstall old package
215 ##############################
216
217 %pre
218 exit 0
219
220 ##############################
221 #  Post Install new package
222 ##############################
223 %post
224 /sbin/ldconfig
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 ##############################
234 #   Pre Uninstall old package
235 ##############################
236 %preun
237 exit 0
238
239 ##############################
240 #   Post Uninstall old package
241 ##############################
242 %postun
243 /sbin/ldconfig
244 exit 0
245
246 %if 0%{?dali_feedback_plugin}
247 %postun dali-feedback-plugin
248 /sbin/ldconfig
249 exit 0
250 %endif
251
252 ##############################
253 # Files in Binary Packages
254 ##############################
255
256 %files
257 %manifest dali-adaptor.manifest
258 %defattr(-,root,root,-)
259 %{_libdir}/libdali-adap*.so*
260 %defattr(-,app,app,-)
261 %dir %{user_shader_cache_dir}
262 %{_bindir}/*
263 %{_datadir}/license/%{name}
264
265 %files devel
266 %defattr(-,root,root,-)
267 %{dev_include_path}/dali/dali.h
268 %{dev_include_path}/dali/public-api/*
269 %{dev_include_path}/dali/devel-api/*
270 %{dev_include_path}/dali/doc/*
271 %{_libdir}/pkgconfig/dali.pc
272
273 %files integration-devel
274 %defattr(-,root,root,-)
275 %{dev_include_path}/dali/integration-api/adaptors/*
276 %{_libdir}/pkgconfig/dali-adaptor-integration.pc
277
278 %if 0%{?dali_feedback_plugin}
279 %files dali-feedback-plugin
280 %defattr(-,root,root,-)
281 %{_libdir}/libdali-feedback-plugin.so*
282 %{dali_plugin_sound_files}/*
283 %endif
284