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