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