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