2 # - build with system mozldap
3 # - fix startup crash "TypeError: a is null"
6 %bcond_with tests # enable tests (whatever they check)
7 %bcond_without gtk3 # GTK+ 3.x instead of 2.x
8 %bcond_without ldap # disable e-mail address lookups in LDAP directories
9 %bcond_without lightning # disable Sunbird/Lightning calendar
10 %bcond_without official # official Thunderbird branding
11 %bcond_with crashreporter # report crashes to crash-stats.mozilla.com
12 # - disabled shared_js - https://bugzilla.mozilla.org/show_bug.cgi?id=1039964
13 %bcond_with shared_js # shared libmozjs library [broken]
14 %bcond_with system_icu # build with system ICU (disabled due to crashes with system icu 58.2)
15 %bcond_without clang # build using Clang/LLVM
17 %if 0%{?_enable_debug_packages} != 1
18 %undefine crashreporter
21 %define nspr_ver 4.13.1
22 %define nss_ver 3.28.5
24 # The actual sqlite version (see RHBZ#480989):
25 %define sqlite_build_version %(pkg-config --silence-errors --modversion sqlite3 2>/dev/null || echo ERROR)
27 Summary: Thunderbird - email client
28 Summary(pl.UTF-8): Thunderbird - klient poczty
33 Group: X11/Applications/Mail
34 Source0: http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/%{version}/source/%{name}-%{version}.source.tar.xz
35 # Source0-md5: 5841ee1a70423b9385110c82b78bef47
36 Source1: %{name}.desktop
39 Patch1: no-subshell.patch
40 Patch2: enable-addons.patch
41 Patch3: mozilla-1245783.patch
42 URL: http://www.mozilla.org/projects/thunderbird/
43 BuildRequires: alsa-lib-devel
44 BuildRequires: autoconf2_13 >= 2.13
45 BuildRequires: bzip2-devel
46 BuildRequires: cairo-devel >= 1.10
47 %{?with_clang:BuildRequires: clang}
48 BuildRequires: dbus-glib-devel >= 0.60
49 BuildRequires: fontconfig-devel >= 2.7.0
50 BuildRequires: freetype-devel >= 1:2.1.8
51 BuildRequires: glib2-devel >= 1:2.22
52 %{!?with_gtk3:BuildRequires: gtk+2-devel >= 2:2.18.0}
53 %{?with_gtk3:BuildRequires: gtk+3-devel >= 3.4.0}
54 BuildRequires: hunspell-devel
55 BuildRequires: libatomic-devel
56 BuildRequires: libevent-devel
57 BuildRequires: libffi-devel > 3.0.9
58 %{?with_system_icu:BuildRequires: libicu-devel >= 58.1}
59 BuildRequires: libiw-devel
60 # requires libjpeg-turbo implementing at least libjpeg 6b API
61 BuildRequires: libjpeg-devel >= 6b
62 BuildRequires: libjpeg-turbo-devel
63 BuildRequires: libpng-devel >= 2:1.6.25
64 BuildRequires: libstdc++-devel
65 BuildRequires: libvpx-devel >= 1.5.0
66 BuildRequires: mozldap-devel
67 BuildRequires: nspr-devel >= 1:%{nspr_ver}
68 BuildRequires: nss-devel >= 1:%{nss_ver}
69 BuildRequires: pango-devel >= 1:1.22.0
70 BuildRequires: perl-base >= 1:5.6
71 BuildRequires: pixman-devel >= 0.19.2
72 BuildRequires: pkgconfig
73 BuildRequires: python >= 1:2.7
74 BuildRequires: python-virtualenv
75 BuildRequires: sed >= 4.0
76 BuildRequires: sqlite3-devel >= 3.17.0
77 BuildRequires: startup-notification-devel >= 0.8
78 BuildRequires: virtualenv
79 BuildRequires: xorg-lib-libX11-devel
80 BuildRequires: xorg-lib-libXcomposite-devel
81 BuildRequires: xorg-lib-libXdamage-devel
82 BuildRequires: xorg-lib-libXext-devel
83 BuildRequires: xorg-lib-libXfixes-devel
84 BuildRequires: xorg-lib-libXt-devel
85 %ifarch %{ix86} %{x8664}
86 BuildRequires: yasm >= 1.0.1
89 BuildRequires: zlib-devel >= 1.2.3
90 Requires(post): mktemp >= 1.5-18
91 Requires: dbus-glib >= 0.60
92 Requires: glib2 >= 1:2.22
93 %{!?with_gtk3:Requires: gtk+2 >= 2:2.18.0}
94 %{?with_gtk3:Requires: gtk+3 >= 3.4.0}
95 Requires: libpng >= 2:1.6.25
96 Requires: libvpx >= 1.5.0
97 Requires: myspell-common
98 Requires: nspr >= 1:%{nspr_ver}
99 Requires: nss >= 1:%{nss_ver}
100 Requires: pango >= 1:1.22.0
101 Requires: sqlite3 >= %{sqlite_build_version}
102 Requires: startup-notification >= 0.8
103 Requires: libjpeg-turbo
105 Obsoletes: mozilla-thunderbird
106 Obsoletes: mozilla-thunderbird-dictionary-en-US
107 Conflicts: thunderbird-lang-resources < %{version}
108 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
110 %define filterout_cpp -D_FORTIFY_SOURCE=[0-9]+
113 %define filterout -fvar-tracking-assignments
116 # firefox/thunderbird/seamonkey provide their own versions
117 %define _noautoprovfiles %{_libdir}/%{name}/components
119 # we don't want these to satisfy packages depending on xulrunner
120 %define _noautoprov libmozalloc.so libmozjs.so libxul.so
121 # and as we don't provide them, don't require either
122 %define _noautoreq libmozalloc.so libmozjs.so libxul.so
124 %define topdir %{_builddir}/thunderbird-%{version}
125 %define objdir %{topdir}/obj-%{_target_cpu}
128 Thunderbird is an open-source, fast and portable email client.
130 %description -l pl.UTF-8
131 Thunderbird jest mającym otwarte źródła, szybkim i przenośnym klientem
134 %package addon-lightning
135 Summary: An integrated calendar for Thunderbird
136 Summary(pl.UTF-8): Zintegrowany kalendarz dla Thunderbird
137 License: MPL 1.1 or GPL v2+ or LGPL v2.1+
138 Group: Applications/Networking
139 Requires: %{name} = %{version}-%{release}
140 Obsoletes: icedove-addon-lightning
142 %description addon-lightning
143 Lightning is an calendar extension to Thunderbird email client.
145 %description addon-lightning -l pl.UTF-8
146 Lightning to rozszerzenie do klienta poczty Thunderbird dodające
147 funkcjonalność kalendarza.
157 cat << EOF > .mozconfig
158 mk_add_options MOZ_OBJDIR=%{objdir}
165 export CXX="%{__cxx}"
167 export CFLAGS="%{rpmcflags} -D_FILE_OFFSET_BITS=64"
168 export CXXFLAGS="%{rpmcxxflags} -D_FILE_OFFSET_BITS=64"
170 %if %{with crashreporter}
171 export MOZ_DEBUG_SYMBOLS=1
174 # Options for 'configure' (same as command-line options).
175 ac_add_options --prefix=%{_prefix}
177 ac_add_options --disable-optimize
178 ac_add_options --enable-debug
179 ac_add_options --enable-debug-modules
180 ac_add_options --enable-debugger-info-modules
181 ac_add_options --enable-crash-on-assert
183 ac_add_options --disable-debug
184 ac_add_options --enable-optimize="%{rpmcflags} -Os"
186 ac_add_options --disable-strip
187 ac_add_options --disable-install-strip
189 ac_add_options --enable-tests
190 ac_add_options --enable-mochitest
192 ac_add_options --disable-tests
194 %if %{with lightning}
195 ac_add_options --enable-calendar
197 ac_add_options --disable-calendar
199 %if %{with crashreporter}
200 ac_add_options --enable-crashreporter
202 ac_add_options --disable-crashreporter
204 #ac_add_options --disable-elf-hack
205 ac_add_options --disable-gconf
206 ac_add_options --disable-gnomeui
207 ac_add_options --disable-necko-wifi
208 ac_add_options --disable-updater
209 ac_add_options --enable-alsa
210 ac_add_options --enable-application=mail
211 ac_add_options --enable-chrome-format=omni
212 ac_add_options --enable-default-toolkit=%{?with_gtk3:cairo-gtk3}%{!?with_gtk3:cairo-gtk2}
213 ac_add_options --enable-gio
215 ac_add_options --enable-ldap
217 ac_add_options --disable-ldap
219 %{?with_official:ac_add_options --enable-official-branding}
220 ac_add_options --enable-readline
221 %{?with_shared_js:ac_add_options --enable-shared-js}
222 ac_add_options --enable-startup-notification
223 ac_add_options --enable-system-cairo
224 ac_add_options --enable-system-ffi
225 ac_add_options --enable-system-hunspell
226 ac_add_options --enable-system-sqlite
227 ac_add_options --enable-url-classifier
228 ac_add_options --with-default-mozilla-five-home=%{_libdir}/%{name}
229 ac_add_options --with-distribution-id=org.pld-linux
230 ac_add_options --with-pthreads
231 ac_add_options --with-system-bz2
232 ac_add_options --with%{!?with_system_icu:out}-system-icu
233 ac_add_options --with-system-jpeg
234 ac_add_options --with-system-libevent
235 ac_add_options --with-system-libvpx
236 ac_add_options --with-system-nspr
237 ac_add_options --with-system-nss
238 ac_add_options --with-system-png
239 ac_add_options --with-system-zlib
240 ac_add_options --with-x
243 mkdir -p %{objdir}/config
244 ln -sf %{topdir}/mozilla/config/*.mk %{objdir}/config
246 %{__make} -j1 -f client.mk build \
247 AUTOCONF=/usr/bin/autoconf2_13 \
248 MOZ_MAKE_FLAGS="%{_smp_mflags}"
250 %if %{with crashreporter}
251 # create debuginfo for crash-stats.mozilla.com
252 %{__make} -j1 -C obj-%{_target_cpu} buildsymbols
256 rm -rf $RPM_BUILD_ROOT
257 install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/%{name}/plugins,%{_datadir}/%{name},%{_pixmapsdir},%{_desktopdir}}
260 %{__make} -C mail/installer stage-package \
261 DESTDIR=$RPM_BUILD_ROOT \
262 installdir=%{_libdir}/%{name} \
265 cp -a dist/thunderbird/* $RPM_BUILD_ROOT%{_libdir}/%{name}/
267 # Enable crash reporter for Thunderbird application
268 %if %{with crashreporter}
269 %{__sed} -i -e 's/\[Crash Reporter\]/[Crash Reporter]\nEnabled=1/' $RPM_BUILD_ROOT%{_libdir}/%{name}/application.ini
271 # Add debuginfo for crash-stats.mozilla.com
272 install -d $RPM_BUILD_ROOT%{_exec_prefix}/lib/debug%{_libdir}/%{name}
273 cp -a dist/%{name}-%{version}.en-US.linux-*.crashreporter-symbols.zip $RPM_BUILD_ROOT%{_prefix}/lib/debug%{_libdir}/%{name}
276 %{__sed} -e 's,@LIBDIR@,%{_libdir},' %{SOURCE2} > $RPM_BUILD_ROOT%{_bindir}/%{name}
277 cp -p dist/thunderbird/chrome/icons/default/default48.png $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
278 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
281 %{__rm} -rv $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
282 ln -s %{_datadir}/myspell $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
283 ln -s %{_datadir}/myspell $RPM_BUILD_ROOT%{_libdir}/%{name}/hyphenation
285 # move arch independant ones to datadir
286 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/chrome $RPM_BUILD_ROOT%{_datadir}/%{name}/chrome
287 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/defaults $RPM_BUILD_ROOT%{_datadir}/%{name}/defaults
288 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/isp $RPM_BUILD_ROOT%{_datadir}/%{name}/isp
289 ln -s ../../share/%{name}/chrome $RPM_BUILD_ROOT%{_libdir}/%{name}/chrome
290 ln -s ../../share/%{name}/defaults $RPM_BUILD_ROOT%{_libdir}/%{name}/defaults
291 ln -s ../../share/%{name}/isp $RPM_BUILD_ROOT%{_libdir}/%{name}/isp
294 %{__sed} -i '/lib\(ldap\|ldif\|prldap\)60.so/d' $RPM_BUILD_ROOT%{_libdir}/%{name}/dependentlibs.list
295 %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/lib{ldap,ldif,prldap}60.so
297 # remove unecessary stuff
298 %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/removed-files
301 rm -rf $RPM_BUILD_ROOT
304 if [ -d %{_libdir}/%{name}/dictionaries ] && [ ! -L %{_libdir}/%{name}/dictionaries ]; then
305 mv -v %{_libdir}/%{name}/dictionaries{,.rpmsave}
307 for d in chrome defaults icons isp modules res; do
308 if [ -d %{_libdir}/%{name}/$d ] && [ ! -L %{_libdir}/%{name}/$d ]; then
309 install -d %{_datadir}/%{name}
310 mv %{_libdir}/%{name}/$d %{_datadir}/%{name}/$d
316 %update_desktop_database_post
317 # make temporary HOME, as it attempts to touch files in $HOME/.mozilla
318 # dangerous if you run this with sudo with keep_env += HOME
319 # also TMPDIR could be pointing to sudo user's homedir so we reset that too.
320 export HOME=$(mktemp -d)
321 unset TMPDIR TMP || :
323 %{_libdir}/%{name}/thunderbird -register
327 %update_desktop_database_postun
330 %defattr(644,root,root,755)
331 %attr(755,root,root) %{_bindir}/%{name}
332 %dir %{_libdir}/%{name}
333 %dir %{_libdir}/%{name}/plugins
336 %dir %{_libdir}/%{name}/gtk2
337 %attr(755,root,root) %{_libdir}/%{name}/gtk2/libmozgtk.so
338 %attr(755,root,root) %{_libdir}/%{name}/libmozgtk.so
340 %attr(755,root,root) %{_libdir}/%{name}/liblgpllibs.so
341 %{?with_shared_js:%attr(755,root,root) %{_libdir}/%{name}/libmozjs.so}
342 %attr(755,root,root) %{_libdir}/%{name}/libmozsandbox.so
343 %attr(755,root,root) %{_libdir}/%{name}/libxul.so
344 %attr(755,root,root) %{_libdir}/%{name}/*.sh
345 %attr(755,root,root) %{_libdir}/%{name}/*-bin
346 %attr(755,root,root) %{_libdir}/%{name}/plugin-container
347 %attr(755,root,root) %{_libdir}/%{name}/thunderbird
349 %{_libdir}/%{name}/application.ini
350 %{_libdir}/%{name}/blocklist.xml
351 %{_libdir}/%{name}/dependentlibs.list
352 %{_libdir}/%{name}/omni.ja
353 %{_libdir}/%{name}/platform.ini
354 %{!?with_system_icu:%{_libdir}/%{name}/icudt58l.dat}
356 %dir %{_libdir}/%{name}/fonts
357 %{_libdir}/%{name}/fonts/EmojiOneMozilla.ttf
359 %if %{with crashreporter}
360 %attr(755,root,root) %{_libdir}/%{name}/crashreporter
361 %{_libdir}/%{name}/crashreporter.ini
362 %{_libdir}/%{name}/Throbber-small.gif
365 %dir %{_libdir}/%{name}/extensions
366 %{_libdir}/%{name}/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}.xpi
368 %dir %{_libdir}/%{name}/distribution
369 %dir %{_libdir}/%{name}/distribution/extensions
372 %{_libdir}/%{name}/chrome
373 %{_libdir}/%{name}/defaults
374 %{_libdir}/%{name}/dictionaries
375 %{_libdir}/%{name}/hyphenation
376 %{_libdir}/%{name}/isp
379 %{_desktopdir}/*.desktop
381 %dir %{_datadir}/%{name}
382 %{_datadir}/%{name}/chrome
383 %{_datadir}/%{name}/defaults
384 %{_datadir}/%{name}/isp
386 %if %{with lightning}
387 %files addon-lightning
388 %defattr(644,root,root,755)
389 %dir %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}
390 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/app.ini
391 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/chrome.jar
392 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/chrome.manifest
393 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/defaults
394 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/install.rdf
395 %dir %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components
396 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.js
397 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*manifest
398 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.xpt
399 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/modules
400 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/calendar-js
401 %dir %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/timezones
402 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/timezones/zones.json