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