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_with crashreporter # report crashes to crash-stats.mozilla.com
11 # - disabled shared_js - https://bugzilla.mozilla.org/show_bug.cgi?id=1039964
12 %bcond_with shared_js # shared libmozjs library [broken]
13 %bcond_with system_icu # build with system ICU (disabled due to crashes with system icu 58.2)
15 %if 0%{?_enable_debug_packages} != 1
16 %undefine crashreporter
19 %define nspr_ver 4.13.1
20 %define nss_ver 3.28.1
22 # The actual sqlite version (see RHBZ#480989):
23 %define sqlite_build_version %(pkg-config --silence-errors --modversion sqlite3 2>/dev/null || echo ERROR)
25 Summary: Thunderbird - email client
26 Summary(pl.UTF-8): Thunderbird - klient poczty
31 Group: X11/Applications/Mail
32 Source0: http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/%{version}/source/%{name}-%{version}.source.tar.xz
33 # Source0-md5: e66a1f513258a515089eed70a7d2a509
34 Source1: %{name}.desktop
37 Patch1: no-subshell.patch
38 Patch2: enable-addons.patch
39 Patch3: mozilla-1245783.patch
40 URL: http://www.mozilla.org/projects/thunderbird/
41 BuildRequires: GConf2-devel >= 1.2.1
42 BuildRequires: alsa-lib-devel
43 BuildRequires: automake
44 BuildRequires: bzip2-devel
45 BuildRequires: cairo-devel >= 1.10
46 BuildRequires: dbus-glib-devel >= 0.60
47 BuildRequires: freetype-devel >= 1:2.1.8
48 BuildRequires: glib2-devel >= 1:2.20
49 BuildRequires: gstreamer0.10-devel
50 BuildRequires: gstreamer0.10-plugins-base-devel
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: libIDL-devel >= 0.8.0
55 BuildRequires: libevent-devel
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 >= 1.4.1
62 BuildRequires: libstdc++-devel
63 BuildRequires: libvpx-devel >= 1.3.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: pkgconfig
70 BuildRequires: python >= 1:2.5
71 BuildRequires: python-virtualenv
72 BuildRequires: sed >= 4.0
73 BuildRequires: sqlite3-devel >= 3.8.4.2
74 BuildRequires: startup-notification-devel >= 0.8
75 BuildRequires: virtualenv
76 BuildRequires: xorg-lib-libXext-devel
77 BuildRequires: xorg-lib-libXinerama-devel
78 BuildRequires: xorg-lib-libXt-devel
81 Requires: glib2 >= 1:2.20
82 %{!?with_gtk3:Requires: gtk+2 >= 2:2.18.0}
83 %{?with_gtk3:Requires: gtk+3 >= 3.4.0}
84 Requires: libvpx >= 1.3.0
85 Requires: myspell-common
86 Requires: nspr >= 1:%{nspr_ver}
87 Requires: nss >= 1:%{nss_ver}
88 Requires: pango >= 1:1.22.0
89 Requires: sqlite3 >= %{sqlite_build_version}
90 Requires(post): mktemp >= 1.5-18
91 Requires: libjpeg-turbo
93 Obsoletes: mozilla-thunderbird
94 Obsoletes: mozilla-thunderbird-dictionary-en-US
95 Conflicts: thunderbird-lang-resources < %{version}
96 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
98 %define filterout_cpp -D_FORTIFY_SOURCE=[0-9]+
100 # firefox/thunderbird/seamonkey provide their own versions
101 %define _noautoprovfiles %{_libdir}/%{name}/components
103 # we don't want these to satisfy packages depending on xulrunner
104 %define _noautoprov libmozalloc.so libmozjs.so libxul.so
105 # and as we don't provide them, don't require either
106 %define _noautoreq libmozalloc.so libmozjs.so libxul.so
108 %define topdir %{_builddir}/thunderbird-%{version}
109 %define objdir %{topdir}/obj-%{_target_cpu}
112 Thunderbird is an open-source, fast and portable email client.
114 %description -l pl.UTF-8
115 Thunderbird jest mającym otwarte źródła, szybkim i przenośnym klientem
118 %package addon-lightning
119 Summary: An integrated calendar for Thunderbird
120 Summary(pl.UTF-8): Zintegrowany kalendarz dla Thunderbird
121 License: MPL 1.1 or GPL v2+ or LGPL v2.1+
122 Group: Applications/Networking
123 Requires: %{name} = %{version}-%{release}
124 Obsoletes: icedove-addon-lightning
126 %description addon-lightning
127 Lightning is an calendar extension to Thunderbird email client.
129 %description addon-lightning -l pl.UTF-8
130 Lightning to rozszerzenie do klienta poczty Thunderbird dodające
131 funkcjonalność kalendarza.
141 cat << EOF > .mozconfig
142 mk_add_options MOZ_OBJDIR=%{objdir}
144 %if %{with crashreporter}
145 export MOZ_DEBUG_SYMBOLS=1
148 # Options for 'configure' (same as command-line options).
149 ac_add_options --prefix=%{_prefix}
151 ac_add_options --disable-optimize
152 ac_add_options --enable-debug
153 ac_add_options --enable-debug-modules
154 ac_add_options --enable-debugger-info-modules
155 ac_add_options --enable-crash-on-assert
157 ac_add_options --disable-debug
158 ac_add_options --enable-optimize="%{rpmcflags} -Os"
160 ac_add_options --disable-strip
161 ac_add_options --disable-install-strip
163 ac_add_options --enable-tests
164 ac_add_options --enable-mochitest
166 ac_add_options --disable-tests
168 %if %{with lightning}
169 ac_add_options --enable-calendar
171 ac_add_options --disable-calendar
173 %if %{with crashreporter}
174 ac_add_options --enable-crashreporter
176 ac_add_options --disable-crashreporter
178 #ac_add_options --disable-elf-hack
179 ac_add_options --disable-gconf
180 ac_add_options --disable-gnomeui
181 ac_add_options --disable-necko-wifi
182 ac_add_options --disable-updater
183 ac_add_options --enable-alsa
184 ac_add_options --enable-chrome-format=omni
185 ac_add_options --enable-application=mail
186 ac_add_options --enable-default-toolkit=%{?with_gtk3:cairo-gtk3}%{!?with_gtk3:cairo-gtk2}
187 ac_add_options --enable-gio
188 ac_add_options --enable-readline
190 ac_add_options --enable-ldap
192 ac_add_options --disable-ldap
194 %{?with_shared_js:ac_add_options --enable-shared-js}
195 ac_add_options --enable-startup-notification
196 ac_add_options --enable-system-cairo
197 ac_add_options --enable-system-ffi
198 ac_add_options --enable-system-hunspell
199 ac_add_options --enable-system-sqlite
200 ac_add_options --enable-url-classifier
201 ac_add_options --with-default-mozilla-five-home=%{_libdir}/%{name}
202 ac_add_options --with-distribution-id=org.pld-linux
203 ac_add_options --with-pthreads
204 ac_add_options --with-system-bz2
205 ac_add_options --with%{!?with_system_icu:out}-system-icu
206 ac_add_options --with-system-jpeg
207 ac_add_options --with-system-libevent
208 ac_add_options --with-system-libvpx
209 ac_add_options --with-system-nspr
210 ac_add_options --with-system-nss
211 ac_add_options --with-system-png
212 ac_add_options --with-system-zlib
213 ac_add_options --with-x
216 mkdir -p %{objdir}/config
217 ln -sf %{topdir}/mozilla/config/*.mk %{objdir}/config
219 %{__make} -j1 -f client.mk build \
220 AUTOCONF=/usr/bin/autoconf2_13 \
221 MOZ_MAKE_FLAGS="%{_smp_mflags}"
223 %if %{with crashreporter}
224 # create debuginfo for crash-stats.mozilla.com
225 %{__make} -j1 -C obj-%{_target_cpu} buildsymbols
229 rm -rf $RPM_BUILD_ROOT
230 install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/%{name}/plugins,%{_datadir}/%{name},%{_pixmapsdir},%{_desktopdir}}
233 %{__make} -C mail/installer stage-package \
234 DESTDIR=$RPM_BUILD_ROOT \
235 installdir=%{_libdir}/%{name} \
238 cp -a dist/thunderbird/* $RPM_BUILD_ROOT%{_libdir}/%{name}/
240 # Enable crash reporter for Thunderbird application
241 %if %{with crashreporter}
242 %{__sed} -i -e 's/\[Crash Reporter\]/[Crash Reporter]\nEnabled=1/' $RPM_BUILD_ROOT%{_libdir}/%{name}/application.ini
244 # Add debuginfo for crash-stats.mozilla.com
245 install -d $RPM_BUILD_ROOT%{_exec_prefix}/lib/debug%{_libdir}/%{name}
246 cp -a dist/%{name}-%{version}.en-US.linux-*.crashreporter-symbols.zip $RPM_BUILD_ROOT%{_prefix}/lib/debug%{_libdir}/%{name}
249 %{__sed} -e 's,@LIBDIR@,%{_libdir},' %{SOURCE2} > $RPM_BUILD_ROOT%{_bindir}/%{name}
250 cp -p dist/thunderbird/chrome/icons/default/default48.png $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
251 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
254 %{__rm} -rv $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
255 ln -s %{_datadir}/myspell $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
256 ln -s %{_datadir}/myspell $RPM_BUILD_ROOT%{_libdir}/%{name}/hyphenation
258 # move arch independant ones to datadir
259 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/chrome $RPM_BUILD_ROOT%{_datadir}/%{name}/chrome
260 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/defaults $RPM_BUILD_ROOT%{_datadir}/%{name}/defaults
261 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/isp $RPM_BUILD_ROOT%{_datadir}/%{name}/isp
262 ln -s ../../share/%{name}/chrome $RPM_BUILD_ROOT%{_libdir}/%{name}/chrome
263 ln -s ../../share/%{name}/defaults $RPM_BUILD_ROOT%{_libdir}/%{name}/defaults
264 ln -s ../../share/%{name}/isp $RPM_BUILD_ROOT%{_libdir}/%{name}/isp
267 %{__sed} -i '/lib\(ldap\|ldif\|prldap\)60.so/d' $RPM_BUILD_ROOT%{_libdir}/%{name}/dependentlibs.list
268 %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/lib{ldap,ldif,prldap}60.so
270 # remove unecessary stuff
271 %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/removed-files
274 rm -rf $RPM_BUILD_ROOT
277 if [ -d %{_libdir}/%{name}/dictionaries ] && [ ! -L %{_libdir}/%{name}/dictionaries ]; then
278 mv -v %{_libdir}/%{name}/dictionaries{,.rpmsave}
280 for d in chrome defaults icons isp modules res; do
281 if [ -d %{_libdir}/%{name}/$d ] && [ ! -L %{_libdir}/%{name}/$d ]; then
282 install -d %{_datadir}/%{name}
283 mv %{_libdir}/%{name}/$d %{_datadir}/%{name}/$d
289 %update_desktop_database_post
290 # make temporary HOME, as it attempts to touch files in $HOME/.mozilla
291 # dangerous if you run this with sudo with keep_env += HOME
292 # also TMPDIR could be pointing to sudo user's homedir so we reset that too.
293 export HOME=$(mktemp -d)
294 unset TMPDIR TMP || :
296 %{_libdir}/%{name}/thunderbird -register
300 %update_desktop_database_postun
303 %defattr(644,root,root,755)
304 %attr(755,root,root) %{_bindir}/%{name}
305 %dir %{_libdir}/%{name}
306 %dir %{_libdir}/%{name}/plugins
309 %dir %{_libdir}/%{name}/gtk2
310 %attr(755,root,root) %{_libdir}/%{name}/gtk2/libmozgtk.so
311 %attr(755,root,root) %{_libdir}/%{name}/libmozgtk.so
313 %attr(755,root,root) %{_libdir}/%{name}/liblgpllibs.so
314 %{?with_shared_js:%attr(755,root,root) %{_libdir}/%{name}/libmozjs.so}
315 %attr(755,root,root) %{_libdir}/%{name}/libmozsandbox.so
316 %attr(755,root,root) %{_libdir}/%{name}/libxul.so
317 %attr(755,root,root) %{_libdir}/%{name}/*.sh
318 %attr(755,root,root) %{_libdir}/%{name}/*-bin
319 %attr(755,root,root) %{_libdir}/%{name}/plugin-container
320 %attr(755,root,root) %{_libdir}/%{name}/thunderbird
322 %{_libdir}/%{name}/application.ini
323 %{_libdir}/%{name}/blocklist.xml
324 %{_libdir}/%{name}/dependentlibs.list
325 %{_libdir}/%{name}/omni.ja
326 %{_libdir}/%{name}/platform.ini
327 %{!?with_system_icu:%{_libdir}/%{name}/icudt58l.dat}
329 %dir %{_libdir}/%{name}/fonts
330 %{_libdir}/%{name}/fonts/EmojiOneMozilla.ttf
332 %if %{with crashreporter}
333 %attr(755,root,root) %{_libdir}/%{name}/crashreporter
334 %{_libdir}/%{name}/crashreporter.ini
335 %{_libdir}/%{name}/Throbber-small.gif
338 %dir %{_libdir}/%{name}/extensions
339 %{_libdir}/%{name}/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}.xpi
341 %dir %{_libdir}/%{name}/distribution
342 %dir %{_libdir}/%{name}/distribution/extensions
345 %{_libdir}/%{name}/chrome
346 %{_libdir}/%{name}/defaults
347 %{_libdir}/%{name}/dictionaries
348 %{_libdir}/%{name}/hyphenation
349 %{_libdir}/%{name}/isp
352 %{_desktopdir}/*.desktop
354 %dir %{_datadir}/%{name}
355 %{_datadir}/%{name}/chrome
356 %{_datadir}/%{name}/defaults
357 %{_datadir}/%{name}/isp
359 %if %{with lightning}
360 %files addon-lightning
361 %defattr(644,root,root,755)
362 %dir %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}
363 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/app.ini
364 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/chrome.jar
365 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/chrome.manifest
366 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/defaults
367 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/install.rdf
368 %dir %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components
369 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.js
370 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*manifest
371 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.xpt
372 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/modules
373 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/calendar-js
374 %dir %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/timezones
375 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/timezones/zones.json