Revert "Separating integration-devel from devel package for 2nd party to use adaptor"
[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.35
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 %define over_tizen_2_2 0
18 %define shaderbincache_flag DISABLE
19 %endif
20
21 %if "%{profile}" == "tv"
22 %define dali_profile TV
23 %define dali_feedback_plugin 0
24 %define dali_bullet_plugin 0
25 %define dali_assimp_plugin 0
26 %define over_tizen_2_2 1
27 %define shaderbincache_flag ENABLE
28 %endif
29
30 %if "%{profile}" == "wearable"
31 %define dali_profile WEARABLE
32 %define dali_feedback_plugin 0
33 %define dali_bullet_plugin 0
34 %define dali_assimp_plugin 0
35 %define over_tizen_2_2 0
36 %define shaderbincache_flag DISABLE
37 %endif
38
39 %if "%{profile}" == "common"
40 %define dali_profile COMMON
41 %define dali_feedback_plugin 0
42 %define dali_bullet_plugin 0
43 %define dali_assimp_plugin 0
44 %define over_tizen_2_2 0
45 %define shaderbincache_flag DISABLE
46 %endif
47
48 Requires(post): /sbin/ldconfig
49 Requires(postun): /sbin/ldconfig
50 Requires:       boost-thread
51 Requires:       giflib
52 BuildRequires:  pkgconfig
53 BuildRequires:  gawk
54 BuildRequires:  pkgconfig(sensor)
55 BuildRequires:  pkgconfig(aul)
56 BuildRequires:  boost-devel
57 BuildRequires:  giflib-devel
58 BuildRequires:  pkgconfig(fontconfig)
59 BuildRequires:  pkgconfig(elementary)
60 BuildRequires:  pkgconfig(capi-appfw-application)
61 BuildRequires:  libjpeg-turbo-devel
62 BuildRequires:  pkgconfig(evas)
63 BuildRequires:  dali-devel
64 BuildRequires:  dali-integration-devel
65 BuildRequires:  libxml2-devel
66 BuildRequires:  vconf-devel
67 BuildRequires:  vconf-keys-devel
68 BuildRequires:  tts-devel
69 BuildRequires:  pkgconfig(dlog)
70 BuildRequires:  libdrm-devel
71 BuildRequires:  pkgconfig(libexif)
72 BuildRequires:  pkgconfig(capi-system-system-settings)
73 BuildRequires:  pkgconfig(libpng)
74 BuildRequires:  pkgconfig(glesv2)
75 BuildRequires:  pkgconfig(egl)
76 BuildRequires:  libcurl-devel
77
78
79 %if 0%{?over_tizen_2_2}
80 BuildRequires:  pkgconfig(capi-system-info)
81 %endif
82
83 %if %{with wayland}
84 BuildRequires:  pkgconfig(ecore-wayland)
85 BuildRequires:  pkgconfig(wayland-egl)
86 BuildRequires:  pkgconfig(wayland-client)
87 %else
88 BuildRequires:  pkgconfig(xi)
89 BuildRequires:  pkgconfig(xfixes)
90 BuildRequires:  pkgconfig(xdamage)
91 BuildRequires:  pkgconfig(utilX)
92 %endif
93
94 %if 0%{?dali_assimp_plugin}
95 BuildRequires:  pkgconfig(assimp)
96 %endif
97
98 %description
99 The DALi Tizen Adaptor provides a Tizen specific implementation of the dali-core
100 platform abstraction and application shell
101
102 ##############################
103 # devel
104 ##############################
105 %package devel
106 Summary:    Development components for the DALi Tizen Adaptor
107 Group:      Development/Building
108 Requires:   %{name} = %{version}-%{release}
109
110 %description devel
111 Development components for the DALi Tizen Adaptor - public headers and package configs
112
113 ##############################
114 # Dali Feedback Plugin
115 ##############################
116 %package dali-feedback-plugin
117 Summary:    Plugin to play haptic and audio feedback for Dali
118 Group:      System/Libraries
119 %if 0%{?dali_feedback_plugin}
120 #Requires:       libdeviced
121 BuildRequires:  pkgconfig(mm-sound)
122 BuildRequires:  pkgconfig(haptic)
123 BuildRequires:  libfeedback-devel
124 %endif
125
126 %description dali-feedback-plugin
127 Feedback plugin to play haptic and audio feedback for Dali
128
129 ##############################
130 # Dali Dynamics/Bullet Plugin
131 ##############################
132 %package dali-bullet-plugin
133 Summary:    Plugin to provide physics
134 Group:      System/Libraries
135 %if 0%{?dali_bullet_plugin}
136 BuildRequires:  pkgconfig(bullet)
137 %endif
138
139 %description dali-bullet-plugin
140 Dynamics plugin to wrap the libBulletDynamics libraries
141
142 ##############################
143 # Preparation
144 ##############################
145 %prep
146 %setup -q
147 %define dali_data_rw_dir         /usr/share/dali/
148 %define dali_data_ro_dir         /usr/share/dali/
149 %define user_font_cache_dir      %{dali_data_rw_dir}/glyphcache/
150 %define user_shader_cache_dir    %{dali_data_ro_dir}/core/shaderbin/
151 %define font_preloaded_path      /usr/share/fonts/
152 %define font_downloaded_path     /opt/share/fonts/
153 %define font_application_path    /usr/share/app_fonts/
154 %define font_configuration_file  /opt/etc/fonts/conf.avail/99-slp.conf
155 %define dali_plugin_sound_files  %{dali_data_ro_dir}/plugins/sounds/
156 %define dali_plugin_theme_files  %{dali_data_ro_dir}/themes/feedback-themes/
157
158 %define dev_include_path %{_includedir}
159
160 ##############################
161 # Build
162 ##############################
163 %build
164 PREFIX+="/usr"
165 CXXFLAGS+=" -Wall -g -Os -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections "
166 LDFLAGS+=" -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--gc-sections -Wl,-Bsymbolic-functions "
167
168 %ifarch %{arm}
169 CXXFLAGS+=" -D_ARCH_ARM_ -lgcc"
170 %endif
171
172 %if %{with wayland}
173 CFLAGS+=" -DWAYLAND"
174 CXXFLAGS+=" -DWAYLAND"
175 configure_flags="--enable-wayland"
176 %endif
177
178 %if 0%{?over_tizen_2_2}
179 CFLAGS+=" -DOVER_TIZEN_SDK_2_2"
180 CXXFLAGS+=" -DOVER_TIZEN_SDK_2_2"
181 %endif
182
183 libtoolize --force
184 cd %{_builddir}/%{name}-%{version}/build/tizen && autoreconf --install
185 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}"
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%{?dali_bullet_plugin}
192            --enable-bullet \
193 %endif
194 %if 0%{?dali_assimp_plugin}
195            --enable-assimp \
196 %endif
197 %if 0%{?over_tizen_2_2}
198            --with-over-tizen_2_2 \
199 %endif
200            $configure_flags --libdir=%{_libdir}
201
202 make %{?jobs:-j%jobs}
203
204 ##############################
205 # Installation
206 ##############################
207 %install
208 rm -rf %{buildroot}
209 cd build/tizen
210 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
211
212 # LICENSE
213 mkdir -p %{buildroot}/usr/share/license
214 cp -af %{_builddir}/%{name}-%{version}/LICENSE %{buildroot}/usr/share/license/%{name}
215
216 ##############################
217 # Upgrade order:
218 # 1 - Pre Install new package
219 # 2 - Install new package
220 # 3 - Post install new package
221 # 4 - Pre uninstall old package
222 # 5 - Remove files not overwritten by new package
223 # 6 - Post uninstall old package
224 ##############################
225
226 %pre
227 rm -f %{user_font_cache_dir}/*
228 exit 0
229
230 ##############################
231 #  Post Install new package
232 ##############################
233 %post
234 /sbin/ldconfig
235 chown 5000:5000 %{user_font_cache_dir}
236 exit 0
237
238 %if 0%{?dali_feedback_plugin}
239 %post dali-feedback-plugin
240 /sbin/ldconfig
241 exit 0
242 %endif
243
244 %if 0%{?dali_bullet_plugin}
245 %post dali-bullet-plugin
246 /sbin/ldconfig
247 exit 0
248 %endif
249
250 ##############################
251 #   Pre Uninstall old package
252 ##############################
253 %preun
254 rm -f %{user_font_cache_dir}/*
255 exit 0
256
257 ##############################
258 #   Post Uninstall old package
259 ##############################
260 %postun
261 /sbin/ldconfig
262 exit 0
263
264 %if 0%{?dali_feedback_plugin}
265 %postun dali-feedback-plugin
266 /sbin/ldconfig
267 exit 0
268 %endif
269
270 %if 0%{?dali_bullet_plugin}
271 %postun dali-bullet-plugin
272 /sbin/ldconfig
273 exit 0
274 %endif
275
276 ##############################
277 # Files in Binary Packages
278 ##############################
279
280 %files
281 %manifest dali-adaptor.manifest
282 %defattr(-,root,root,-)
283 %{_libdir}/libdali-adap*.so*
284 %defattr(-,app,app,-)
285 %dir %{user_font_cache_dir}
286 %dir %{user_shader_cache_dir}
287 %{_bindir}/*
288 %{_datadir}/license/%{name}
289
290 %files devel
291 %defattr(-,root,root,-)
292 %{dev_include_path}/dali/*
293 %{_libdir}/pkgconfig/dali*.pc
294
295 %if 0%{?dali_feedback_plugin}
296 %files dali-feedback-plugin
297 %defattr(-,root,root,-)
298 %{_libdir}/libdali-feedback-plugin.so*
299 %{dali_plugin_sound_files}/*
300 %{dali_plugin_theme_files}/*
301 %endif
302
303 %if 0%{?dali_bullet_plugin}
304 %files dali-bullet-plugin
305 %defattr(-,root,root,-)
306 %{_libdir}/libdali-bullet-plugin.so*
307 %endif