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_with 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 BuildRequires: dbus-glib-devel >= 0.60
48 BuildRequires: fontconfig-devel >= 2.7.0
49 BuildRequires: freetype-devel >= 1:2.1.8
50 BuildRequires: glib2-devel >= 1:2.22
51 %{!?with_gtk3:BuildRequires: gtk+2-devel >= 2:2.18.0}
52 %{?with_gtk3:BuildRequires: gtk+3-devel >= 3.4.0}
53 BuildRequires: hunspell-devel
54 BuildRequires: libatomic-devel
55 BuildRequires: libevent-devel
56 BuildRequires: libffi-devel > 3.0.9
57 %{?with_system_icu:BuildRequires: libicu-devel >= 58.1}
58 BuildRequires: libiw-devel
59 # requires libjpeg-turbo implementing at least libjpeg 6b API
60 BuildRequires: libjpeg-devel >= 6b
61 BuildRequires: libjpeg-turbo-devel
62 BuildRequires: libpng-devel >= 2:1.6.25
63 BuildRequires: libstdc++-devel
64 BuildRequires: libvpx-devel >= 1.5.0
65 BuildRequires: mozldap-devel
66 BuildRequires: nspr-devel >= 1:%{nspr_ver}
67 BuildRequires: nss-devel >= 1:%{nss_ver}
68 BuildRequires: pango-devel >= 1:1.22.0
69 BuildRequires: perl-base >= 1:5.6
70 BuildRequires: pixman-devel >= 0.19.2
71 BuildRequires: pkgconfig
72 BuildRequires: python >= 1:2.7
73 BuildRequires: python-virtualenv
74 BuildRequires: sed >= 4.0
75 BuildRequires: sqlite3-devel >= 3.17.0
76 BuildRequires: startup-notification-devel >= 0.8
77 BuildRequires: virtualenv
78 BuildRequires: xorg-lib-libX11-devel
79 BuildRequires: xorg-lib-libXcomposite-devel
80 BuildRequires: xorg-lib-libXdamage-devel
81 BuildRequires: xorg-lib-libXext-devel
82 BuildRequires: xorg-lib-libXfixes-devel
83 BuildRequires: xorg-lib-libXt-devel
84 %ifarch %{ix86} %{x8664}
85 BuildRequires: yasm >= 1.0.1
88 BuildRequires: zlib-devel >= 1.2.3
89 Requires(post): mktemp >= 1.5-18
90 Requires: dbus-glib >= 0.60
91 Requires: glib2 >= 1:2.22
92 %{!?with_gtk3:Requires: gtk+2 >= 2:2.18.0}
93 %{?with_gtk3:Requires: gtk+3 >= 3.4.0}
94 Requires: libpng >= 2:1.6.25
95 Requires: libvpx >= 1.5.0
96 Requires: myspell-common
97 Requires: nspr >= 1:%{nspr_ver}
98 Requires: nss >= 1:%{nss_ver}
99 Requires: pango >= 1:1.22.0
100 Requires: sqlite3 >= %{sqlite_build_version}
101 Requires: startup-notification >= 0.8
102 Requires: libjpeg-turbo
104 Obsoletes: mozilla-thunderbird
105 Obsoletes: mozilla-thunderbird-dictionary-en-US
106 Conflicts: thunderbird-lang-resources < %{version}
107 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
109 %define filterout_cpp -D_FORTIFY_SOURCE=[0-9]+
112 %define filterout -fvar-tracking-assignments
115 # firefox/thunderbird/seamonkey provide their own versions
116 %define _noautoprovfiles %{_libdir}/%{name}/components
118 # we don't want these to satisfy packages depending on xulrunner
119 %define _noautoprov libmozalloc.so libmozjs.so libxul.so
120 # and as we don't provide them, don't require either
121 %define _noautoreq libmozalloc.so libmozjs.so libxul.so
123 %define topdir %{_builddir}/thunderbird-%{version}
124 %define objdir %{topdir}/obj-%{_target_cpu}
127 Thunderbird is an open-source, fast and portable email client.
129 %description -l pl.UTF-8
130 Thunderbird jest mającym otwarte źródła, szybkim i przenośnym klientem
133 %package addon-lightning
134 Summary: An integrated calendar for Thunderbird
135 Summary(pl.UTF-8): Zintegrowany kalendarz dla Thunderbird
136 License: MPL 1.1 or GPL v2+ or LGPL v2.1+
137 Group: Applications/Networking
138 Requires: %{name} = %{version}-%{release}
139 Obsoletes: icedove-addon-lightning
141 %description addon-lightning
142 Lightning is an calendar extension to Thunderbird email client.
144 %description addon-lightning -l pl.UTF-8
145 Lightning to rozszerzenie do klienta poczty Thunderbird dodające
146 funkcjonalność kalendarza.
156 cat << EOF > .mozconfig
157 mk_add_options MOZ_OBJDIR=%{objdir}
164 export CXX="%{__cxx}"
166 export CFLAGS="%{rpmcflags} -D_FILE_OFFSET_BITS=64"
167 export CXXFLAGS="%{rpmcxxflags} -D_FILE_OFFSET_BITS=64"
169 %if %{with crashreporter}
170 export MOZ_DEBUG_SYMBOLS=1
173 # Options for 'configure' (same as command-line options).
174 ac_add_options --prefix=%{_prefix}
176 ac_add_options --disable-optimize
177 ac_add_options --enable-debug
178 ac_add_options --enable-debug-modules
179 ac_add_options --enable-debugger-info-modules
180 ac_add_options --enable-crash-on-assert
182 ac_add_options --disable-debug
183 ac_add_options --enable-optimize="%{rpmcflags} -Os"
185 ac_add_options --disable-strip
186 ac_add_options --disable-install-strip
188 ac_add_options --enable-tests
189 ac_add_options --enable-mochitest
191 ac_add_options --disable-tests
193 %if %{with lightning}
194 ac_add_options --enable-calendar
196 ac_add_options --disable-calendar
198 %if %{with crashreporter}
199 ac_add_options --enable-crashreporter
201 ac_add_options --disable-crashreporter
203 #ac_add_options --disable-elf-hack
204 ac_add_options --disable-gconf
205 ac_add_options --disable-gnomeui
206 ac_add_options --disable-necko-wifi
207 ac_add_options --disable-updater
208 ac_add_options --enable-alsa
209 ac_add_options --enable-application=mail
210 ac_add_options --enable-chrome-format=omni
211 ac_add_options --enable-default-toolkit=%{?with_gtk3:cairo-gtk3}%{!?with_gtk3:cairo-gtk2}
212 ac_add_options --enable-gio
214 ac_add_options --enable-ldap
216 ac_add_options --disable-ldap
218 %{?with_official:ac_add_options --enable-official-branding}
219 ac_add_options --enable-readline
220 %{?with_shared_js:ac_add_options --enable-shared-js}
221 ac_add_options --enable-startup-notification
222 ac_add_options --enable-system-cairo
223 ac_add_options --enable-system-ffi
224 ac_add_options --enable-system-hunspell
225 ac_add_options --enable-system-sqlite
226 ac_add_options --enable-url-classifier
227 ac_add_options --with-default-mozilla-five-home=%{_libdir}/%{name}
228 ac_add_options --with-distribution-id=org.pld-linux
229 ac_add_options --with-pthreads
230 ac_add_options --with-system-bz2
231 ac_add_options --with%{!?with_system_icu:out}-system-icu
232 ac_add_options --with-system-jpeg
233 ac_add_options --with-system-libevent
234 ac_add_options --with-system-libvpx
235 ac_add_options --with-system-nspr
236 ac_add_options --with-system-nss
237 ac_add_options --with-system-png
238 ac_add_options --with-system-zlib
239 ac_add_options --with-x
242 mkdir -p %{objdir}/config
243 ln -sf %{topdir}/mozilla/config/*.mk %{objdir}/config
245 %{__make} -j1 -f client.mk build \
246 AUTOCONF=/usr/bin/autoconf2_13 \
247 MOZ_MAKE_FLAGS="%{_smp_mflags}"
249 %if %{with crashreporter}
250 # create debuginfo for crash-stats.mozilla.com
251 %{__make} -j1 -C obj-%{_target_cpu} buildsymbols
255 rm -rf $RPM_BUILD_ROOT
256 install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/%{name}/plugins,%{_datadir}/%{name},%{_pixmapsdir},%{_desktopdir}}
259 %{__make} -C mail/installer stage-package \
260 DESTDIR=$RPM_BUILD_ROOT \
261 installdir=%{_libdir}/%{name} \
264 cp -a dist/thunderbird/* $RPM_BUILD_ROOT%{_libdir}/%{name}/
266 # Enable crash reporter for Thunderbird application
267 %if %{with crashreporter}
268 %{__sed} -i -e 's/\[Crash Reporter\]/[Crash Reporter]\nEnabled=1/' $RPM_BUILD_ROOT%{_libdir}/%{name}/application.ini
270 # Add debuginfo for crash-stats.mozilla.com
271 install -d $RPM_BUILD_ROOT%{_exec_prefix}/lib/debug%{_libdir}/%{name}
272 cp -a dist/%{name}-%{version}.en-US.linux-*.crashreporter-symbols.zip $RPM_BUILD_ROOT%{_prefix}/lib/debug%{_libdir}/%{name}
275 %{__sed} -e 's,@LIBDIR@,%{_libdir},' %{SOURCE2} > $RPM_BUILD_ROOT%{_bindir}/%{name}
276 cp -p dist/thunderbird/chrome/icons/default/default48.png $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
277 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
280 %{__rm} -rv $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
281 ln -s %{_datadir}/myspell $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
282 ln -s %{_datadir}/myspell $RPM_BUILD_ROOT%{_libdir}/%{name}/hyphenation
284 # move arch independant ones to datadir
285 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/chrome $RPM_BUILD_ROOT%{_datadir}/%{name}/chrome
286 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/defaults $RPM_BUILD_ROOT%{_datadir}/%{name}/defaults
287 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/isp $RPM_BUILD_ROOT%{_datadir}/%{name}/isp
288 ln -s ../../share/%{name}/chrome $RPM_BUILD_ROOT%{_libdir}/%{name}/chrome
289 ln -s ../../share/%{name}/defaults $RPM_BUILD_ROOT%{_libdir}/%{name}/defaults
290 ln -s ../../share/%{name}/isp $RPM_BUILD_ROOT%{_libdir}/%{name}/isp
293 %{__sed} -i '/lib\(ldap\|ldif\|prldap\)60.so/d' $RPM_BUILD_ROOT%{_libdir}/%{name}/dependentlibs.list
294 %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/lib{ldap,ldif,prldap}60.so
296 # remove unecessary stuff
297 %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/removed-files
300 rm -rf $RPM_BUILD_ROOT
303 if [ -d %{_libdir}/%{name}/dictionaries ] && [ ! -L %{_libdir}/%{name}/dictionaries ]; then
304 mv -v %{_libdir}/%{name}/dictionaries{,.rpmsave}
306 for d in chrome defaults icons isp modules res; do
307 if [ -d %{_libdir}/%{name}/$d ] && [ ! -L %{_libdir}/%{name}/$d ]; then
308 install -d %{_datadir}/%{name}
309 mv %{_libdir}/%{name}/$d %{_datadir}/%{name}/$d
315 %update_desktop_database_post
316 # make temporary HOME, as it attempts to touch files in $HOME/.mozilla
317 # dangerous if you run this with sudo with keep_env += HOME
318 # also TMPDIR could be pointing to sudo user's homedir so we reset that too.
319 export HOME=$(mktemp -d)
320 unset TMPDIR TMP || :
322 %{_libdir}/%{name}/thunderbird -register
326 %update_desktop_database_postun
329 %defattr(644,root,root,755)
330 %attr(755,root,root) %{_bindir}/%{name}
331 %dir %{_libdir}/%{name}
332 %dir %{_libdir}/%{name}/plugins
335 %dir %{_libdir}/%{name}/gtk2
336 %attr(755,root,root) %{_libdir}/%{name}/gtk2/libmozgtk.so
337 %attr(755,root,root) %{_libdir}/%{name}/libmozgtk.so
339 %attr(755,root,root) %{_libdir}/%{name}/liblgpllibs.so
340 %{?with_shared_js:%attr(755,root,root) %{_libdir}/%{name}/libmozjs.so}
341 %attr(755,root,root) %{_libdir}/%{name}/libmozsandbox.so
342 %attr(755,root,root) %{_libdir}/%{name}/libxul.so
343 %attr(755,root,root) %{_libdir}/%{name}/*.sh
344 %attr(755,root,root) %{_libdir}/%{name}/*-bin
345 %attr(755,root,root) %{_libdir}/%{name}/plugin-container
346 %attr(755,root,root) %{_libdir}/%{name}/thunderbird
348 %{_libdir}/%{name}/application.ini
349 %{_libdir}/%{name}/blocklist.xml
350 %{_libdir}/%{name}/dependentlibs.list
351 %{_libdir}/%{name}/omni.ja
352 %{_libdir}/%{name}/platform.ini
353 %{!?with_system_icu:%{_libdir}/%{name}/icudt58l.dat}
355 %dir %{_libdir}/%{name}/fonts
356 %{_libdir}/%{name}/fonts/EmojiOneMozilla.ttf
358 %if %{with crashreporter}
359 %attr(755,root,root) %{_libdir}/%{name}/crashreporter
360 %{_libdir}/%{name}/crashreporter.ini
361 %{_libdir}/%{name}/Throbber-small.gif
364 %dir %{_libdir}/%{name}/extensions
365 %{_libdir}/%{name}/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}.xpi
367 %dir %{_libdir}/%{name}/distribution
368 %dir %{_libdir}/%{name}/distribution/extensions
371 %{_libdir}/%{name}/chrome
372 %{_libdir}/%{name}/defaults
373 %{_libdir}/%{name}/dictionaries
374 %{_libdir}/%{name}/hyphenation
375 %{_libdir}/%{name}/isp
378 %{_desktopdir}/*.desktop
380 %dir %{_datadir}/%{name}
381 %{_datadir}/%{name}/chrome
382 %{_datadir}/%{name}/defaults
383 %{_datadir}/%{name}/isp
385 %if %{with lightning}
386 %files addon-lightning
387 %defattr(644,root,root,755)
388 %dir %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}
389 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/app.ini
390 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/chrome.jar
391 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/chrome.manifest
392 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/defaults
393 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/install.rdf
394 %dir %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components
395 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.js
396 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*manifest
397 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.xpt
398 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/modules
399 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/calendar-js
400 %dir %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/timezones
401 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/timezones/zones.json