Merge remote-tracking branch 'origin/tizen' into new_text
[platform/core/uifw/dali-adaptor.git] / packaging / dali-adaptor-mobile.spec
1 Name:       dali-adaptor
2 Summary:    The DALi Tizen Adaptor
3 Version:    1.0.34
4 Release:    1
5 Group:      System/Libraries
6 License:    Apache-2.0
7 URL:        https://review.tizen.org/git/?p=platform/core/uifw/dali-adaptor.git;a=summary
8 Source0:    %{name}-%{version}.tar.gz
9
10 %define dali_profile MOBILE
11 %define dali_mobile_profile 1
12 %define dali_feedback_plugin 0
13 %define dali_bullet_plugin 0
14 %define dali_assimp_plugin 0
15 %define over_tizen_2_2 1
16
17 %if 0%{?over_tizen_2_2}
18 %define shaderbincache_flag ENABLE
19 %endif
20
21 Requires(post): /sbin/ldconfig
22 Requires(postun): /sbin/ldconfig
23 Requires:       boost-thread
24 Requires:       giflib
25 BuildRequires:  pkgconfig
26 BuildRequires:  gawk
27 BuildRequires:  pkgconfig(sensor)
28 BuildRequires:  pkgconfig(aul)
29 BuildRequires:  boost-devel
30 BuildRequires:  giflib-devel
31 BuildRequires:  pkgconfig(xi)
32 BuildRequires:  pkgconfig(fontconfig)
33 BuildRequires:  pkgconfig(elementary)
34 BuildRequires:  pkgconfig(capi-appfw-application)
35 BuildRequires:  libjpeg-turbo-devel
36 BuildRequires:  pkgconfig(evas)
37 BuildRequires:  pkgconfig(xfixes)
38 BuildRequires:  pkgconfig(xdamage)
39 BuildRequires:  pkgconfig(utilX)
40 BuildRequires:  dali-devel
41 BuildRequires:  dali-integration-devel
42 BuildRequires:  libxml2-devel
43 BuildRequires:  pkgconfig(vconf)
44 BuildRequires:  tts-devel
45 BuildRequires:  pkgconfig(dlog)
46 BuildRequires:  libdrm-devel
47 BuildRequires:  pkgconfig(libexif)
48 BuildRequires:  pkgconfig(capi-system-system-settings)
49 BuildRequires:  pkgconfig(libpng)
50 BuildRequires:  pkgconfig(opengl-es-20)
51 BuildRequires:  pkgconfig(efl-assist)
52 BuildRequires:  libcurl-devel
53 BuildRequires:  pkgconfig(harfbuzz)
54 BuildRequires:  fribidi-devel
55
56 %if 0%{?over_tizen_2_2}
57 BuildRequires:  pkgconfig(capi-system-info)
58 %endif
59
60 %if 0%{?dali_assimp_plugin}
61 BuildRequires:  pkgconfig(assimp)
62 %endif
63
64 %description
65 The DALi Tizen Adaptor provides a Tizen specific implementation of the dali-core
66 platform abstraction and application shell
67
68 ##############################
69 # devel
70 ##############################
71 %package devel
72 Summary:    Development components for the DALi Tizen Adaptor
73 Group:      Development/Building
74 Requires:   %{name} = %{version}-%{release}
75
76 %description devel
77 Development components for the DALi Tizen Adaptor - public headers and package configs
78
79 ##############################
80 # Dali Feedback Plugin
81 ##############################
82 %package dali-feedback-plugin
83 Summary:    Plugin to play haptic and audio feedback for Dali
84 Group:      System/Libraries
85 %if 0%{?dali_feedback_plugin}
86 Requires:       libdeviced
87 BuildRequires:  pkgconfig(mm-sound)
88 BuildRequires:  pkgconfig(deviced)
89 BuildRequires:  libfeedback-devel
90 %endif
91
92 %description dali-feedback-plugin
93 Feedback plugin to play haptic and audio feedback for Dali
94
95 ##############################
96 # Dali Dynamics/Bullet Plugin
97 ##############################
98 %package dali-bullet-plugin
99 Summary:    Plugin to provide physics
100 Group:      System/Libraries
101 %if 0%{?dali_bullet_plugin}
102 BuildRequires:  libbullet-devel
103 %endif
104
105 %description dali-bullet-plugin
106 Dynamics plugin to wrap the libBulletDynamics libraries
107
108 ##############################
109 # Preparation
110 ##############################
111 %prep
112 %setup -q
113 %define dali_data_rw_dir         /opt/usr/share/dali/
114 %define dali_data_ro_dir         /usr/share/dali/
115 %define user_font_cache_dir      %{dali_data_rw_dir}/glyphcache/
116 %define user_shader_cache_dir    %{dali_data_ro_dir}/core/shaderbin/
117 %define font_preloaded_path      /usr/share/fonts/
118 %define font_downloaded_path     /opt/share/fonts/
119 %define font_application_path    /usr/share/app_fonts/
120 %define font_configuration_file  /opt/etc/fonts/conf.avail/99-slp.conf
121 %define dali_plugin_sound_files  %{dali_data_ro_dir}/plugins/sounds/
122 %define dali_plugin_theme_files  %{dali_data_ro_dir}/themes/feedback-themes/
123
124 %define dev_include_path %{_includedir}
125
126 ##############################
127 # Build
128 ##############################
129 %build
130 PREFIX+="/usr"
131 CXXFLAGS+=" -Wall -g -Os -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections "
132 LDFLAGS+=" -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--gc-sections -Wl,-Bsymbolic-functions "
133
134 %ifarch %{arm}
135 CXXFLAGS+=" -D_ARCH_ARM_ -lgcc"
136 %endif
137
138 %if 0%{?over_tizen_2_2}
139 CFLAGS+=" -DOVER_TIZEN_SDK_2_2"
140 CXXFLAGS+=" -DOVER_TIZEN_SDK_2_2"
141 %endif
142
143 libtoolize --force
144 cd %{_builddir}/%{name}-%{version}/build/tizen
145 autoreconf --install
146 DALI_DATA_RW_DIR="%{dali_data_rw_dir}" ; export DALI_DATA_RW_DIR
147 DALI_DATA_RO_DIR="%{dali_data_ro_dir}" ; export DALI_DATA_RO_DIR
148 FONT_PRELOADED_PATH="%{font_preloaded_path}" ; export FONT_PRELOADED_PATH
149 FONT_DOWNLOADED_PATH="%{font_downloaded_path}" ; export FONT_DOWNLOADED_PATH
150 FONT_APPLICATION_PATH="%{font_application_path}" ; export FONT_APPLICATION_PATH
151 FONT_CONFIGURATION_FILE="%{font_configuration_file}" ; export FONT_CONFIGURATION_FILE
152
153 %configure --with-jpeg-turbo --enable-gles=20 --enable-shaderbincache=%{shaderbincache_flag} --enable-profile=%{dali_profile} \
154 %if 0%{?dali_feedback_plugin}
155            --enable-feedback \
156 %endif
157 %if 0%{?dali_bullet_plugin}
158            --enable-bullet \
159 %endif
160 %if 0%{?dali_assimp_plugin}
161            --enable-assimp \
162 %endif
163 %if 0%{?over_tizen_2_2}
164            --with-over-tizen_2_2 \
165 %endif
166            --libdir=%{_libdir}
167
168 make %{?jobs:-j%jobs}
169
170 ##############################
171 # Installation
172 ##############################
173 %install
174 rm -rf %{buildroot}
175 cd build/tizen
176 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
177
178 # LICENSE
179 mkdir -p %{buildroot}/usr/share/license
180 cp -af %{_builddir}/%{name}-%{version}/LICENSE %{buildroot}/usr/share/license/%{name}
181
182 ##############################
183 # Upgrade order:
184 # 1 - Pre Install new package
185 # 2 - Install new package
186 # 3 - Post install new package
187 # 4 - Pre uninstall old package
188 # 5 - Remove files not overwritten by new package
189 # 6 - Post uninstall old package
190 ##############################
191
192 %pre
193 rm -f %{user_font_cache_dir}/*
194 exit 0
195
196 ##############################
197 #  Post Install new package
198 ##############################
199 %post
200 /sbin/ldconfig
201 chown 5000:5000 %{user_font_cache_dir}
202 exit 0
203
204 %if 0%{?dali_feedback_plugin}
205 %post dali-feedback-plugin
206 /sbin/ldconfig
207 exit 0
208 %endif
209
210 %if 0%{?dali_bullet_plugin}
211 %post dali-bullet-plugin
212 /sbin/ldconfig
213 exit 0
214 %endif
215
216 ##############################
217 #   Pre Uninstall old package
218 ##############################
219 %preun
220 rm -f %{user_font_cache_dir}/*
221 exit 0
222
223 ##############################
224 #   Post Uninstall old package
225 ##############################
226 %postun
227 /sbin/ldconfig
228 exit 0
229
230 %if 0%{?dali_feedback_plugin}
231 %postun dali-feedback-plugin
232 /sbin/ldconfig
233 exit 0
234 %endif
235
236 %if 0%{?dali_bullet_plugin}
237 %postun dali-bullet-plugin
238 /sbin/ldconfig
239 exit 0
240 %endif
241
242 ##############################
243 # Files in Binary Packages
244 ##############################
245
246 %files
247 %manifest dali-adaptor.manifest-mobile
248 %defattr(-,root,root,-)
249 %{_libdir}/libdali-adap*.so*
250 %defattr(-,app,app,-)
251 %dir %{user_font_cache_dir}
252 %dir %{user_shader_cache_dir}
253 %{_bindir}/*
254 %{_datadir}/license/%{name}
255
256 %files devel
257 %defattr(-,root,root,-)
258 %{dev_include_path}/dali/*
259 %{_libdir}/pkgconfig/dali*.pc
260
261 %if 0%{?dali_feedback_plugin}
262 %files dali-feedback-plugin
263 %defattr(-,root,root,-)
264 %{_libdir}/libdali-feedback-plugin.so*
265 %{dali_plugin_sound_files}/*
266 %{dali_plugin_theme_files}/*
267 %endif
268
269 %if 0%{?dali_bullet_plugin}
270 %files dali-bullet-plugin
271 %defattr(-,root,root,-)
272 %{_libdir}/libdali-bullet-plugin.so*
273 %endif