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