DALi Version 1.1.6
[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.6
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 %if "%{profile}" == "mobile"
13 %define dali_profile MOBILE
14 %define dali_feedback_plugin 0
15 %define over_tizen_2_2 1
16 %define shaderbincache_flag DISABLE
17 %endif
18
19 %if "%{profile}" == "tv"
20 %define dali_profile TV
21 %define dali_feedback_plugin 0
22 %define over_tizen_2_2 1
23 %define shaderbincache_flag ENABLE
24 %endif
25
26 %if "%{profile}" == "wearable"
27 %define dali_profile WEARABLE
28 %define dali_feedback_plugin 0
29 %define over_tizen_2_2 1
30 %define shaderbincache_flag DISABLE
31 %endif
32
33 %if "%{profile}" == "common"
34 %define dali_profile COMMON
35 %define dali_feedback_plugin 0
36 %define over_tizen_2_2 0
37 %define shaderbincache_flag DISABLE
38 %endif
39
40 Requires(post): /sbin/ldconfig
41 Requires(postun): /sbin/ldconfig
42 Requires:       giflib
43 BuildRequires:  pkgconfig
44 BuildRequires:  gawk
45 BuildRequires:  pkgconfig(sensor)
46 BuildRequires:  pkgconfig(aul)
47 BuildRequires:  giflib-devel
48 BuildRequires:  pkgconfig(fontconfig)
49 BuildRequires:  pkgconfig(elementary)
50 BuildRequires:  pkgconfig(capi-appfw-application)
51 BuildRequires:  libjpeg-turbo-devel
52 BuildRequires:  pkgconfig(evas)
53 BuildRequires:  dali-devel
54 BuildRequires:  dali-integration-devel
55 BuildRequires:  vconf-devel
56 BuildRequires:  vconf-keys-devel
57 BuildRequires:  tts-devel
58 BuildRequires:  pkgconfig(dlog)
59 BuildRequires:  libdrm-devel
60 BuildRequires:  pkgconfig(libexif)
61 BuildRequires:  pkgconfig(capi-system-system-settings)
62 BuildRequires:  pkgconfig(libpng)
63 BuildRequires:  pkgconfig(glesv2)
64 BuildRequires:  pkgconfig(egl)
65 BuildRequires:  libcurl-devel
66
67
68 %if 0%{?over_tizen_2_2}
69 BuildRequires:  pkgconfig(capi-system-info)
70 %endif
71
72 %if %{with wayland}
73 BuildRequires:  pkgconfig(ecore-wayland)
74 BuildRequires:  pkgconfig(wayland-egl)
75 BuildRequires:  pkgconfig(wayland-client)
76 %else
77 BuildRequires:  pkgconfig(xext)
78 BuildRequires:  pkgconfig(xi)
79 BuildRequires:  pkgconfig(xfixes)
80 BuildRequires:  pkgconfig(xdamage)
81 BuildRequires:  pkgconfig(utilX)
82 %endif
83
84 BuildRequires:  pkgconfig(harfbuzz)
85 BuildRequires:  fribidi-devel
86
87 %description
88 The DALi Tizen Adaptor provides a Tizen specific implementation of the dali-core
89 platform abstraction and application shell
90
91 ##############################
92 # devel
93 ##############################
94 %package devel
95 Summary:    Development components for the DALi Tizen Adaptor
96 Group:      Development/Building
97 Requires:   %{name} = %{version}-%{release}
98 Requires:   %{name}-integration-devel = %{version}-%{release}
99
100 %description devel
101 Development components for the DALi Tizen Adaptor - public headers and package configs
102
103 ##############################
104 # integration-devel
105 ##############################
106 %package integration-devel
107 Summary:    Integration development package for the Adaptor
108 Group:      Development/Building
109 Requires:   %{name} = %{version}-%{release}
110
111 %description integration-devel
112 Integration development package for the Adaptor - headers for integrating with an adaptor library.
113
114 ##############################
115 # Dali Feedback Plugin
116 ##############################
117 %package dali-feedback-plugin
118 Summary:    Plugin to play haptic and audio feedback for Dali
119 Group:      System/Libraries
120 %if 0%{?dali_feedback_plugin}
121 #Requires:       libdeviced
122 BuildRequires:  pkgconfig(mm-sound)
123 BuildRequires:  pkgconfig(haptic)
124 BuildRequires:  libfeedback-devel
125 %endif
126
127 %description dali-feedback-plugin
128 Feedback plugin to play haptic and audio feedback for Dali
129
130 ##############################
131 # Preparation
132 ##############################
133 %prep
134 %setup -q
135 %define dali_data_rw_dir         /usr/share/dali/
136 %define dali_data_ro_dir         /usr/share/dali/
137 %define user_shader_cache_dir    %{dali_data_ro_dir}/core/shaderbin/
138 %define font_preloaded_path      /usr/share/fonts/
139 %define font_downloaded_path     /opt/share/fonts/
140 %define font_application_path    /usr/share/app_fonts/
141 %define font_configuration_file  /opt/etc/fonts/conf.avail/99-slp.conf
142 %define dali_plugin_sound_files  %{dali_data_ro_dir}/plugins/sounds/
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 -Wl,-Bsymbolic-functions "
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 %if 0%{?over_tizen_2_2}
165 CFLAGS+=" -DOVER_TIZEN_SDK_2_2"
166 CXXFLAGS+=" -DOVER_TIZEN_SDK_2_2"
167 %endif
168
169 libtoolize --force
170 cd %{_builddir}/%{name}-%{version}/build/tizen
171 autoreconf --install
172
173 DALI_DATA_RW_DIR="%{dali_data_rw_dir}" ; export DALI_DATA_RW_DIR
174 DALI_DATA_RO_DIR="%{dali_data_ro_dir}"  ; export DALI_DATA_RO_DIR
175 FONT_PRELOADED_PATH="%{font_preloaded_path}" ; export FONT_PRELOADED_PATH
176 FONT_DOWNLOADED_PATH="%{font_downloaded_path}" ; export FONT_DOWNLOADED_PATH
177 FONT_APPLICATION_PATH="%{font_application_path}"  ; export FONT_APPLICATION_PATH
178 FONT_CONFIGURATION_FILE="%{font_configuration_file}" ; export FONT_CONFIGURATION_FILE
179
180 %configure --prefix=$PREFIX --with-jpeg-turbo --enable-gles=20 --enable-shaderbincache=%{shaderbincache_flag} --enable-profile=%{dali_profile} \
181 %if 0%{?dali_feedback_plugin}
182            --enable-feedback \
183 %endif
184 %if 0%{?over_tizen_2_2}
185            --with-over-tizen_2_2 \
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 exit 0
215
216 ##############################
217 #  Post Install new package
218 ##############################
219 %post
220 /sbin/ldconfig
221 exit 0
222
223 %if 0%{?dali_feedback_plugin}
224 %post dali-feedback-plugin
225 /sbin/ldconfig
226 exit 0
227 %endif
228
229 ##############################
230 #   Pre Uninstall old package
231 ##############################
232 %preun
233 exit 0
234
235 ##############################
236 #   Post Uninstall old package
237 ##############################
238 %postun
239 /sbin/ldconfig
240 exit 0
241
242 %if 0%{?dali_feedback_plugin}
243 %postun dali-feedback-plugin
244 /sbin/ldconfig
245 exit 0
246 %endif
247
248 ##############################
249 # Files in Binary Packages
250 ##############################
251
252 %files
253 %manifest dali-adaptor.manifest
254 %defattr(-,root,root,-)
255 %{_libdir}/libdali-adap*.so*
256 %defattr(-,app,app,-)
257 %dir %{user_shader_cache_dir}
258 %{_bindir}/*
259 %{_datadir}/license/%{name}
260
261 %files devel
262 %defattr(-,root,root,-)
263 %{dev_include_path}/dali/dali.h
264 %{dev_include_path}/dali/public-api/*
265 %{dev_include_path}/dali/devel-api/*
266 %{dev_include_path}/dali/doc/*
267 %{_libdir}/pkgconfig/dali.pc
268
269 %files integration-devel
270 %defattr(-,root,root,-)
271 %{dev_include_path}/dali/integration-api/adaptors/*
272 %{_libdir}/pkgconfig/dali-adaptor-integration.pc
273
274 %if 0%{?dali_feedback_plugin}
275 %files dali-feedback-plugin
276 %defattr(-,root,root,-)
277 %{_libdir}/libdali-feedback-plugin.so*
278 %{dali_plugin_sound_files}/*
279 %endif
280