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