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