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