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