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