]>
Commit | Line | Data |
---|---|---|
1 | # TODO: | |
2 | # - build with system mozldap | |
3 | # | |
4 | # Conditional builds | |
5 | %bcond_with gtk3 # GTK+ 3.x instead of 2.x | |
6 | %bcond_without ldap # disable e-mail address lookups in LDAP directories | |
7 | %bcond_without lightning # disable Sunbird/Lightning calendar | |
8 | %bcond_with crashreporter # report crashes to crash-stats.mozilla.com | |
9 | # - disabled shared_js - https://bugzilla.mozilla.org/show_bug.cgi?id=1039964 | |
10 | %bcond_with shared_js # shared libmozjs library [broken] | |
11 | %bcond_with system_icu # build with system ICU (disabled due to crashes with system icu 58.2) | |
12 | ||
13 | %if 0%{?_enable_debug_packages} != 1 | |
14 | %undefine crashreporter | |
15 | %endif | |
16 | ||
17 | %define nspr_ver 4.10.6 | |
18 | %define nss_ver 3.19.2.1 | |
19 | ||
20 | # The actual sqlite version (see RHBZ#480989): | |
21 | %define sqlite_build_version %(pkg-config --silence-errors --modversion sqlite3 2>/dev/null || echo ERROR) | |
22 | ||
23 | Summary: Thunderbird - email client | |
24 | Summary(pl.UTF-8): Thunderbird - klient poczty | |
25 | Name: thunderbird | |
26 | Version: 45.8.0 | |
27 | Release: 0.1 | |
28 | License: MPL v2.0 | |
29 | Group: X11/Applications/Mail | |
30 | Source0: http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/%{version}/source/%{name}-%{version}.source.tar.xz | |
31 | # Source0-md5: 4e04b1618273f946f00f8ea547578895 | |
32 | Source1: %{name}.desktop | |
33 | Source2: %{name}.sh | |
34 | Patch0: prefs.patch | |
35 | Patch1: no-subshell.patch | |
36 | Patch2: enable-addons.patch | |
37 | Patch3: mozilla-1269171-badalloc.patch | |
38 | Patch4: mozilla-1245783.patch | |
39 | URL: http://www.mozilla.org/projects/thunderbird/ | |
40 | BuildRequires: GConf2-devel >= 1.2.1 | |
41 | BuildRequires: alsa-lib-devel | |
42 | BuildRequires: automake | |
43 | BuildRequires: bzip2-devel | |
44 | BuildRequires: cairo-devel >= 1.10 | |
45 | BuildRequires: dbus-glib-devel >= 0.60 | |
46 | BuildRequires: freetype-devel >= 1:2.1.8 | |
47 | BuildRequires: glib2-devel >= 1:2.20 | |
48 | BuildRequires: gstreamer0.10-devel | |
49 | BuildRequires: gstreamer0.10-plugins-base-devel | |
50 | %{!?with_gtk3:BuildRequires: gtk+2-devel >= 2:2.18.0} | |
51 | %{?with_gtk3:BuildRequires: gtk+3-devel >= 3.4.0} | |
52 | BuildRequires: hunspell-devel | |
53 | BuildRequires: libIDL-devel >= 0.8.0 | |
54 | BuildRequires: libevent-devel | |
55 | %{?with_system_icu:BuildRequires: libicu-devel >= 58.1} | |
56 | BuildRequires: libiw-devel | |
57 | # requires libjpeg-turbo implementing at least libjpeg 6b API | |
58 | BuildRequires: libjpeg-devel >= 6b | |
59 | BuildRequires: libjpeg-turbo-devel | |
60 | BuildRequires: libpng-devel >= 1.4.1 | |
61 | BuildRequires: libstdc++-devel | |
62 | BuildRequires: libvpx-devel >= 1.3.0 | |
63 | BuildRequires: mozldap-devel | |
64 | BuildRequires: nspr-devel >= 1:%{nspr_ver} | |
65 | BuildRequires: nss-devel >= 1:%{nss_ver} | |
66 | BuildRequires: pango-devel >= 1:1.22.0 | |
67 | BuildRequires: perl-base >= 1:5.6 | |
68 | BuildRequires: pkgconfig | |
69 | BuildRequires: python >= 1:2.5 | |
70 | BuildRequires: python-virtualenv | |
71 | BuildRequires: sed >= 4.0 | |
72 | BuildRequires: sqlite3-devel >= 3.8.4.2 | |
73 | BuildRequires: startup-notification-devel >= 0.8 | |
74 | BuildRequires: virtualenv | |
75 | BuildRequires: xorg-lib-libXext-devel | |
76 | BuildRequires: xorg-lib-libXinerama-devel | |
77 | BuildRequires: xorg-lib-libXt-devel | |
78 | BuildRequires: yasm | |
79 | BuildRequires: zip | |
80 | Requires: glib2 >= 1:2.20 | |
81 | %{!?with_gtk3:Requires: gtk+2 >= 2:2.18.0} | |
82 | %{?with_gtk3:Requires: gtk+3 >= 3.4.0} | |
83 | Requires: libvpx >= 1.3.0 | |
84 | Requires: myspell-common | |
85 | Requires: nspr >= 1:%{nspr_ver} | |
86 | Requires: nss >= 1:%{nss_ver} | |
87 | Requires: pango >= 1:1.22.0 | |
88 | Requires: sqlite3 >= %{sqlite_build_version} | |
89 | Requires(post): mktemp >= 1.5-18 | |
90 | Requires: libjpeg-turbo | |
91 | Obsoletes: icedove | |
92 | Obsoletes: mozilla-thunderbird | |
93 | Obsoletes: mozilla-thunderbird-dictionary-en-US | |
94 | Conflicts: thunderbird-lang-resources < %{version} | |
95 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
96 | ||
97 | %define filterout_cpp -D_FORTIFY_SOURCE=[0-9]+ | |
98 | ||
99 | # firefox/thunderbird/seamonkey provide their own versions | |
100 | %define _noautoprovfiles %{_libdir}/%{name}/components | |
101 | ||
102 | # we don't want these to satisfy packages depending on xulrunner | |
103 | %define _noautoprov libmozalloc.so libmozjs.so libxul.so | |
104 | # and as we don't provide them, don't require either | |
105 | %define _noautoreq libmozalloc.so libmozjs.so libxul.so | |
106 | ||
107 | %define topdir %{_builddir}/thunderbird-%{version} | |
108 | %define objdir %{topdir}/obj-%{_target_cpu} | |
109 | ||
110 | %description | |
111 | Thunderbird is an open-source, fast and portable email client. | |
112 | ||
113 | %description -l pl.UTF-8 | |
114 | Thunderbird jest mającym otwarte źródła, szybkim i przenośnym klientem | |
115 | poczty. | |
116 | ||
117 | %package addon-lightning | |
118 | Summary: An integrated calendar for Thunderbird | |
119 | Summary(pl.UTF-8): Zintegrowany kalendarz dla Thunderbird | |
120 | License: MPL 1.1 or GPL v2+ or LGPL v2.1+ | |
121 | Group: Applications/Networking | |
122 | Requires: %{name} = %{version}-%{release} | |
123 | Obsoletes: icedove-addon-lightning | |
124 | ||
125 | %description addon-lightning | |
126 | Lightning is an calendar extension to Thunderbird email client. | |
127 | ||
128 | %description addon-lightning -l pl.UTF-8 | |
129 | Lightning to rozszerzenie do klienta poczty Thunderbird dodające | |
130 | funkcjonalność kalendarza. | |
131 | ||
132 | %prep | |
133 | %setup -q | |
134 | %patch0 -p1 | |
135 | %patch1 -p1 | |
136 | %patch2 -p1 | |
137 | %patch3 -p1 | |
138 | %patch4 -p1 | |
139 | ||
140 | %build | |
141 | cat << EOF > .mozconfig | |
142 | mk_add_options MOZ_OBJDIR=%{objdir} | |
143 | ||
144 | %if %{with crashreporter} | |
145 | export MOZ_DEBUG_SYMBOLS=1 | |
146 | %endif | |
147 | ||
148 | # Options for 'configure' (same as command-line options). | |
149 | ac_add_options --prefix=%{_prefix} | |
150 | ac_add_options --exec-prefix=%{_exec_prefix} | |
151 | ac_add_options --bindir=%{_bindir} | |
152 | ac_add_options --sbindir=%{_sbindir} | |
153 | ac_add_options --sysconfdir=%{_sysconfdir} | |
154 | ac_add_options --datadir=%{_datadir} | |
155 | ac_add_options --includedir=%{_includedir} | |
156 | ac_add_options --libdir=%{_libdir} | |
157 | ac_add_options --libexecdir=%{_libexecdir} | |
158 | ac_add_options --localstatedir=%{_localstatedir} | |
159 | ac_add_options --sharedstatedir=%{_sharedstatedir} | |
160 | ac_add_options --mandir=%{_mandir} | |
161 | ac_add_options --infodir=%{_infodir} | |
162 | %if %{?debug:1}0 | |
163 | ac_add_options --disable-optimize | |
164 | ac_add_options --enable-debug | |
165 | ac_add_options --enable-debug-modules | |
166 | ac_add_options --enable-debugger-info-modules | |
167 | ac_add_options --enable-crash-on-assert | |
168 | %else | |
169 | ac_add_options --disable-debug | |
170 | ac_add_options --enable-optimize="%{rpmcflags} -Os" | |
171 | %endif | |
172 | ac_add_options --disable-strip | |
173 | ac_add_options --disable-strip-libs | |
174 | %if %{with tests} | |
175 | ac_add_options --enable-tests | |
176 | %else | |
177 | ac_add_options --disable-tests | |
178 | %endif | |
179 | %if %{with lightning} | |
180 | ac_add_options --enable-calendar | |
181 | %else | |
182 | ac_add_options --disable-calendar | |
183 | %endif | |
184 | %if %{with crashreporter} | |
185 | ac_add_options --enable-crashreporter | |
186 | %else | |
187 | ac_add_options --disable-crashreporter | |
188 | %endif | |
189 | #ac_add_options --disable-elf-dynstr-gc | |
190 | #ac_add_options --disable-elf-hack | |
191 | ac_add_options --disable-gnomeui | |
192 | ac_add_options --disable-gnomevfs | |
193 | ac_add_options --disable-installer | |
194 | ac_add_options --disable-javaxpcom | |
195 | ac_add_options --disable-profilesharing | |
196 | ac_add_options --disable-updater | |
197 | ac_add_options --disable-xterm-updates | |
198 | ac_add_options --enable-application=mail | |
199 | ac_add_options --enable-crypto | |
200 | ac_add_options --enable-default-toolkit=%{?with_gtk3:cairo-gtk3}%{!?with_gtk3:cairo-gtk2} | |
201 | ac_add_options --enable-gio | |
202 | %if %{with ldap} | |
203 | ac_add_options --enable-ldap | |
204 | ac_add_options --with-system-ldap | |
205 | %else | |
206 | ac_add_options --disable-ldap | |
207 | %endif | |
208 | ac_add_options --enable-libxul | |
209 | ac_add_options --enable-pango | |
210 | ac_add_options --enable-postscript | |
211 | %{?with_shared_js:ac_add_options --enable-shared-js} | |
212 | ac_add_options --enable-single-profile | |
213 | ac_add_options --enable-startup-notification | |
214 | ac_add_options --enable-system-cairo | |
215 | ac_add_options --enable-system-hunspell | |
216 | ac_add_options --enable-system-sqlite | |
217 | ac_add_options --with-default-mozilla-five-home=%{_libdir}/%{name} | |
218 | ac_add_options --with-distribution-id=org.pld-linux | |
219 | ac_add_options --with-pthreads | |
220 | ac_add_options --with-system-bz2 | |
221 | ac_add_options --with-system-ffi | |
222 | ac_add_options --with%{!?with_system_icu:out}-system-icu | |
223 | ac_add_options --with-system-jpeg | |
224 | ac_add_options --with-system-libevent | |
225 | ac_add_options --with-system-libvpx | |
226 | ac_add_options --with-system-nspr | |
227 | ac_add_options --with-system-nss | |
228 | ac_add_options --with-system-png | |
229 | ac_add_options --with-system-zlib | |
230 | EOF | |
231 | ||
232 | mkdir -p %{objdir}/config | |
233 | ln -sf %{topdir}/mozilla/config/*.mk %{objdir}/config | |
234 | ||
235 | %{__make} -j1 -f client.mk build \ | |
236 | STRIP="/bin/true" \ | |
237 | MOZ_MAKE_FLAGS="%{?_smp_mflags}" \ | |
238 | installdir=%{_libdir}/%{name} \ | |
239 | XLIBS="-lX11 -lXt" \ | |
240 | CC="%{__cc}" \ | |
241 | CXX="%{__cxx}" | |
242 | ||
243 | %if %{with crashreporter} | |
244 | # create debuginfo for crash-stats.mozilla.com | |
245 | %{__make} -j1 -C obj-%{_target_cpu} buildsymbols | |
246 | %endif | |
247 | ||
248 | %install | |
249 | rm -rf $RPM_BUILD_ROOT | |
250 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/%{name}/plugins,%{_datadir}/%{name},%{_pixmapsdir},%{_desktopdir}} | |
251 | ||
252 | cd %{objdir} | |
253 | %{__make} -C mail/installer stage-package \ | |
254 | DESTDIR=$RPM_BUILD_ROOT \ | |
255 | installdir=%{_libdir}/%{name} \ | |
256 | PKG_SKIP_STRIP=1 | |
257 | ||
258 | cp -a dist/thunderbird/* $RPM_BUILD_ROOT%{_libdir}/%{name}/ | |
259 | ||
260 | # Enable crash reporter for Thunderbird application | |
261 | %if %{with crashreporter} | |
262 | %{__sed} -i -e 's/\[Crash Reporter\]/[Crash Reporter]\nEnabled=1/' $RPM_BUILD_ROOT%{_libdir}/%{name}/application.ini | |
263 | ||
264 | # Add debuginfo for crash-stats.mozilla.com | |
265 | install -d $RPM_BUILD_ROOT%{_exec_prefix}/lib/debug%{_libdir}/%{name} | |
266 | cp -a dist/%{name}-%{version}.en-US.linux-*.crashreporter-symbols.zip $RPM_BUILD_ROOT%{_prefix}/lib/debug%{_libdir}/%{name} | |
267 | %endif | |
268 | ||
269 | %{__sed} -e 's,@LIBDIR@,%{_libdir},' %{SOURCE2} > $RPM_BUILD_ROOT%{_bindir}/%{name} | |
270 | cp -p dist/thunderbird/chrome/icons/default/default48.png $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png | |
271 | cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop | |
272 | ||
273 | # use system dict | |
274 | %{__rm} -rv $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries | |
275 | ln -s %{_datadir}/myspell $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries | |
276 | ln -s %{_datadir}/myspell $RPM_BUILD_ROOT%{_libdir}/%{name}/hyphenation | |
277 | ||
278 | # move arch independant ones to datadir | |
279 | mv $RPM_BUILD_ROOT%{_libdir}/%{name}/chrome $RPM_BUILD_ROOT%{_datadir}/%{name}/chrome | |
280 | mv $RPM_BUILD_ROOT%{_libdir}/%{name}/defaults $RPM_BUILD_ROOT%{_datadir}/%{name}/defaults | |
281 | mv $RPM_BUILD_ROOT%{_libdir}/%{name}/isp $RPM_BUILD_ROOT%{_datadir}/%{name}/isp | |
282 | ln -s ../../share/%{name}/chrome $RPM_BUILD_ROOT%{_libdir}/%{name}/chrome | |
283 | ln -s ../../share/%{name}/defaults $RPM_BUILD_ROOT%{_libdir}/%{name}/defaults | |
284 | ln -s ../../share/%{name}/isp $RPM_BUILD_ROOT%{_libdir}/%{name}/isp | |
285 | ||
286 | # mozldap | |
287 | %{__sed} -i '/lib\(ldap\|ldif\|prldap\)60.so/d' $RPM_BUILD_ROOT%{_libdir}/%{name}/dependentlibs.list | |
288 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/lib{ldap,ldif,prldap}60.so | |
289 | ||
290 | # remove unecessary stuff | |
291 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/removed-files | |
292 | ||
293 | %clean | |
294 | rm -rf $RPM_BUILD_ROOT | |
295 | ||
296 | %pretrans | |
297 | if [ -d %{_libdir}/%{name}/dictionaries ] && [ ! -L %{_libdir}/%{name}/dictionaries ]; then | |
298 | mv -v %{_libdir}/%{name}/dictionaries{,.rpmsave} | |
299 | fi | |
300 | for d in chrome defaults icons isp modules res; do | |
301 | if [ -d %{_libdir}/%{name}/$d ] && [ ! -L %{_libdir}/%{name}/$d ]; then | |
302 | install -d %{_datadir}/%{name} | |
303 | mv %{_libdir}/%{name}/$d %{_datadir}/%{name}/$d | |
304 | fi | |
305 | done | |
306 | exit 0 | |
307 | ||
308 | %post | |
309 | %update_desktop_database_post | |
310 | # make temporary HOME, as it attempts to touch files in $HOME/.mozilla | |
311 | # dangerous if you run this with sudo with keep_env += HOME | |
312 | # also TMPDIR could be pointing to sudo user's homedir so we reset that too. | |
313 | export HOME=$(mktemp -d) | |
314 | unset TMPDIR TMP || : | |
315 | umask 022 | |
316 | %{_libdir}/%{name}/thunderbird -register | |
317 | rm -rf $HOME | |
318 | ||
319 | %postun | |
320 | %update_desktop_database_postun | |
321 | ||
322 | %files | |
323 | %defattr(644,root,root,755) | |
324 | %attr(755,root,root) %{_bindir}/%{name} | |
325 | %dir %{_libdir}/%{name} | |
326 | %dir %{_libdir}/%{name}/plugins | |
327 | ||
328 | %if %{with gtk3} | |
329 | %dir %{_libdir}/%{name}/gtk2 | |
330 | %attr(755,root,root) %{_libdir}/%{name}/gtk2/libmozgtk.so | |
331 | %attr(755,root,root) %{_libdir}/%{name}/libmozgtk.so | |
332 | %endif | |
333 | %attr(755,root,root) %{_libdir}/%{name}/liblgpllibs.so | |
334 | %{?with_shared_js:%attr(755,root,root) %{_libdir}/%{name}/libmozjs.so} | |
335 | %attr(755,root,root) %{_libdir}/%{name}/libxul.so | |
336 | %attr(755,root,root) %{_libdir}/%{name}/*.sh | |
337 | %attr(755,root,root) %{_libdir}/%{name}/*-bin | |
338 | %attr(755,root,root) %{_libdir}/%{name}/plugin-container | |
339 | %attr(755,root,root) %{_libdir}/%{name}/thunderbird | |
340 | ||
341 | %{_libdir}/%{name}/application.ini | |
342 | %{_libdir}/%{name}/blocklist.xml | |
343 | %{_libdir}/%{name}/dependentlibs.list | |
344 | %{_libdir}/%{name}/omni.ja | |
345 | %{_libdir}/%{name}/platform.ini | |
346 | ||
347 | %if %{with crashreporter} | |
348 | %attr(755,root,root) %{_libdir}/%{name}/crashreporter | |
349 | %{_libdir}/%{name}/crashreporter.ini | |
350 | %{_libdir}/%{name}/Throbber-small.gif | |
351 | %endif | |
352 | ||
353 | %dir %{_libdir}/%{name}/extensions | |
354 | %{_libdir}/%{name}/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}.xpi | |
355 | ||
356 | %dir %{_libdir}/%{name}/distribution | |
357 | %dir %{_libdir}/%{name}/distribution/extensions | |
358 | ||
359 | # symlinks | |
360 | %{_libdir}/%{name}/chrome | |
361 | %{_libdir}/%{name}/defaults | |
362 | %{_libdir}/%{name}/dictionaries | |
363 | %{_libdir}/%{name}/hyphenation | |
364 | %{_libdir}/%{name}/isp | |
365 | ||
366 | %{_pixmapsdir}/*.png | |
367 | %{_desktopdir}/*.desktop | |
368 | ||
369 | %dir %{_datadir}/%{name} | |
370 | %{_datadir}/%{name}/chrome | |
371 | %{_datadir}/%{name}/defaults | |
372 | %{_datadir}/%{name}/isp | |
373 | ||
374 | %if %{with lightning} | |
375 | %files addon-lightning | |
376 | %defattr(644,root,root,755) | |
377 | %dir %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103} | |
378 | %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/app.ini | |
379 | %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/chrome.jar | |
380 | %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/chrome.manifest | |
381 | %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/defaults | |
382 | %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/install.rdf | |
383 | %dir %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components | |
384 | %attr(755,root,root) %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.so | |
385 | %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.js | |
386 | %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*manifest | |
387 | %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.xpt | |
388 | %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/modules | |
389 | %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/calendar-js | |
390 | %dir %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/timezones | |
391 | %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/timezones/zones.json | |
392 | %endif |