]> git.pld-linux.org Git - packages/thunderbird.git/blame - thunderbird.spec
updated startup script
[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
210a9feb 6%bcond_without gtk3 # GTK+ 3.x instead of 2.x
44be9ed4 7%bcond_without ldap # disable e-mail address lookups in LDAP directories
e820c55e 8%bcond_without lightning # disable Sunbird/Lightning calendar
765a3a27 9%bcond_with crashreporter # report crashes to crash-stats.mozilla.com
a97d3356
JR
10# - disabled shared_js - https://bugzilla.mozilla.org/show_bug.cgi?id=1039964
11%bcond_with shared_js # shared libmozjs library [broken]
99b97bc4 12%bcond_with system_icu # build with system ICU (disabled due to crashes with system icu 58.2)
88149483 13
f4114a7f 14%if 0%{?_enable_debug_packages} != 1
765a3a27
ER
15%undefine crashreporter
16%endif
17
62096d2c 18%define nspr_ver 4.10.6
3a30e2d7 19%define nss_ver 3.19.2.1
44be9ed4 20
7d981f69
ER
21# The actual sqlite version (see RHBZ#480989):
22%define sqlite_build_version %(pkg-config --silence-errors --modversion sqlite3 2>/dev/null || echo ERROR)
7d981f69 23
cae5b55b
JR
24Summary: Thunderbird - email client
25Summary(pl.UTF-8): Thunderbird - klient poczty
26Name: thunderbird
210a9feb 27Version: 52.0.1
7a5e9406 28Release: 0.1
3366507a 29License: MPL v2.0
2d289b25 30Group: X11/Applications/Mail
cae5b55b 31Source0: http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/%{version}/source/%{name}-%{version}.source.tar.xz
210a9feb 32# Source0-md5: e66a1f513258a515089eed70a7d2a509
dd12359d
JR
33Source1: %{name}.desktop
34Source2: %{name}.sh
35Patch0: prefs.patch
36Patch1: no-subshell.patch
37Patch2: enable-addons.patch
210a9feb 38Patch3: 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
d0b96b40 138
44be9ed4 139%build
fbac75ca 140cat << EOF > .mozconfig
9e7875fc 141mk_add_options MOZ_OBJDIR=%{objdir}
cb0e4412 142
765a3a27
ER
143%if %{with crashreporter}
144export MOZ_DEBUG_SYMBOLS=1
145%endif
146
59c5a0e8 147# Options for 'configure' (same as command-line options).
44be9ed4 148ac_add_options --prefix=%{_prefix}
44be9ed4 149%if %{?debug:1}0
59c5a0e8 150ac_add_options --disable-optimize
44be9ed4 151ac_add_options --enable-debug
152ac_add_options --enable-debug-modules
59c5a0e8
SP
153ac_add_options --enable-debugger-info-modules
154ac_add_options --enable-crash-on-assert
44be9ed4 155%else
156ac_add_options --disable-debug
59c5a0e8 157ac_add_options --enable-optimize="%{rpmcflags} -Os"
44be9ed4 158%endif
88149483 159ac_add_options --disable-strip
210a9feb 160ac_add_options --disable-install-strip
44be9ed4 161%if %{with tests}
162ac_add_options --enable-tests
210a9feb 163ac_add_options --enable-mochitest
44be9ed4 164%else
165ac_add_options --disable-tests
166%endif
3366507a
JB
167%if %{with lightning}
168ac_add_options --enable-calendar
44be9ed4 169%else
3366507a 170ac_add_options --disable-calendar
44be9ed4 171%endif
765a3a27
ER
172%if %{with crashreporter}
173ac_add_options --enable-crashreporter
174%else
59c5a0e8 175ac_add_options --disable-crashreporter
765a3a27 176%endif
99b97bc4
JR
177#ac_add_options --disable-elf-dynstr-gc
178#ac_add_options --disable-elf-hack
3366507a 179ac_add_options --disable-gnomeui
88149483 180ac_add_options --disable-updater
3366507a 181ac_add_options --enable-application=mail
3366507a
JB
182ac_add_options --enable-default-toolkit=%{?with_gtk3:cairo-gtk3}%{!?with_gtk3:cairo-gtk2}
183ac_add_options --enable-gio
184%if %{with ldap}
185ac_add_options --enable-ldap
3366507a
JB
186%else
187ac_add_options --disable-ldap
188%endif
a97d3356 189%{?with_shared_js:ac_add_options --enable-shared-js}
88149483 190ac_add_options --enable-startup-notification
44be9ed4 191ac_add_options --enable-system-cairo
210a9feb 192ac_add_options --enable-system-ffi
5e9bb798 193ac_add_options --enable-system-hunspell
7d981f69 194ac_add_options --enable-system-sqlite
210a9feb 195ac_add_options --enable-url-classifier
3366507a
JB
196ac_add_options --with-default-mozilla-five-home=%{_libdir}/%{name}
197ac_add_options --with-distribution-id=org.pld-linux
88149483
ER
198ac_add_options --with-pthreads
199ac_add_options --with-system-bz2
99b97bc4 200ac_add_options --with%{!?with_system_icu:out}-system-icu
44be9ed4 201ac_add_options --with-system-jpeg
d0b96b40
JR
202ac_add_options --with-system-libevent
203ac_add_options --with-system-libvpx
44be9ed4 204ac_add_options --with-system-nspr
205ac_add_options --with-system-nss
206ac_add_options --with-system-png
207ac_add_options --with-system-zlib
210a9feb 208ac_add_options --with-x
44be9ed4 209EOF
210
d0b96b40 211mkdir -p %{objdir}/config
7a5e9406 212ln -sf %{topdir}/mozilla/config/*.mk %{objdir}/config
d0b96b40 213
90e998ba 214%{__make} -j1 -f client.mk build \
210a9feb
JR
215 AUTOCONF=/usr/bin/autoconf2_13 \
216 MOZ_MAKE_FLAGS="%{_smp_mflags}"
44be9ed4 217
765a3a27
ER
218%if %{with crashreporter}
219# create debuginfo for crash-stats.mozilla.com
220%{__make} -j1 -C obj-%{_target_cpu} buildsymbols
221%endif
222
44be9ed4 223%install
224rm -rf $RPM_BUILD_ROOT
99b97bc4 225install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/%{name}/plugins,%{_datadir}/%{name},%{_pixmapsdir},%{_desktopdir}}
44be9ed4 226
9e7875fc 227cd %{objdir}
ecf04393 228%{__make} -C mail/installer stage-package \
44be9ed4 229 DESTDIR=$RPM_BUILD_ROOT \
d0b96b40 230 installdir=%{_libdir}/%{name} \
44be9ed4 231 PKG_SKIP_STRIP=1
232
cae5b55b 233cp -a dist/thunderbird/* $RPM_BUILD_ROOT%{_libdir}/%{name}/
d0b96b40 234
9b40a2c3 235# Enable crash reporter for Thunderbird application
765a3a27
ER
236%if %{with crashreporter}
237%{__sed} -i -e 's/\[Crash Reporter\]/[Crash Reporter]\nEnabled=1/' $RPM_BUILD_ROOT%{_libdir}/%{name}/application.ini
238
239# Add debuginfo for crash-stats.mozilla.com
51a3b6db 240install -d $RPM_BUILD_ROOT%{_exec_prefix}/lib/debug%{_libdir}/%{name}
3a30e2d7 241cp -a dist/%{name}-%{version}.en-US.linux-*.crashreporter-symbols.zip $RPM_BUILD_ROOT%{_prefix}/lib/debug%{_libdir}/%{name}
765a3a27
ER
242%endif
243
99b97bc4
JR
244%{__sed} -e 's,@LIBDIR@,%{_libdir},' %{SOURCE2} > $RPM_BUILD_ROOT%{_bindir}/%{name}
245cp -p dist/thunderbird/chrome/icons/default/default48.png $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
246cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
c6ec3c1c 247
99b97bc4
JR
248# use system dict
249%{__rm} -rv $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
44be9ed4 250ln -s %{_datadir}/myspell $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
99b97bc4 251ln -s %{_datadir}/myspell $RPM_BUILD_ROOT%{_libdir}/%{name}/hyphenation
e6bc19b3 252
99b97bc4
JR
253# move arch independant ones to datadir
254mv $RPM_BUILD_ROOT%{_libdir}/%{name}/chrome $RPM_BUILD_ROOT%{_datadir}/%{name}/chrome
255mv $RPM_BUILD_ROOT%{_libdir}/%{name}/defaults $RPM_BUILD_ROOT%{_datadir}/%{name}/defaults
256mv $RPM_BUILD_ROOT%{_libdir}/%{name}/isp $RPM_BUILD_ROOT%{_datadir}/%{name}/isp
257ln -s ../../share/%{name}/chrome $RPM_BUILD_ROOT%{_libdir}/%{name}/chrome
258ln -s ../../share/%{name}/defaults $RPM_BUILD_ROOT%{_libdir}/%{name}/defaults
259ln -s ../../share/%{name}/isp $RPM_BUILD_ROOT%{_libdir}/%{name}/isp
52fc61e6 260
283702b9 261# mozldap
d0b96b40
JR
262%{__sed} -i '/lib\(ldap\|ldif\|prldap\)60.so/d' $RPM_BUILD_ROOT%{_libdir}/%{name}/dependentlibs.list
263%{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/lib{ldap,ldif,prldap}60.so
283702b9 264
99b97bc4
JR
265# remove unecessary stuff
266%{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/removed-files
267
44be9ed4 268%clean
269rm -rf $RPM_BUILD_ROOT
270
271%pretrans
272if [ -d %{_libdir}/%{name}/dictionaries ] && [ ! -L %{_libdir}/%{name}/dictionaries ]; then
273 mv -v %{_libdir}/%{name}/dictionaries{,.rpmsave}
274fi
99b97bc4 275for d in chrome defaults icons isp modules res; do
44be9ed4 276 if [ -d %{_libdir}/%{name}/$d ] && [ ! -L %{_libdir}/%{name}/$d ]; then
277 install -d %{_datadir}/%{name}
278 mv %{_libdir}/%{name}/$d %{_datadir}/%{name}/$d
279 fi
280done
281exit 0
282
e8f4ba81 283%post
99b97bc4
JR
284%update_desktop_database_post
285# make temporary HOME, as it attempts to touch files in $HOME/.mozilla
286# dangerous if you run this with sudo with keep_env += HOME
287# also TMPDIR could be pointing to sudo user's homedir so we reset that too.
288export HOME=$(mktemp -d)
289unset TMPDIR TMP || :
290umask 022
291%{_libdir}/%{name}/thunderbird -register
292rm -rf $HOME
293
294%postun
295%update_desktop_database_postun
e8f4ba81 296
44be9ed4 297%files
298%defattr(644,root,root,755)
99b97bc4 299%attr(755,root,root) %{_bindir}/%{name}
44be9ed4 300%dir %{_libdir}/%{name}
99b97bc4
JR
301%dir %{_libdir}/%{name}/plugins
302
303%if %{with gtk3}
304%dir %{_libdir}/%{name}/gtk2
305%attr(755,root,root) %{_libdir}/%{name}/gtk2/libmozgtk.so
306%attr(755,root,root) %{_libdir}/%{name}/libmozgtk.so
307%endif
308%attr(755,root,root) %{_libdir}/%{name}/liblgpllibs.so
309%{?with_shared_js:%attr(755,root,root) %{_libdir}/%{name}/libmozjs.so}
210a9feb 310%attr(755,root,root) %{_libdir}/%{name}/libmozsandbox.so
99b97bc4 311%attr(755,root,root) %{_libdir}/%{name}/libxul.so
73d54cb2
JB
312%attr(755,root,root) %{_libdir}/%{name}/*.sh
313%attr(755,root,root) %{_libdir}/%{name}/*-bin
99b97bc4 314%attr(755,root,root) %{_libdir}/%{name}/plugin-container
cae5b55b 315%attr(755,root,root) %{_libdir}/%{name}/thunderbird
99b97bc4
JR
316
317%{_libdir}/%{name}/application.ini
318%{_libdir}/%{name}/blocklist.xml
a367af64 319%{_libdir}/%{name}/dependentlibs.list
99b97bc4 320%{_libdir}/%{name}/omni.ja
73d54cb2 321%{_libdir}/%{name}/platform.ini
210a9feb
JR
322%{!?with_system_icu:%{_libdir}/%{name}/icudt58l.dat}
323
324%dir %{_libdir}/%{name}/fonts
325%{_libdir}/%{name}/fonts/EmojiOneMozilla.ttf
44be9ed4 326
765a3a27
ER
327%if %{with crashreporter}
328%attr(755,root,root) %{_libdir}/%{name}/crashreporter
329%{_libdir}/%{name}/crashreporter.ini
330%{_libdir}/%{name}/Throbber-small.gif
331%endif
332
44be9ed4 333%dir %{_libdir}/%{name}/extensions
99b97bc4
JR
334%{_libdir}/%{name}/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}.xpi
335
336%dir %{_libdir}/%{name}/distribution
337%dir %{_libdir}/%{name}/distribution/extensions
338
339# symlinks
340%{_libdir}/%{name}/chrome
341%{_libdir}/%{name}/defaults
342%{_libdir}/%{name}/dictionaries
343%{_libdir}/%{name}/hyphenation
344%{_libdir}/%{name}/isp
6578c165 345
99b97bc4
JR
346%{_pixmapsdir}/*.png
347%{_desktopdir}/*.desktop
52fc61e6 348
99b97bc4
JR
349%dir %{_datadir}/%{name}
350%{_datadir}/%{name}/chrome
351%{_datadir}/%{name}/defaults
352%{_datadir}/%{name}/isp
d0b96b40 353
6578c165 354%if %{with lightning}
355%files addon-lightning
356%defattr(644,root,root,755)
3a30e2d7
JR
357%dir %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}
358%{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/app.ini
359%{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/chrome.jar
360%{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/chrome.manifest
361%{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/defaults
362%{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/install.rdf
363%dir %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components
3a30e2d7
JR
364%{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.js
365%{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*manifest
366%{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.xpt
367%{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/modules
368%{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/calendar-js
369%dir %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/timezones
370%{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/timezones/zones.json
6578c165 371%endif
This page took 0.128387 seconds and 4 git commands to generate.