Added spec to build for wearable
[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.0
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:  vconf-devel
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(gles20)
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=$PREFIX/lib -Wl,--as-needed -Wl,--gc-sections "
114
115 %if 0%{?sec_build_binary_debug_enable}
116 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
117 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
118 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
119 %endif
120
121 %ifarch %{arm}
122 CXXFLAGS+=" -D_ARCH_ARM_ -lgcc"
123 %endif
124
125 libtoolize --force
126 cd %{_builddir}/%{name}-%{version}/build/tizen
127 autoreconf --install
128 DALI_DATA_RW_DIR="%{dali_data_rw_dir}" ; export DALI_DATA_RW_DIR
129 DALI_DATA_RO_DIR="%{dali_data_ro_dir}" ; export DALI_DATA_RO_DIR
130 FONT_PRELOADED_PATH="%{font_preloaded_path}" ; export FONT_PRELOADED_PATH
131 FONT_DOWNLOADED_PATH="%{font_downloaded_path}" ; export FONT_DOWNLOADED_PATH
132 FONT_APPLICATION_PATH="%{font_application_path}" ; export FONT_APPLICATION_PATH
133 FONT_CONFIGURATION_FILE="%{font_configuration_file}" ; export FONT_CONFIGURATION_FILE
134
135 %configure --with-jpeg-turbo --enable-gles=30 --enable-profile=%{dali_profile}
136
137 make %{?jobs:-j%jobs}
138
139 ##############################
140 # Installation
141 ##############################
142 %install
143 rm -rf %{buildroot}
144 cd build/tizen
145 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
146
147 # LICENSE
148 mkdir -p %{buildroot}/usr/share/license
149 cp -af %{_builddir}/%{name}-%{version}/LICENSE %{buildroot}/usr/share/license/%{name}
150
151 ##############################
152 # Upgrade order:
153 # 1 - Pre Install new package
154 # 2 - Install new package
155 # 3 - Post install new package
156 # 4 - Pre uninstall old package
157 # 5 - Remove files not overwritten by new package
158 # 6 - Post uninstall old package
159 ##############################
160
161 %pre
162 rm -f %{user_font_cache_dir}/*
163 rm -f %{user_shader_cache_dir}/*
164 exit 0
165
166 ##############################
167 #  Post Install new package
168 ##############################
169 %post
170 /sbin/ldconfig
171 chown 5000:5000 %{user_font_cache_dir}
172 chown 5000:5000 %{user_shader_cache_dir}
173 exit 0
174
175 %if 0%{?dali_feedback_plugin}
176 %post dali-feedback-plugin
177 /sbin/ldconfig
178 exit 0
179 %endif
180
181 %if 0%{?dali_bullet_plugin}
182 %post dali-bullet-plugin
183 /sbin/ldconfig
184 exit 0
185 %endif
186
187 ##############################
188 #   Pre Uninstall old package
189 ##############################
190 %preun
191 rm -f %{user_font_cache_dir}/*
192 rm -f %{user_shader_cache_dir}/*
193 exit 0
194
195 ##############################
196 #   Post Uninstall old package
197 ##############################
198 %postun
199 /sbin/ldconfig
200 exit 0
201
202 %if 0%{?dali_feedback_plugin}
203 %postun dali-feedback-plugin
204 /sbin/ldconfig
205 exit 0
206 %endif
207
208 %if 0%{?dali_bullet_plugin}
209 %postun dali-bullet-plugin
210 /sbin/ldconfig
211 exit 0
212 %endif
213
214 ##############################
215 # Files in Binary Packages
216 ##############################
217
218 %files
219 %manifest dali-adaptor.manifest-mobile
220 %defattr(-,root,root,-)
221 %{_libdir}/libdali-adap*.so*
222 %{_libdir}/libdali-appl*.so*
223 %defattr(-,app,app,-)
224 %dir %{user_font_cache_dir}
225 %dir %{user_shader_cache_dir}
226 %{_bindir}/*
227 %{_datadir}/license/%{name}
228
229 %files devel
230 %defattr(-,root,root,-)
231 %{dev_include_path}/dali/*
232 %{_libdir}/pkgconfig/dali*.pc
233
234 %if 0%{?dali_feedback_plugin}
235 %files dali-feedback-plugin
236 %defattr(-,root,root,-)
237 %{_libdir}/libdali-feedback-plugin.so*
238 %{dali_plugin_sound_files}/*
239 %{dali_plugin_theme_files}/*
240 %endif
241
242 %if 0%{?dali_bullet_plugin}
243 %files dali-bullet-plugin
244 %defattr(-,root,root,-)
245 %{_libdir}/libdali-bullet-plugin.so*
246 %endif