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