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 Patch6: no-subshell.patch
40 Patch8: enable-addons.patch
41 Patch9: mozilla-1269171-badalloc.patch
42 URL: http://www.mozilla.org/projects/thunderbird/
43 BuildRequires: GConf2-devel >= 1.2.1
44 BuildRequires: alsa-lib-devel
45 BuildRequires: automake
46 BuildRequires: bzip2-devel
47 BuildRequires: cairo-devel >= 1.10
48 BuildRequires: dbus-glib-devel >= 0.60
49 BuildRequires: freetype-devel >= 1:2.1.8
50 BuildRequires: glib2-devel >= 1:2.20
51 BuildRequires: gstreamer0.10-devel
52 BuildRequires: gstreamer0.10-plugins-base-devel
53 %{!?with_gtk3:BuildRequires: gtk+2-devel >= 2:2.14}
54 %{?with_gtk3:BuildRequires: gtk+3-devel >= 3.0.0}
55 BuildRequires: hunspell-devel
56 BuildRequires: libIDL-devel >= 0.8.0
57 BuildRequires: libevent-devel
58 BuildRequires: libicu-devel >= 50.1
59 BuildRequires: libiw-devel
60 # requires libjpeg-turbo implementing at least libjpeg 6b API
61 BuildRequires: libjpeg-devel >= 6b
62 BuildRequires: libjpeg-turbo-devel
63 BuildRequires: libpng-devel >= 1.4.1
64 BuildRequires: libstdc++-devel
65 BuildRequires: libvpx-devel >= 1.3.0
66 BuildRequires: mozldap-devel
67 BuildRequires: nspr-devel >= 1:%{nspr_ver}
68 BuildRequires: nss-devel >= 1:%{nss_ver}
69 BuildRequires: pango-devel >= 1:1.22.0
70 BuildRequires: perl-base >= 1:5.6
71 BuildRequires: pkgconfig
72 BuildRequires: python >= 1:2.5
73 BuildRequires: python-virtualenv
74 BuildRequires: sed >= 4.0
75 BuildRequires: sqlite3-devel >= 3.8.4.2
76 BuildRequires: startup-notification-devel >= 0.8
77 BuildRequires: virtualenv
78 BuildRequires: xorg-lib-libXext-devel
79 BuildRequires: xorg-lib-libXinerama-devel
80 BuildRequires: xorg-lib-libXt-devel
84 BuildRequires: xulrunner-devel < 2:32
85 BuildRequires: xulrunner-devel >= %{xulrunner_ver}
87 Requires: glib2 >= 1:2.20
88 %{!?with_gtk3:Requires: gtk+2 >= 2:2.14}
89 %{?with_gtk3:Requires: gtk+3 >= 3.0.0}
90 Requires: libvpx >= 1.3.0
91 Requires: myspell-common
92 Requires: nspr >= 1:%{nspr_ver}
93 Requires: nss >= 1:%{nss_ver}
94 Requires: pango >= 1:1.22.0
95 Requires: sqlite3 >= %{sqlite_build_version}
97 Requires(post): mktemp >= 1.5-18
99 %requires_eq_to xulrunner xulrunner-devel
101 Requires: libjpeg-turbo
102 Obsoletes: mozilla-thunderbird
103 Obsoletes: mozilla-thunderbird-dictionary-en-US
104 Conflicts: thunderbird-lang-resources < %{version}
105 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
107 %define filterout_cpp -D_FORTIFY_SOURCE=[0-9]+
109 # firefox/thunderbird/seamonkey provide their own versions
110 %define _noautoprovfiles %{_libdir}/%{name}/components
111 %if %{without xulrunner}
112 # we don't want these to satisfy packages depending on xulrunner
113 %define _noautoprov libmozalloc.so libmozjs.so libxul.so
114 # and as we don't provide them, don't require either
115 %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}
135 %description addon-lightning
136 Lightning is an calendar extension to Thunderbird email client.
138 %description addon-lightning -l pl.UTF-8
139 Lightning to rozszerzenie do klienta poczty Thunderbird dodające
140 funkcjonalność kalendarza.
150 cat << EOF > .mozconfig
151 mk_add_options MOZ_OBJDIR=%{objdir}
153 export CFLAGS="%{rpmcflags}"
154 export CXXFLAGS="%{rpmcflags}"
156 %if %{with crashreporter}
157 export MOZ_DEBUG_SYMBOLS=1
160 # Options for 'configure' (same as command-line options).
161 ac_add_options --prefix=%{_prefix}
162 ac_add_options --exec-prefix=%{_exec_prefix}
163 ac_add_options --bindir=%{_bindir}
164 ac_add_options --sbindir=%{_sbindir}
165 ac_add_options --sysconfdir=%{_sysconfdir}
166 ac_add_options --datadir=%{_datadir}
167 ac_add_options --includedir=%{_includedir}
168 ac_add_options --libdir=%{_libdir}
169 ac_add_options --libexecdir=%{_libexecdir}
170 ac_add_options --localstatedir=%{_localstatedir}
171 ac_add_options --sharedstatedir=%{_sharedstatedir}
172 ac_add_options --mandir=%{_mandir}
173 ac_add_options --infodir=%{_infodir}
175 ac_add_options --disable-optimize
176 ac_add_options --enable-debug
177 ac_add_options --enable-debug-modules
178 ac_add_options --enable-debugger-info-modules
179 ac_add_options --enable-crash-on-assert
181 ac_add_options --disable-debug
182 ac_add_options --disable-debug-modules
183 ac_add_options --disable-logging
184 ac_add_options --enable-optimize="%{rpmcflags} -Os"
186 ac_add_options --disable-strip
187 ac_add_options --disable-strip-libs
189 ac_add_options --enable-tests
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-dynstr-gc
204 ac_add_options --disable-elf-hack
205 ac_add_options --disable-gnomeui
206 ac_add_options --disable-gnomevfs
207 ac_add_options --disable-installer
208 ac_add_options --disable-javaxpcom
209 ac_add_options --disable-profilesharing
210 ac_add_options --disable-updater
211 ac_add_options --disable-xterm-updates
212 ac_add_options --enable-application=mail
213 ac_add_options --enable-crypto
214 ac_add_options --enable-default-toolkit=%{?with_gtk3:cairo-gtk3}%{!?with_gtk3:cairo-gtk2}
215 ac_add_options --enable-gio
217 ac_add_options --enable-ldap
218 ac_add_options --with-system-ldap
220 ac_add_options --disable-ldap
222 ac_add_options --enable-libxul
223 ac_add_options --enable-pango
224 ac_add_options --enable-postscript
225 %{?with_shared_js:ac_add_options --enable-shared-js}
226 ac_add_options --enable-single-profile
227 ac_add_options --enable-startup-notification
228 ac_add_options --enable-system-cairo
229 ac_add_options --enable-system-hunspell
230 ac_add_options --enable-system-sqlite
231 ac_add_options --with-default-mozilla-five-home=%{_libdir}/%{name}
232 ac_add_options --with-distribution-id=org.pld-linux
233 %if %{with xulrunner}
234 ac_add_options --with-libxul-sdk=$(pkg-config --variable=sdkdir libxul)
235 ac_add_options --with-system-libxul
237 ac_add_options --with-pthreads
238 ac_add_options --with-system-bz2
239 ac_add_options --with-system-ffi
240 ac_add_options --with-system-icu
241 ac_add_options --with-system-jpeg
242 ac_add_options --with-system-libevent
243 ac_add_options --with-system-libvpx
244 ac_add_options --with-system-nspr
245 ac_add_options --with-system-nss
246 ac_add_options --with-system-png
247 ac_add_options --with-system-zlib
250 mkdir -p %{objdir}/config
251 ln -sf %{topdir}/mozilla/config/*.mk %{objdir}/config
253 %{__make} -j1 -f client.mk build \
255 MOZ_MAKE_FLAGS="%{?_smp_mflags}" \
256 installdir=%{_libdir}/%{name} \
261 %if %{with crashreporter}
262 # create debuginfo for crash-stats.mozilla.com
263 %{__make} -j1 -C obj-%{_target_cpu} buildsymbols
267 rm -rf $RPM_BUILD_ROOT
268 install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/%{name},%{_datadir}/%{name},%{_pixmapsdir},%{_desktopdir}}
271 %{__make} -C mail/installer stage-package \
272 DESTDIR=$RPM_BUILD_ROOT \
273 installdir=%{_libdir}/%{name} \
276 cp -a dist/thunderbird/* $RPM_BUILD_ROOT%{_libdir}/%{name}/
278 %if %{with xulrunner}
279 # needed to find mozilla runtime
280 ln -s ../xulrunner $RPM_BUILD_ROOT%{_libdir}/%{name}/xulrunner
283 # Enable crash reporter for Thunderbird application
284 %if %{with crashreporter}
285 %{__sed} -i -e 's/\[Crash Reporter\]/[Crash Reporter]\nEnabled=1/' $RPM_BUILD_ROOT%{_libdir}/%{name}/application.ini
287 # Add debuginfo for crash-stats.mozilla.com
288 install -d $RPM_BUILD_ROOT%{_exec_prefix}/lib/debug%{_libdir}/%{name}
289 cp -a dist/%{name}-%{version}.en-US.linux-*.crashreporter-symbols.zip $RPM_BUILD_ROOT%{_prefix}/lib/debug%{_libdir}/%{name}
292 # move arch independant ones to datadir
293 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/searchplugins $RPM_BUILD_ROOT%{_datadir}/%{name}/searchplugins
294 ln -s ../../share/%{name}/searchplugins $RPM_BUILD_ROOT%{_libdir}/%{name}/searchplugins
296 # dir for arch independant extensions besides arch dependant extensions
297 # see mozilla/xpcom/build/nsXULAppAPI.h
298 # XRE_SYS_LOCAL_EXTENSION_PARENT_DIR and XRE_SYS_SHARE_EXTENSION_PARENT_DIR
299 install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/extensions
301 %if %{without xulrunner}
302 %{__rm} -r $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
303 ln -s %{_datadir}/myspell $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
306 #%{__sed} -e "s|%MOZAPPDIR%|%{_libdir}/%{name}|" \
307 # -e "s|%MOZ_APP_DISPLAYNAME%|Thunderbird|" \
308 # %{topdir}/mozilla/mozilla/build/unix/mozilla.in > $RPM_BUILD_ROOT%{_libdir}/%{name}/thunderbird
310 %{__sed} -e 's,@LIBDIR@,%{_libdir},' %{SOURCE5} > $RPM_BUILD_ROOT%{_bindir}/thunderbird
311 ln -s %{name} $RPM_BUILD_ROOT%{_bindir}/thunderbird
312 ln -s %{name} $RPM_BUILD_ROOT%{_bindir}/mozilla-thunderbird
314 cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
316 # files created by regxpcom -register in post
317 touch $RPM_BUILD_ROOT%{_libdir}/%{name}/components/compreg.dat
318 touch $RPM_BUILD_ROOT%{_libdir}/%{name}/components/xpti.dat
319 cat << 'EOF' > $RPM_BUILD_ROOT%{_libdir}/%{name}/register
322 # make temporary HOME, as it attempts to touch files in $HOME/.mozilla
323 # dangerous if you run this with sudo with keep_env += HOME
324 # also TMPDIR could be pointing to sudo user's homedir so we reset that too.
326 %{__rm} -f %{_libdir}/%{name}/components/{compreg,xpti}.dat
327 TMPDIR= TMP= HOME=$t %{_libdir}/%{name}/thunderbird -register
330 chmod a+rx $RPM_BUILD_ROOT%{_libdir}/%{name}/register
333 %{__sed} -i '/lib\(ldap\|ldif\|prldap\)60.so/d' $RPM_BUILD_ROOT%{_libdir}/%{name}/dependentlibs.list
334 %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/lib{ldap,ldif,prldap}60.so
337 rm -rf $RPM_BUILD_ROOT
340 if [ -d %{_libdir}/%{name}/dictionaries ] && [ ! -L %{_libdir}/%{name}/dictionaries ]; then
341 mv -v %{_libdir}/%{name}/dictionaries{,.rpmsave}
343 for d in chrome defaults icons isp modules res searchplugins; do
344 if [ -d %{_libdir}/%{name}/$d ] && [ ! -L %{_libdir}/%{name}/$d ]; then
345 install -d %{_datadir}/%{name}
346 mv %{_libdir}/%{name}/$d %{_datadir}/%{name}/$d
352 %{_libdir}/%{name}/register || :
355 %defattr(644,root,root,755)
356 %attr(755,root,root) %{_bindir}/thunderbird
357 %attr(755,root,root) %{_bindir}/mozilla-thunderbird
358 %attr(755,root,root) %{_bindir}/thunderbird
359 %dir %{_libdir}/%{name}
360 %{_libdir}/%{name}/application.ini
361 %{_libdir}/%{name}/blocklist.xml
362 %{_libdir}/%{name}/chrome.manifest
363 %dir %{_libdir}/%{name}/components
364 %{_libdir}/%{name}/components/components.manifest
365 %attr(755,root,root) %{_libdir}/%{name}/*.sh
366 %attr(755,root,root) %{_libdir}/%{name}/*-bin
367 %attr(755,root,root) %{_libdir}/%{name}/thunderbird
368 %attr(755,root,root) %{_libdir}/%{name}/register
369 %{_libdir}/%{name}/omni.ja
370 %if %{without xulrunner}
371 %{_libdir}/%{name}/dependentlibs.list
372 %{_libdir}/%{name}/platform.ini
373 %attr(755,root,root) %{_libdir}/%{name}/components/*.so
374 %attr(755,root,root) %{_libdir}/%{name}/libmozalloc.so
375 %{?with_shared_js:%attr(755,root,root) %{_libdir}/%{name}/libmozjs.so}
376 %attr(755,root,root) %{_libdir}/%{name}/libxul.so
377 %attr(755,root,root) %{_libdir}/%{name}/plugin-container
381 %{_libdir}/%{name}/chrome
382 %{_libdir}/%{name}/defaults
383 %{_libdir}/%{name}/isp
384 %{_libdir}/%{name}/searchplugins
385 %if %{with xulrunner}
386 %{_libdir}/%{name}/xulrunner
388 %{_libdir}/%{name}/dictionaries
391 %{_pixmapsdir}/thunderbird.png
392 %{_desktopdir}/thunderbird.desktop
394 %dir %{_datadir}/%{name}
395 %dir %{_libdir}/%{name}/distribution
396 %dir %{_libdir}/%{name}/distribution/extensions
397 %{_datadir}/%{name}/extensions
398 %{_datadir}/%{name}/searchplugins
400 %if %{with crashreporter}
401 %attr(755,root,root) %{_libdir}/%{name}/crashreporter
402 %{_libdir}/%{name}/crashreporter.ini
403 %{_libdir}/%{name}/Throbber-small.gif
406 %dir %{_libdir}/%{name}/extensions
407 %{_libdir}/%{name}/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}
409 # files created by regxpcom -register
410 %ghost %{_libdir}/%{name}/components/compreg.dat
411 %ghost %{_libdir}/%{name}/components/xpti.dat
413 %{_iconsdir}/hicolor/*/apps/thunderbird.*
415 %if %{with lightning}
416 %files addon-lightning
417 %defattr(644,root,root,755)
418 %dir %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}
419 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/app.ini
420 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/chrome.jar
421 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/chrome.manifest
422 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/defaults
423 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/install.rdf
424 %dir %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components
425 %attr(755,root,root) %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.so
426 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.js
427 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*manifest
428 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.xpt
429 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/modules
430 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/calendar-js
431 %dir %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/timezones
432 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/timezones/zones.json