2 # - build with system mozldap
3 # - fix startup crash "TypeError: a is null"
6 %bcond_without gtk3 # GTK+ 3.x instead of 2.x
7 %bcond_without ldap # disable e-mail address lookups in LDAP directories
8 %bcond_without lightning # disable Sunbird/Lightning calendar
9 %bcond_with crashreporter # report crashes to crash-stats.mozilla.com
10 # - disabled shared_js - https://bugzilla.mozilla.org/show_bug.cgi?id=1039964
11 %bcond_with shared_js # shared libmozjs library [broken]
12 %bcond_with system_icu # build with system ICU (disabled due to crashes with system icu 58.2)
14 %if 0%{?_enable_debug_packages} != 1
15 %undefine crashreporter
18 %define nspr_ver 4.10.6
19 %define nss_ver 3.19.2.1
21 # The actual sqlite version (see RHBZ#480989):
22 %define sqlite_build_version %(pkg-config --silence-errors --modversion sqlite3 2>/dev/null || echo ERROR)
24 Summary: Thunderbird - email client
25 Summary(pl.UTF-8): Thunderbird - klient poczty
30 Group: X11/Applications/Mail
31 Source0: http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/%{version}/source/%{name}-%{version}.source.tar.xz
32 # Source0-md5: e66a1f513258a515089eed70a7d2a509
33 Source1: %{name}.desktop
36 Patch1: no-subshell.patch
37 Patch2: enable-addons.patch
38 Patch3: 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
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
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)
97 %define filterout_cpp -D_FORTIFY_SOURCE=[0-9]+
99 # firefox/thunderbird/seamonkey provide their own versions
100 %define _noautoprovfiles %{_libdir}/%{name}/components
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
107 %define topdir %{_builddir}/thunderbird-%{version}
108 %define objdir %{topdir}/obj-%{_target_cpu}
111 Thunderbird is an open-source, fast and portable email client.
113 %description -l pl.UTF-8
114 Thunderbird jest mającym otwarte źródła, szybkim i przenośnym klientem
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
125 %description addon-lightning
126 Lightning is an calendar extension to Thunderbird email client.
128 %description addon-lightning -l pl.UTF-8
129 Lightning to rozszerzenie do klienta poczty Thunderbird dodające
130 funkcjonalność kalendarza.
140 cat << EOF > .mozconfig
141 mk_add_options MOZ_OBJDIR=%{objdir}
143 %if %{with crashreporter}
144 export MOZ_DEBUG_SYMBOLS=1
147 # Options for 'configure' (same as command-line options).
148 ac_add_options --prefix=%{_prefix}
150 ac_add_options --disable-optimize
151 ac_add_options --enable-debug
152 ac_add_options --enable-debug-modules
153 ac_add_options --enable-debugger-info-modules
154 ac_add_options --enable-crash-on-assert
156 ac_add_options --disable-debug
157 ac_add_options --enable-optimize="%{rpmcflags} -Os"
159 ac_add_options --disable-strip
160 ac_add_options --disable-install-strip
162 ac_add_options --enable-tests
163 ac_add_options --enable-mochitest
165 ac_add_options --disable-tests
167 %if %{with lightning}
168 ac_add_options --enable-calendar
170 ac_add_options --disable-calendar
172 %if %{with crashreporter}
173 ac_add_options --enable-crashreporter
175 ac_add_options --disable-crashreporter
177 #ac_add_options --disable-elf-dynstr-gc
178 #ac_add_options --disable-elf-hack
179 ac_add_options --disable-gnomeui
180 ac_add_options --disable-updater
181 ac_add_options --enable-application=mail
182 ac_add_options --enable-default-toolkit=%{?with_gtk3:cairo-gtk3}%{!?with_gtk3:cairo-gtk2}
183 ac_add_options --enable-gio
185 ac_add_options --enable-ldap
187 ac_add_options --disable-ldap
189 %{?with_shared_js:ac_add_options --enable-shared-js}
190 ac_add_options --enable-startup-notification
191 ac_add_options --enable-system-cairo
192 ac_add_options --enable-system-ffi
193 ac_add_options --enable-system-hunspell
194 ac_add_options --enable-system-sqlite
195 ac_add_options --enable-url-classifier
196 ac_add_options --with-default-mozilla-five-home=%{_libdir}/%{name}
197 ac_add_options --with-distribution-id=org.pld-linux
198 ac_add_options --with-pthreads
199 ac_add_options --with-system-bz2
200 ac_add_options --with%{!?with_system_icu:out}-system-icu
201 ac_add_options --with-system-jpeg
202 ac_add_options --with-system-libevent
203 ac_add_options --with-system-libvpx
204 ac_add_options --with-system-nspr
205 ac_add_options --with-system-nss
206 ac_add_options --with-system-png
207 ac_add_options --with-system-zlib
208 ac_add_options --with-x
211 mkdir -p %{objdir}/config
212 ln -sf %{topdir}/mozilla/config/*.mk %{objdir}/config
214 %{__make} -j1 -f client.mk build \
215 AUTOCONF=/usr/bin/autoconf2_13 \
216 MOZ_MAKE_FLAGS="%{_smp_mflags}"
218 %if %{with crashreporter}
219 # create debuginfo for crash-stats.mozilla.com
220 %{__make} -j1 -C obj-%{_target_cpu} buildsymbols
224 rm -rf $RPM_BUILD_ROOT
225 install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/%{name}/plugins,%{_datadir}/%{name},%{_pixmapsdir},%{_desktopdir}}
228 %{__make} -C mail/installer stage-package \
229 DESTDIR=$RPM_BUILD_ROOT \
230 installdir=%{_libdir}/%{name} \
233 cp -a dist/thunderbird/* $RPM_BUILD_ROOT%{_libdir}/%{name}/
235 # Enable crash reporter for Thunderbird application
236 %if %{with crashreporter}
237 %{__sed} -i -e 's/\[Crash Reporter\]/[Crash Reporter]\nEnabled=1/' $RPM_BUILD_ROOT%{_libdir}/%{name}/application.ini
239 # Add debuginfo for crash-stats.mozilla.com
240 install -d $RPM_BUILD_ROOT%{_exec_prefix}/lib/debug%{_libdir}/%{name}
241 cp -a dist/%{name}-%{version}.en-US.linux-*.crashreporter-symbols.zip $RPM_BUILD_ROOT%{_prefix}/lib/debug%{_libdir}/%{name}
244 %{__sed} -e 's,@LIBDIR@,%{_libdir},' %{SOURCE2} > $RPM_BUILD_ROOT%{_bindir}/%{name}
245 cp -p dist/thunderbird/chrome/icons/default/default48.png $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
246 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
249 %{__rm} -rv $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
250 ln -s %{_datadir}/myspell $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
251 ln -s %{_datadir}/myspell $RPM_BUILD_ROOT%{_libdir}/%{name}/hyphenation
253 # move arch independant ones to datadir
254 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/chrome $RPM_BUILD_ROOT%{_datadir}/%{name}/chrome
255 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/defaults $RPM_BUILD_ROOT%{_datadir}/%{name}/defaults
256 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/isp $RPM_BUILD_ROOT%{_datadir}/%{name}/isp
257 ln -s ../../share/%{name}/chrome $RPM_BUILD_ROOT%{_libdir}/%{name}/chrome
258 ln -s ../../share/%{name}/defaults $RPM_BUILD_ROOT%{_libdir}/%{name}/defaults
259 ln -s ../../share/%{name}/isp $RPM_BUILD_ROOT%{_libdir}/%{name}/isp
262 %{__sed} -i '/lib\(ldap\|ldif\|prldap\)60.so/d' $RPM_BUILD_ROOT%{_libdir}/%{name}/dependentlibs.list
263 %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/lib{ldap,ldif,prldap}60.so
265 # remove unecessary stuff
266 %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/removed-files
269 rm -rf $RPM_BUILD_ROOT
272 if [ -d %{_libdir}/%{name}/dictionaries ] && [ ! -L %{_libdir}/%{name}/dictionaries ]; then
273 mv -v %{_libdir}/%{name}/dictionaries{,.rpmsave}
275 for d in chrome defaults icons isp modules res; do
276 if [ -d %{_libdir}/%{name}/$d ] && [ ! -L %{_libdir}/%{name}/$d ]; then
277 install -d %{_datadir}/%{name}
278 mv %{_libdir}/%{name}/$d %{_datadir}/%{name}/$d
284 %update_desktop_database_post
285 # make temporary HOME, as it attempts to touch files in $HOME/.mozilla
286 # dangerous if you run this with sudo with keep_env += HOME
287 # also TMPDIR could be pointing to sudo user's homedir so we reset that too.
288 export HOME=$(mktemp -d)
289 unset TMPDIR TMP || :
291 %{_libdir}/%{name}/thunderbird -register
295 %update_desktop_database_postun
298 %defattr(644,root,root,755)
299 %attr(755,root,root) %{_bindir}/%{name}
300 %dir %{_libdir}/%{name}
301 %dir %{_libdir}/%{name}/plugins
304 %dir %{_libdir}/%{name}/gtk2
305 %attr(755,root,root) %{_libdir}/%{name}/gtk2/libmozgtk.so
306 %attr(755,root,root) %{_libdir}/%{name}/libmozgtk.so
308 %attr(755,root,root) %{_libdir}/%{name}/liblgpllibs.so
309 %{?with_shared_js:%attr(755,root,root) %{_libdir}/%{name}/libmozjs.so}
310 %attr(755,root,root) %{_libdir}/%{name}/libmozsandbox.so
311 %attr(755,root,root) %{_libdir}/%{name}/libxul.so
312 %attr(755,root,root) %{_libdir}/%{name}/*.sh
313 %attr(755,root,root) %{_libdir}/%{name}/*-bin
314 %attr(755,root,root) %{_libdir}/%{name}/plugin-container
315 %attr(755,root,root) %{_libdir}/%{name}/thunderbird
317 %{_libdir}/%{name}/application.ini
318 %{_libdir}/%{name}/blocklist.xml
319 %{_libdir}/%{name}/dependentlibs.list
320 %{_libdir}/%{name}/omni.ja
321 %{_libdir}/%{name}/platform.ini
322 %{!?with_system_icu:%{_libdir}/%{name}/icudt58l.dat}
324 %dir %{_libdir}/%{name}/fonts
325 %{_libdir}/%{name}/fonts/EmojiOneMozilla.ttf
327 %if %{with crashreporter}
328 %attr(755,root,root) %{_libdir}/%{name}/crashreporter
329 %{_libdir}/%{name}/crashreporter.ini
330 %{_libdir}/%{name}/Throbber-small.gif
333 %dir %{_libdir}/%{name}/extensions
334 %{_libdir}/%{name}/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}.xpi
336 %dir %{_libdir}/%{name}/distribution
337 %dir %{_libdir}/%{name}/distribution/extensions
340 %{_libdir}/%{name}/chrome
341 %{_libdir}/%{name}/defaults
342 %{_libdir}/%{name}/dictionaries
343 %{_libdir}/%{name}/hyphenation
344 %{_libdir}/%{name}/isp
347 %{_desktopdir}/*.desktop
349 %dir %{_datadir}/%{name}
350 %{_datadir}/%{name}/chrome
351 %{_datadir}/%{name}/defaults
352 %{_datadir}/%{name}/isp
354 %if %{with lightning}
355 %files addon-lightning
356 %defattr(644,root,root,755)
357 %dir %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}
358 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/app.ini
359 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/chrome.jar
360 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/chrome.manifest
361 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/defaults
362 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/install.rdf
363 %dir %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components
364 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.js
365 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*manifest
366 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.xpt
367 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/modules
368 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/calendar-js
369 %dir %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/timezones
370 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/timezones/zones.json