- added gcc bug workaround, still does not work
[packages/thunderbird.git] / thunderbird.spec
CommitLineData
c4ddd260 1# TODO:
283702b9 2# - build with system mozldap
c4ddd260 3#
44be9ed4 4# Conditional builds
3366507a 5%bcond_with gtk3 # GTK+ 3.x instead of 2.x
44be9ed4 6%bcond_without ldap # disable e-mail address lookups in LDAP directories
e820c55e 7%bcond_without lightning # disable Sunbird/Lightning calendar
765a3a27 8%bcond_with crashreporter # report crashes to crash-stats.mozilla.com
a97d3356
JR
9# - disabled shared_js - https://bugzilla.mozilla.org/show_bug.cgi?id=1039964
10%bcond_with shared_js # shared libmozjs library [broken]
99b97bc4 11%bcond_with system_icu # build with system ICU (disabled due to crashes with system icu 58.2)
88149483 12
f4114a7f 13%if 0%{?_enable_debug_packages} != 1
765a3a27
ER
14%undefine crashreporter
15%endif
16
62096d2c 17%define nspr_ver 4.10.6
3a30e2d7 18%define nss_ver 3.19.2.1
44be9ed4 19
7d981f69
ER
20# The actual sqlite version (see RHBZ#480989):
21%define sqlite_build_version %(pkg-config --silence-errors --modversion sqlite3 2>/dev/null || echo ERROR)
7d981f69 22
cae5b55b
JR
23Summary: Thunderbird - email client
24Summary(pl.UTF-8): Thunderbird - klient poczty
25Name: thunderbird
7a5e9406
JR
26Version: 45.8.0
27Release: 0.1
3366507a 28License: MPL v2.0
2d289b25 29Group: X11/Applications/Mail
cae5b55b 30Source0: http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/%{version}/source/%{name}-%{version}.source.tar.xz
7a5e9406 31# Source0-md5: 4e04b1618273f946f00f8ea547578895
dd12359d
JR
32Source1: %{name}.desktop
33Source2: %{name}.sh
34Patch0: prefs.patch
35Patch1: no-subshell.patch
36Patch2: enable-addons.patch
37Patch3: mozilla-1269171-badalloc.patch
e0edcd93 38Patch4: mozilla-1245783.patch
cae5b55b 39URL: http://www.mozilla.org/projects/thunderbird/
6458b220 40BuildRequires: GConf2-devel >= 1.2.1
51a3b6db 41BuildRequires: alsa-lib-devel
44be9ed4 42BuildRequires: automake
51a3b6db 43BuildRequires: bzip2-devel
e820c55e
JB
44BuildRequires: cairo-devel >= 1.10
45BuildRequires: dbus-glib-devel >= 0.60
44be9ed4 46BuildRequires: freetype-devel >= 1:2.1.8
6f32f966 47BuildRequires: glib2-devel >= 1:2.20
d0b96b40
JR
48BuildRequires: gstreamer0.10-devel
49BuildRequires: gstreamer0.10-plugins-base-devel
99b97bc4
JR
50%{!?with_gtk3:BuildRequires: gtk+2-devel >= 2:2.18.0}
51%{?with_gtk3:BuildRequires: gtk+3-devel >= 3.4.0}
5e9bb798 52BuildRequires: hunspell-devel
44be9ed4 53BuildRequires: libIDL-devel >= 0.8.0
d0b96b40 54BuildRequires: libevent-devel
99b97bc4 55%{?with_system_icu:BuildRequires: libicu-devel >= 58.1}
51a3b6db 56BuildRequires: libiw-devel
e82da7a1 57# requires libjpeg-turbo implementing at least libjpeg 6b API
44be9ed4 58BuildRequires: libjpeg-devel >= 6b
e82da7a1 59BuildRequires: libjpeg-turbo-devel
e820c55e 60BuildRequires: libpng-devel >= 1.4.1
44be9ed4 61BuildRequires: libstdc++-devel
cae5b55b 62BuildRequires: libvpx-devel >= 1.3.0
d0b96b40 63BuildRequires: mozldap-devel
f4114a7f
ER
64BuildRequires: nspr-devel >= 1:%{nspr_ver}
65BuildRequires: nss-devel >= 1:%{nss_ver}
62096d2c 66BuildRequires: pango-devel >= 1:1.22.0
e820c55e 67BuildRequires: perl-base >= 1:5.6
1c62cadb 68BuildRequires: pkgconfig
e820c55e 69BuildRequires: python >= 1:2.5
cae5b55b 70BuildRequires: python-virtualenv
44be9ed4 71BuildRequires: sed >= 4.0
62096d2c 72BuildRequires: sqlite3-devel >= 3.8.4.2
1c62cadb 73BuildRequires: startup-notification-devel >= 0.8
ffb12c8e 74BuildRequires: virtualenv
44be9ed4 75BuildRequires: xorg-lib-libXext-devel
44be9ed4 76BuildRequires: xorg-lib-libXinerama-devel
44be9ed4 77BuildRequires: xorg-lib-libXt-devel
5745d706 78BuildRequires: yasm
1c62cadb 79BuildRequires: zip
6f32f966 80Requires: glib2 >= 1:2.20
99b97bc4
JR
81%{!?with_gtk3:Requires: gtk+2 >= 2:2.18.0}
82%{?with_gtk3:Requires: gtk+3 >= 3.4.0}
62096d2c 83Requires: libvpx >= 1.3.0
44be9ed4 84Requires: myspell-common
f4114a7f
ER
85Requires: nspr >= 1:%{nspr_ver}
86Requires: nss >= 1:%{nss_ver}
62096d2c 87Requires: pango >= 1:1.22.0
4b6bc367 88Requires: sqlite3 >= %{sqlite_build_version}
4f34f106 89Requires(post): mktemp >= 1.5-18
e82da7a1 90Requires: libjpeg-turbo
99b97bc4 91Obsoletes: icedove
44be9ed4 92Obsoletes: mozilla-thunderbird
93Obsoletes: mozilla-thunderbird-dictionary-en-US
cae5b55b 94Conflicts: thunderbird-lang-resources < %{version}
44be9ed4 95BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
96
9e366f18
AM
97%define filterout_cpp -D_FORTIFY_SOURCE=[0-9]+
98
cae5b55b 99# firefox/thunderbird/seamonkey provide their own versions
44be9ed4 100%define _noautoprovfiles %{_libdir}/%{name}/components
99b97bc4 101
fb7d4f06 102# we don't want these to satisfy packages depending on xulrunner
6f32f966 103%define _noautoprov libmozalloc.so libmozjs.so libxul.so
44be9ed4 104# and as we don't provide them, don't require either
6f32f966 105%define _noautoreq libmozalloc.so libmozjs.so libxul.so
44be9ed4 106
7a5e9406 107%define topdir %{_builddir}/thunderbird-%{version}
9e7875fc
ER
108%define objdir %{topdir}/obj-%{_target_cpu}
109
44be9ed4 110%description
cae5b55b 111Thunderbird is an open-source, fast and portable email client.
44be9ed4 112
113%description -l pl.UTF-8
cae5b55b 114Thunderbird jest mającym otwarte źródła, szybkim i przenośnym klientem
6b327de6 115poczty.
44be9ed4 116
6578c165 117%package addon-lightning
cae5b55b
JR
118Summary: An integrated calendar for Thunderbird
119Summary(pl.UTF-8): Zintegrowany kalendarz dla Thunderbird
6578c165 120License: MPL 1.1 or GPL v2+ or LGPL v2.1+
121Group: Applications/Networking
122Requires: %{name} = %{version}-%{release}
99b97bc4 123Obsoletes: icedove-addon-lightning
6578c165 124
125%description addon-lightning
cae5b55b 126Lightning is an calendar extension to Thunderbird email client.
6578c165 127
128%description addon-lightning -l pl.UTF-8
cae5b55b 129Lightning to rozszerzenie do klienta poczty Thunderbird dodające
6578c165 130funkcjonalność kalendarza.
131
44be9ed4 132%prep
cae5b55b 133%setup -q
dd12359d
JR
134%patch0 -p1
135%patch1 -p1
f53f9bcd 136%patch2 -p1
dd12359d 137%patch3 -p1
e0edcd93 138%patch4 -p1
d0b96b40 139
44be9ed4 140%build
fbac75ca 141cat << EOF > .mozconfig
9e7875fc 142mk_add_options MOZ_OBJDIR=%{objdir}
cb0e4412 143
765a3a27
ER
144%if %{with crashreporter}
145export MOZ_DEBUG_SYMBOLS=1
146%endif
147
59c5a0e8 148# Options for 'configure' (same as command-line options).
44be9ed4 149ac_add_options --prefix=%{_prefix}
150ac_add_options --exec-prefix=%{_exec_prefix}
151ac_add_options --bindir=%{_bindir}
152ac_add_options --sbindir=%{_sbindir}
153ac_add_options --sysconfdir=%{_sysconfdir}
154ac_add_options --datadir=%{_datadir}
155ac_add_options --includedir=%{_includedir}
156ac_add_options --libdir=%{_libdir}
157ac_add_options --libexecdir=%{_libexecdir}
158ac_add_options --localstatedir=%{_localstatedir}
159ac_add_options --sharedstatedir=%{_sharedstatedir}
160ac_add_options --mandir=%{_mandir}
161ac_add_options --infodir=%{_infodir}
162%if %{?debug:1}0
59c5a0e8 163ac_add_options --disable-optimize
44be9ed4 164ac_add_options --enable-debug
165ac_add_options --enable-debug-modules
59c5a0e8
SP
166ac_add_options --enable-debugger-info-modules
167ac_add_options --enable-crash-on-assert
44be9ed4 168%else
169ac_add_options --disable-debug
59c5a0e8 170ac_add_options --enable-optimize="%{rpmcflags} -Os"
44be9ed4 171%endif
88149483
ER
172ac_add_options --disable-strip
173ac_add_options --disable-strip-libs
44be9ed4 174%if %{with tests}
175ac_add_options --enable-tests
176%else
177ac_add_options --disable-tests
178%endif
3366507a
JB
179%if %{with lightning}
180ac_add_options --enable-calendar
44be9ed4 181%else
3366507a 182ac_add_options --disable-calendar
44be9ed4 183%endif
765a3a27
ER
184%if %{with crashreporter}
185ac_add_options --enable-crashreporter
186%else
59c5a0e8 187ac_add_options --disable-crashreporter
765a3a27 188%endif
99b97bc4
JR
189#ac_add_options --disable-elf-dynstr-gc
190#ac_add_options --disable-elf-hack
3366507a
JB
191ac_add_options --disable-gnomeui
192ac_add_options --disable-gnomevfs
44be9ed4 193ac_add_options --disable-installer
d0b96b40 194ac_add_options --disable-javaxpcom
3366507a 195ac_add_options --disable-profilesharing
88149483 196ac_add_options --disable-updater
3366507a
JB
197ac_add_options --disable-xterm-updates
198ac_add_options --enable-application=mail
44be9ed4 199ac_add_options --enable-crypto
3366507a
JB
200ac_add_options --enable-default-toolkit=%{?with_gtk3:cairo-gtk3}%{!?with_gtk3:cairo-gtk2}
201ac_add_options --enable-gio
202%if %{with ldap}
203ac_add_options --enable-ldap
204ac_add_options --with-system-ldap
205%else
206ac_add_options --disable-ldap
207%endif
d0b96b40 208ac_add_options --enable-libxul
44be9ed4 209ac_add_options --enable-pango
3366507a 210ac_add_options --enable-postscript
a97d3356 211%{?with_shared_js:ac_add_options --enable-shared-js}
3366507a 212ac_add_options --enable-single-profile
88149483 213ac_add_options --enable-startup-notification
44be9ed4 214ac_add_options --enable-system-cairo
5e9bb798 215ac_add_options --enable-system-hunspell
7d981f69 216ac_add_options --enable-system-sqlite
3366507a
JB
217ac_add_options --with-default-mozilla-five-home=%{_libdir}/%{name}
218ac_add_options --with-distribution-id=org.pld-linux
88149483
ER
219ac_add_options --with-pthreads
220ac_add_options --with-system-bz2
d0b96b40 221ac_add_options --with-system-ffi
99b97bc4 222ac_add_options --with%{!?with_system_icu:out}-system-icu
44be9ed4 223ac_add_options --with-system-jpeg
d0b96b40
JR
224ac_add_options --with-system-libevent
225ac_add_options --with-system-libvpx
44be9ed4 226ac_add_options --with-system-nspr
227ac_add_options --with-system-nss
228ac_add_options --with-system-png
229ac_add_options --with-system-zlib
44be9ed4 230EOF
231
d0b96b40 232mkdir -p %{objdir}/config
7a5e9406 233ln -sf %{topdir}/mozilla/config/*.mk %{objdir}/config
d0b96b40 234
90e998ba 235%{__make} -j1 -f client.mk build \
d076d93e 236 STRIP="/bin/true" \
765a3a27 237 MOZ_MAKE_FLAGS="%{?_smp_mflags}" \
d0b96b40 238 installdir=%{_libdir}/%{name} \
de09c00d 239 XLIBS="-lX11 -lXt" \
d076d93e 240 CC="%{__cc}" \
44be9ed4 241 CXX="%{__cxx}"
242
765a3a27
ER
243%if %{with crashreporter}
244# create debuginfo for crash-stats.mozilla.com
245%{__make} -j1 -C obj-%{_target_cpu} buildsymbols
246%endif
247
44be9ed4 248%install
249rm -rf $RPM_BUILD_ROOT
99b97bc4 250install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/%{name}/plugins,%{_datadir}/%{name},%{_pixmapsdir},%{_desktopdir}}
44be9ed4 251
9e7875fc 252cd %{objdir}
ecf04393 253%{__make} -C mail/installer stage-package \
44be9ed4 254 DESTDIR=$RPM_BUILD_ROOT \
d0b96b40 255 installdir=%{_libdir}/%{name} \
44be9ed4 256 PKG_SKIP_STRIP=1
257
cae5b55b 258cp -a dist/thunderbird/* $RPM_BUILD_ROOT%{_libdir}/%{name}/
d0b96b40 259
9b40a2c3 260# Enable crash reporter for Thunderbird application
765a3a27
ER
261%if %{with crashreporter}
262%{__sed} -i -e 's/\[Crash Reporter\]/[Crash Reporter]\nEnabled=1/' $RPM_BUILD_ROOT%{_libdir}/%{name}/application.ini
263
264# Add debuginfo for crash-stats.mozilla.com
51a3b6db 265install -d $RPM_BUILD_ROOT%{_exec_prefix}/lib/debug%{_libdir}/%{name}
3a30e2d7 266cp -a dist/%{name}-%{version}.en-US.linux-*.crashreporter-symbols.zip $RPM_BUILD_ROOT%{_prefix}/lib/debug%{_libdir}/%{name}
765a3a27
ER
267%endif
268
99b97bc4
JR
269%{__sed} -e 's,@LIBDIR@,%{_libdir},' %{SOURCE2} > $RPM_BUILD_ROOT%{_bindir}/%{name}
270cp -p dist/thunderbird/chrome/icons/default/default48.png $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
271cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
c6ec3c1c 272
99b97bc4
JR
273# use system dict
274%{__rm} -rv $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
44be9ed4 275ln -s %{_datadir}/myspell $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
99b97bc4 276ln -s %{_datadir}/myspell $RPM_BUILD_ROOT%{_libdir}/%{name}/hyphenation
e6bc19b3 277
99b97bc4
JR
278# move arch independant ones to datadir
279mv $RPM_BUILD_ROOT%{_libdir}/%{name}/chrome $RPM_BUILD_ROOT%{_datadir}/%{name}/chrome
280mv $RPM_BUILD_ROOT%{_libdir}/%{name}/defaults $RPM_BUILD_ROOT%{_datadir}/%{name}/defaults
281mv $RPM_BUILD_ROOT%{_libdir}/%{name}/isp $RPM_BUILD_ROOT%{_datadir}/%{name}/isp
282ln -s ../../share/%{name}/chrome $RPM_BUILD_ROOT%{_libdir}/%{name}/chrome
283ln -s ../../share/%{name}/defaults $RPM_BUILD_ROOT%{_libdir}/%{name}/defaults
284ln -s ../../share/%{name}/isp $RPM_BUILD_ROOT%{_libdir}/%{name}/isp
52fc61e6 285
283702b9 286# mozldap
d0b96b40
JR
287%{__sed} -i '/lib\(ldap\|ldif\|prldap\)60.so/d' $RPM_BUILD_ROOT%{_libdir}/%{name}/dependentlibs.list
288%{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/lib{ldap,ldif,prldap}60.so
283702b9 289
99b97bc4
JR
290# remove unecessary stuff
291%{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/removed-files
292
44be9ed4 293%clean
294rm -rf $RPM_BUILD_ROOT
295
296%pretrans
297if [ -d %{_libdir}/%{name}/dictionaries ] && [ ! -L %{_libdir}/%{name}/dictionaries ]; then
298 mv -v %{_libdir}/%{name}/dictionaries{,.rpmsave}
299fi
99b97bc4 300for d in chrome defaults icons isp modules res; do
44be9ed4 301 if [ -d %{_libdir}/%{name}/$d ] && [ ! -L %{_libdir}/%{name}/$d ]; then
302 install -d %{_datadir}/%{name}
303 mv %{_libdir}/%{name}/$d %{_datadir}/%{name}/$d
304 fi
305done
306exit 0
307
e8f4ba81 308%post
99b97bc4
JR
309%update_desktop_database_post
310# make temporary HOME, as it attempts to touch files in $HOME/.mozilla
311# dangerous if you run this with sudo with keep_env += HOME
312# also TMPDIR could be pointing to sudo user's homedir so we reset that too.
313export HOME=$(mktemp -d)
314unset TMPDIR TMP || :
315umask 022
316%{_libdir}/%{name}/thunderbird -register
317rm -rf $HOME
318
319%postun
320%update_desktop_database_postun
e8f4ba81 321
44be9ed4 322%files
323%defattr(644,root,root,755)
99b97bc4 324%attr(755,root,root) %{_bindir}/%{name}
44be9ed4 325%dir %{_libdir}/%{name}
99b97bc4
JR
326%dir %{_libdir}/%{name}/plugins
327
328%if %{with gtk3}
329%dir %{_libdir}/%{name}/gtk2
330%attr(755,root,root) %{_libdir}/%{name}/gtk2/libmozgtk.so
331%attr(755,root,root) %{_libdir}/%{name}/libmozgtk.so
332%endif
333%attr(755,root,root) %{_libdir}/%{name}/liblgpllibs.so
334%{?with_shared_js:%attr(755,root,root) %{_libdir}/%{name}/libmozjs.so}
335%attr(755,root,root) %{_libdir}/%{name}/libxul.so
73d54cb2
JB
336%attr(755,root,root) %{_libdir}/%{name}/*.sh
337%attr(755,root,root) %{_libdir}/%{name}/*-bin
99b97bc4 338%attr(755,root,root) %{_libdir}/%{name}/plugin-container
cae5b55b 339%attr(755,root,root) %{_libdir}/%{name}/thunderbird
99b97bc4
JR
340
341%{_libdir}/%{name}/application.ini
342%{_libdir}/%{name}/blocklist.xml
a367af64 343%{_libdir}/%{name}/dependentlibs.list
99b97bc4 344%{_libdir}/%{name}/omni.ja
73d54cb2 345%{_libdir}/%{name}/platform.ini
44be9ed4 346
765a3a27
ER
347%if %{with crashreporter}
348%attr(755,root,root) %{_libdir}/%{name}/crashreporter
349%{_libdir}/%{name}/crashreporter.ini
350%{_libdir}/%{name}/Throbber-small.gif
351%endif
352
44be9ed4 353%dir %{_libdir}/%{name}/extensions
99b97bc4
JR
354%{_libdir}/%{name}/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}.xpi
355
356%dir %{_libdir}/%{name}/distribution
357%dir %{_libdir}/%{name}/distribution/extensions
358
359# symlinks
360%{_libdir}/%{name}/chrome
361%{_libdir}/%{name}/defaults
362%{_libdir}/%{name}/dictionaries
363%{_libdir}/%{name}/hyphenation
364%{_libdir}/%{name}/isp
6578c165 365
99b97bc4
JR
366%{_pixmapsdir}/*.png
367%{_desktopdir}/*.desktop
52fc61e6 368
99b97bc4
JR
369%dir %{_datadir}/%{name}
370%{_datadir}/%{name}/chrome
371%{_datadir}/%{name}/defaults
372%{_datadir}/%{name}/isp
d0b96b40 373
6578c165 374%if %{with lightning}
375%files addon-lightning
376%defattr(644,root,root,755)
3a30e2d7
JR
377%dir %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}
378%{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/app.ini
379%{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/chrome.jar
380%{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/chrome.manifest
381%{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/defaults
382%{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/install.rdf
383%dir %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components
384%attr(755,root,root) %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.so
385%{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.js
386%{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*manifest
387%{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.xpt
388%{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/modules
389%{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/calendar-js
390%dir %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/timezones
391%{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/timezones/zones.json
6578c165 392%endif
This page took 0.239806 seconds and 4 git commands to generate.