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