2 # - build with system mozldap
5 %bcond_with gtk3 # GTK+ 3.x instead of 2.x
6 %bcond_without ldap # disable e-mail address lookups in LDAP directories
7 %bcond_without lightning # disable Sunbird/Lightning calendar
8 %bcond_with xulrunner # system xulrunner
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]
13 %if 0%{?_enable_debug_packages} != 1
14 %undefine crashreporter
17 %define nspr_ver 4.10.6
18 %define nss_ver 3.19.2.1
20 %define xulrunner_ver 2:31.3.0
22 %if %{without xulrunner}
23 # The actual sqlite version (see RHBZ#480989):
24 %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: 4e04b1618273f946f00f8ea547578895
36 Source4: %{name}.desktop
38 Patch2: %{name}-prefs.patch
39 Patch5: %{name}-extensiondir.patch
40 Patch6: no-subshell.patch
41 Patch8: enable-addons.patch
42 Patch9: mozilla-1269171-badalloc.patch
43 URL: http://www.mozilla.org/projects/thunderbird/
44 BuildRequires: GConf2-devel >= 1.2.1
45 BuildRequires: alsa-lib-devel
46 BuildRequires: automake
47 BuildRequires: bzip2-devel
48 BuildRequires: cairo-devel >= 1.10
49 BuildRequires: dbus-glib-devel >= 0.60
50 BuildRequires: freetype-devel >= 1:2.1.8
51 BuildRequires: glib2-devel >= 1:2.20
52 BuildRequires: gstreamer0.10-devel
53 BuildRequires: gstreamer0.10-plugins-base-devel
54 %{!?with_gtk3:BuildRequires: gtk+2-devel >= 2:2.14}
55 %{?with_gtk3:BuildRequires: gtk+3-devel >= 3.0.0}
56 BuildRequires: hunspell-devel
57 BuildRequires: libIDL-devel >= 0.8.0
58 BuildRequires: libevent-devel
59 BuildRequires: libicu-devel >= 50.1
60 BuildRequires: libiw-devel
61 # requires libjpeg-turbo implementing at least libjpeg 6b API
62 BuildRequires: libjpeg-devel >= 6b
63 BuildRequires: libjpeg-turbo-devel
64 BuildRequires: libpng-devel >= 1.4.1
65 BuildRequires: libstdc++-devel
66 BuildRequires: libvpx-devel >= 1.3.0
67 BuildRequires: mozldap-devel
68 BuildRequires: nspr-devel >= 1:%{nspr_ver}
69 BuildRequires: nss-devel >= 1:%{nss_ver}
70 BuildRequires: pango-devel >= 1:1.22.0
71 BuildRequires: perl-base >= 1:5.6
72 BuildRequires: pkgconfig
73 BuildRequires: python >= 1:2.5
74 BuildRequires: python-virtualenv
75 BuildRequires: sed >= 4.0
76 BuildRequires: sqlite3-devel >= 3.8.4.2
77 BuildRequires: startup-notification-devel >= 0.8
78 BuildRequires: virtualenv
79 BuildRequires: xorg-lib-libXext-devel
80 BuildRequires: xorg-lib-libXinerama-devel
81 BuildRequires: xorg-lib-libXt-devel
85 BuildRequires: xulrunner-devel < 2:32
86 BuildRequires: xulrunner-devel >= %{xulrunner_ver}
88 Requires: glib2 >= 1:2.20
89 %{!?with_gtk3:Requires: gtk+2 >= 2:2.14}
90 %{?with_gtk3:Requires: gtk+3 >= 3.0.0}
91 Requires: libvpx >= 1.3.0
92 Requires: myspell-common
93 Requires: nspr >= 1:%{nspr_ver}
94 Requires: nss >= 1:%{nss_ver}
95 Requires: pango >= 1:1.22.0
96 Requires: sqlite3 >= %{sqlite_build_version}
98 Requires(post): mktemp >= 1.5-18
100 %requires_eq_to xulrunner xulrunner-devel
102 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
112 %if %{without xulrunner}
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
119 %define topdir %{_builddir}/thunderbird-%{version}
120 %define objdir %{topdir}/obj-%{_target_cpu}
123 Thunderbird is an open-source, fast and portable email client.
125 %description -l pl.UTF-8
126 Thunderbird jest mającym otwarte źródła, szybkim i przenośnym klientem
129 %package addon-lightning
130 Summary: An integrated calendar for Thunderbird
131 Summary(pl.UTF-8): Zintegrowany kalendarz dla Thunderbird
132 License: MPL 1.1 or GPL v2+ or LGPL v2.1+
133 Group: Applications/Networking
134 Requires: %{name} = %{version}-%{release}
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.
152 cat << EOF > .mozconfig
153 mk_add_options MOZ_OBJDIR=%{objdir}
155 export CFLAGS="%{rpmcflags}"
156 export CXXFLAGS="%{rpmcflags}"
158 %if %{with crashreporter}
159 export MOZ_DEBUG_SYMBOLS=1
162 # Options for 'configure' (same as command-line options).
163 ac_add_options --prefix=%{_prefix}
164 ac_add_options --exec-prefix=%{_exec_prefix}
165 ac_add_options --bindir=%{_bindir}
166 ac_add_options --sbindir=%{_sbindir}
167 ac_add_options --sysconfdir=%{_sysconfdir}
168 ac_add_options --datadir=%{_datadir}
169 ac_add_options --includedir=%{_includedir}
170 ac_add_options --libdir=%{_libdir}
171 ac_add_options --libexecdir=%{_libexecdir}
172 ac_add_options --localstatedir=%{_localstatedir}
173 ac_add_options --sharedstatedir=%{_sharedstatedir}
174 ac_add_options --mandir=%{_mandir}
175 ac_add_options --infodir=%{_infodir}
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 --disable-debug-modules
185 ac_add_options --disable-logging
186 ac_add_options --enable-optimize="%{rpmcflags} -Os"
188 ac_add_options --disable-strip
189 ac_add_options --disable-strip-libs
191 ac_add_options --enable-tests
193 ac_add_options --disable-tests
195 %if %{with lightning}
196 ac_add_options --enable-calendar
198 ac_add_options --disable-calendar
200 %if %{with crashreporter}
201 ac_add_options --enable-crashreporter
203 ac_add_options --disable-crashreporter
205 ac_add_options --disable-elf-dynstr-gc
206 ac_add_options --disable-elf-hack
207 ac_add_options --disable-gnomeui
208 ac_add_options --disable-gnomevfs
209 ac_add_options --disable-installer
210 ac_add_options --disable-javaxpcom
211 ac_add_options --disable-profilesharing
212 ac_add_options --disable-updater
213 ac_add_options --disable-xterm-updates
214 ac_add_options --enable-application=mail
215 ac_add_options --enable-crypto
216 ac_add_options --enable-default-toolkit=%{?with_gtk3:cairo-gtk3}%{!?with_gtk3:cairo-gtk2}
217 ac_add_options --enable-gio
219 ac_add_options --enable-ldap
220 ac_add_options --with-system-ldap
222 ac_add_options --disable-ldap
224 ac_add_options --enable-libxul
225 ac_add_options --enable-pango
226 ac_add_options --enable-postscript
227 %{?with_shared_js:ac_add_options --enable-shared-js}
228 ac_add_options --enable-single-profile
229 ac_add_options --enable-startup-notification
230 ac_add_options --enable-system-cairo
231 ac_add_options --enable-system-hunspell
232 ac_add_options --enable-system-sqlite
233 ac_add_options --with-default-mozilla-five-home=%{_libdir}/%{name}
234 ac_add_options --with-distribution-id=org.pld-linux
235 %if %{with xulrunner}
236 ac_add_options --with-libxul-sdk=$(pkg-config --variable=sdkdir libxul)
237 ac_add_options --with-system-libxul
239 ac_add_options --with-pthreads
240 ac_add_options --with-system-bz2
241 ac_add_options --with-system-ffi
242 ac_add_options --with-system-icu
243 ac_add_options --with-system-jpeg
244 ac_add_options --with-system-libevent
245 ac_add_options --with-system-libvpx
246 ac_add_options --with-system-nspr
247 ac_add_options --with-system-nss
248 ac_add_options --with-system-png
249 ac_add_options --with-system-zlib
252 mkdir -p %{objdir}/config
253 ln -sf %{topdir}/mozilla/config/*.mk %{objdir}/config
255 %{__make} -j1 -f client.mk build \
257 MOZ_MAKE_FLAGS="%{?_smp_mflags}" \
258 installdir=%{_libdir}/%{name} \
263 %if %{with crashreporter}
264 # create debuginfo for crash-stats.mozilla.com
265 %{__make} -j1 -C obj-%{_target_cpu} buildsymbols
269 rm -rf $RPM_BUILD_ROOT
270 install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/%{name},%{_datadir}/%{name},%{_pixmapsdir},%{_desktopdir}}
273 %{__make} -C mail/installer stage-package \
274 DESTDIR=$RPM_BUILD_ROOT \
275 installdir=%{_libdir}/%{name} \
278 cp -a dist/thunderbird/* $RPM_BUILD_ROOT%{_libdir}/%{name}/
280 %if %{with xulrunner}
281 # needed to find mozilla runtime
282 ln -s ../xulrunner $RPM_BUILD_ROOT%{_libdir}/%{name}/xulrunner
285 # Enable crash reporter for Thunderbird application
286 %if %{with crashreporter}
287 %{__sed} -i -e 's/\[Crash Reporter\]/[Crash Reporter]\nEnabled=1/' $RPM_BUILD_ROOT%{_libdir}/%{name}/application.ini
289 # Add debuginfo for crash-stats.mozilla.com
290 install -d $RPM_BUILD_ROOT%{_exec_prefix}/lib/debug%{_libdir}/%{name}
291 cp -a dist/%{name}-%{version}.en-US.linux-*.crashreporter-symbols.zip $RPM_BUILD_ROOT%{_prefix}/lib/debug%{_libdir}/%{name}
294 # move arch independant ones to datadir
295 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/searchplugins $RPM_BUILD_ROOT%{_datadir}/%{name}/searchplugins
296 ln -s ../../share/%{name}/searchplugins $RPM_BUILD_ROOT%{_libdir}/%{name}/searchplugins
298 # dir for arch independant extensions besides arch dependant extensions
299 # see mozilla/xpcom/build/nsXULAppAPI.h
300 # XRE_SYS_LOCAL_EXTENSION_PARENT_DIR and XRE_SYS_SHARE_EXTENSION_PARENT_DIR
301 install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/extensions
303 %if %{without xulrunner}
304 %{__rm} -r $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
305 ln -s %{_datadir}/myspell $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
308 #%{__sed} -e "s|%MOZAPPDIR%|%{_libdir}/%{name}|" \
309 # -e "s|%MOZ_APP_DISPLAYNAME%|Thunderbird|" \
310 # %{topdir}/mozilla/mozilla/build/unix/mozilla.in > $RPM_BUILD_ROOT%{_libdir}/%{name}/thunderbird
312 %{__sed} -e 's,@LIBDIR@,%{_libdir},' %{SOURCE5} > $RPM_BUILD_ROOT%{_bindir}/thunderbird
313 ln -s %{name} $RPM_BUILD_ROOT%{_bindir}/thunderbird
314 ln -s %{name} $RPM_BUILD_ROOT%{_bindir}/mozilla-thunderbird
316 cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
318 # files created by regxpcom -register in post
319 touch $RPM_BUILD_ROOT%{_libdir}/%{name}/components/compreg.dat
320 touch $RPM_BUILD_ROOT%{_libdir}/%{name}/components/xpti.dat
321 cat << 'EOF' > $RPM_BUILD_ROOT%{_libdir}/%{name}/register
324 # make temporary HOME, as it attempts to touch files in $HOME/.mozilla
325 # dangerous if you run this with sudo with keep_env += HOME
326 # also TMPDIR could be pointing to sudo user's homedir so we reset that too.
328 %{__rm} -f %{_libdir}/%{name}/components/{compreg,xpti}.dat
329 TMPDIR= TMP= HOME=$t %{_libdir}/%{name}/thunderbird -register
332 chmod a+rx $RPM_BUILD_ROOT%{_libdir}/%{name}/register
335 %{__sed} -i '/lib\(ldap\|ldif\|prldap\)60.so/d' $RPM_BUILD_ROOT%{_libdir}/%{name}/dependentlibs.list
336 %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/lib{ldap,ldif,prldap}60.so
339 rm -rf $RPM_BUILD_ROOT
342 if [ -d %{_libdir}/%{name}/dictionaries ] && [ ! -L %{_libdir}/%{name}/dictionaries ]; then
343 mv -v %{_libdir}/%{name}/dictionaries{,.rpmsave}
345 for d in chrome defaults icons isp modules res searchplugins; do
346 if [ -d %{_libdir}/%{name}/$d ] && [ ! -L %{_libdir}/%{name}/$d ]; then
347 install -d %{_datadir}/%{name}
348 mv %{_libdir}/%{name}/$d %{_datadir}/%{name}/$d
354 %{_libdir}/%{name}/register || :
357 %defattr(644,root,root,755)
358 %attr(755,root,root) %{_bindir}/thunderbird
359 %attr(755,root,root) %{_bindir}/mozilla-thunderbird
360 %attr(755,root,root) %{_bindir}/thunderbird
361 %dir %{_libdir}/%{name}
362 %{_libdir}/%{name}/application.ini
363 %{_libdir}/%{name}/blocklist.xml
364 %{_libdir}/%{name}/chrome.manifest
365 %dir %{_libdir}/%{name}/components
366 %{_libdir}/%{name}/components/components.manifest
367 %attr(755,root,root) %{_libdir}/%{name}/*.sh
368 %attr(755,root,root) %{_libdir}/%{name}/*-bin
369 %attr(755,root,root) %{_libdir}/%{name}/thunderbird
370 %attr(755,root,root) %{_libdir}/%{name}/register
371 %{_libdir}/%{name}/omni.ja
372 %if %{without xulrunner}
373 %{_libdir}/%{name}/dependentlibs.list
374 %{_libdir}/%{name}/platform.ini
375 %attr(755,root,root) %{_libdir}/%{name}/components/*.so
376 %attr(755,root,root) %{_libdir}/%{name}/libmozalloc.so
377 %{?with_shared_js:%attr(755,root,root) %{_libdir}/%{name}/libmozjs.so}
378 %attr(755,root,root) %{_libdir}/%{name}/libxul.so
379 %attr(755,root,root) %{_libdir}/%{name}/plugin-container
383 %{_libdir}/%{name}/chrome
384 %{_libdir}/%{name}/defaults
385 %{_libdir}/%{name}/isp
386 %{_libdir}/%{name}/searchplugins
387 %if %{with xulrunner}
388 %{_libdir}/%{name}/xulrunner
390 %{_libdir}/%{name}/dictionaries
393 %{_pixmapsdir}/thunderbird.png
394 %{_desktopdir}/thunderbird.desktop
396 %dir %{_datadir}/%{name}
397 %dir %{_libdir}/%{name}/distribution
398 %dir %{_libdir}/%{name}/distribution/extensions
399 %{_datadir}/%{name}/extensions
400 %{_datadir}/%{name}/searchplugins
402 %if %{with crashreporter}
403 %attr(755,root,root) %{_libdir}/%{name}/crashreporter
404 %{_libdir}/%{name}/crashreporter.ini
405 %{_libdir}/%{name}/Throbber-small.gif
408 %dir %{_libdir}/%{name}/extensions
409 %{_libdir}/%{name}/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}
411 # files created by regxpcom -register
412 %ghost %{_libdir}/%{name}/components/compreg.dat
413 %ghost %{_libdir}/%{name}/components/xpti.dat
415 %{_iconsdir}/hicolor/*/apps/thunderbird.*
417 %if %{with lightning}
418 %files addon-lightning
419 %defattr(644,root,root,755)
420 %dir %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}
421 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/app.ini
422 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/chrome.jar
423 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/chrome.manifest
424 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/defaults
425 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/install.rdf
426 %dir %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components
427 %attr(755,root,root) %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.so
428 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.js
429 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*manifest
430 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.xpt
431 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/modules
432 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/calendar-js
433 %dir %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/timezones
434 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/timezones/zones.json