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