# TODO: # - build with system mozldap # - fix startup crash "TypeError: a is null" # # Conditional builds %bcond_without gtk3 # GTK+ 3.x instead of 2.x %bcond_without ldap # disable e-mail address lookups in LDAP directories %bcond_without lightning # disable Sunbird/Lightning calendar %bcond_with crashreporter # report crashes to crash-stats.mozilla.com # - disabled shared_js - https://bugzilla.mozilla.org/show_bug.cgi?id=1039964 %bcond_with shared_js # shared libmozjs library [broken] %bcond_with system_icu # build with system ICU (disabled due to crashes with system icu 58.2) %if 0%{?_enable_debug_packages} != 1 %undefine crashreporter %endif %define nspr_ver 4.10.6 %define nss_ver 3.19.2.1 # The actual sqlite version (see RHBZ#480989): %define sqlite_build_version %(pkg-config --silence-errors --modversion sqlite3 2>/dev/null || echo ERROR) Summary: Thunderbird - email client Summary(pl.UTF-8): Thunderbird - klient poczty Name: thunderbird Version: 52.0.1 Release: 0.1 License: MPL v2.0 Group: X11/Applications/Mail Source0: http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/%{version}/source/%{name}-%{version}.source.tar.xz # Source0-md5: e66a1f513258a515089eed70a7d2a509 Source1: %{name}.desktop Source2: %{name}.sh Patch0: prefs.patch Patch1: no-subshell.patch Patch2: enable-addons.patch Patch3: mozilla-1245783.patch URL: http://www.mozilla.org/projects/thunderbird/ BuildRequires: GConf2-devel >= 1.2.1 BuildRequires: alsa-lib-devel BuildRequires: automake BuildRequires: bzip2-devel BuildRequires: cairo-devel >= 1.10 BuildRequires: dbus-glib-devel >= 0.60 BuildRequires: freetype-devel >= 1:2.1.8 BuildRequires: glib2-devel >= 1:2.20 BuildRequires: gstreamer0.10-devel BuildRequires: gstreamer0.10-plugins-base-devel %{!?with_gtk3:BuildRequires: gtk+2-devel >= 2:2.18.0} %{?with_gtk3:BuildRequires: gtk+3-devel >= 3.4.0} BuildRequires: hunspell-devel BuildRequires: libIDL-devel >= 0.8.0 BuildRequires: libevent-devel %{?with_system_icu:BuildRequires: libicu-devel >= 58.1} BuildRequires: libiw-devel # requires libjpeg-turbo implementing at least libjpeg 6b API BuildRequires: libjpeg-devel >= 6b BuildRequires: libjpeg-turbo-devel BuildRequires: libpng-devel >= 1.4.1 BuildRequires: libstdc++-devel BuildRequires: libvpx-devel >= 1.3.0 BuildRequires: mozldap-devel BuildRequires: nspr-devel >= 1:%{nspr_ver} BuildRequires: nss-devel >= 1:%{nss_ver} BuildRequires: pango-devel >= 1:1.22.0 BuildRequires: perl-base >= 1:5.6 BuildRequires: pkgconfig BuildRequires: python >= 1:2.5 BuildRequires: python-virtualenv BuildRequires: sed >= 4.0 BuildRequires: sqlite3-devel >= 3.8.4.2 BuildRequires: startup-notification-devel >= 0.8 BuildRequires: virtualenv BuildRequires: xorg-lib-libXext-devel BuildRequires: xorg-lib-libXinerama-devel BuildRequires: xorg-lib-libXt-devel BuildRequires: yasm BuildRequires: zip Requires: glib2 >= 1:2.20 %{!?with_gtk3:Requires: gtk+2 >= 2:2.18.0} %{?with_gtk3:Requires: gtk+3 >= 3.4.0} Requires: libvpx >= 1.3.0 Requires: myspell-common Requires: nspr >= 1:%{nspr_ver} Requires: nss >= 1:%{nss_ver} Requires: pango >= 1:1.22.0 Requires: sqlite3 >= %{sqlite_build_version} Requires(post): mktemp >= 1.5-18 Requires: libjpeg-turbo Obsoletes: icedove Obsoletes: mozilla-thunderbird Obsoletes: mozilla-thunderbird-dictionary-en-US Conflicts: thunderbird-lang-resources < %{version} BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %define filterout_cpp -D_FORTIFY_SOURCE=[0-9]+ # firefox/thunderbird/seamonkey provide their own versions %define _noautoprovfiles %{_libdir}/%{name}/components # we don't want these to satisfy packages depending on xulrunner %define _noautoprov libmozalloc.so libmozjs.so libxul.so # and as we don't provide them, don't require either %define _noautoreq libmozalloc.so libmozjs.so libxul.so %define topdir %{_builddir}/thunderbird-%{version} %define objdir %{topdir}/obj-%{_target_cpu} %description Thunderbird is an open-source, fast and portable email client. %description -l pl.UTF-8 Thunderbird jest mającym otwarte źródła, szybkim i przenośnym klientem poczty. %package addon-lightning Summary: An integrated calendar for Thunderbird Summary(pl.UTF-8): Zintegrowany kalendarz dla Thunderbird License: MPL 1.1 or GPL v2+ or LGPL v2.1+ Group: Applications/Networking Requires: %{name} = %{version}-%{release} Obsoletes: icedove-addon-lightning %description addon-lightning Lightning is an calendar extension to Thunderbird email client. %description addon-lightning -l pl.UTF-8 Lightning to rozszerzenie do klienta poczty Thunderbird dodające funkcjonalność kalendarza. %prep %setup -q %patch0 -p1 %patch1 -p1 %patch2 -p1 %patch3 -p1 %build cat << EOF > .mozconfig mk_add_options MOZ_OBJDIR=%{objdir} %if %{with crashreporter} export MOZ_DEBUG_SYMBOLS=1 %endif # Options for 'configure' (same as command-line options). ac_add_options --prefix=%{_prefix} %if %{?debug:1}0 ac_add_options --disable-optimize ac_add_options --enable-debug ac_add_options --enable-debug-modules ac_add_options --enable-debugger-info-modules ac_add_options --enable-crash-on-assert %else ac_add_options --disable-debug ac_add_options --enable-optimize="%{rpmcflags} -Os" %endif ac_add_options --disable-strip ac_add_options --disable-install-strip %if %{with tests} ac_add_options --enable-tests ac_add_options --enable-mochitest %else ac_add_options --disable-tests %endif %if %{with lightning} ac_add_options --enable-calendar %else ac_add_options --disable-calendar %endif %if %{with crashreporter} ac_add_options --enable-crashreporter %else ac_add_options --disable-crashreporter %endif #ac_add_options --disable-elf-dynstr-gc #ac_add_options --disable-elf-hack ac_add_options --disable-gnomeui ac_add_options --disable-updater ac_add_options --enable-application=mail ac_add_options --enable-default-toolkit=%{?with_gtk3:cairo-gtk3}%{!?with_gtk3:cairo-gtk2} ac_add_options --enable-gio %if %{with ldap} ac_add_options --enable-ldap %else ac_add_options --disable-ldap %endif %{?with_shared_js:ac_add_options --enable-shared-js} ac_add_options --enable-startup-notification ac_add_options --enable-system-cairo ac_add_options --enable-system-ffi ac_add_options --enable-system-hunspell ac_add_options --enable-system-sqlite ac_add_options --enable-url-classifier ac_add_options --with-default-mozilla-five-home=%{_libdir}/%{name} ac_add_options --with-distribution-id=org.pld-linux ac_add_options --with-pthreads ac_add_options --with-system-bz2 ac_add_options --with%{!?with_system_icu:out}-system-icu ac_add_options --with-system-jpeg ac_add_options --with-system-libevent ac_add_options --with-system-libvpx ac_add_options --with-system-nspr ac_add_options --with-system-nss ac_add_options --with-system-png ac_add_options --with-system-zlib ac_add_options --with-x EOF mkdir -p %{objdir}/config ln -sf %{topdir}/mozilla/config/*.mk %{objdir}/config %{__make} -j1 -f client.mk build \ AUTOCONF=/usr/bin/autoconf2_13 \ MOZ_MAKE_FLAGS="%{_smp_mflags}" %if %{with crashreporter} # create debuginfo for crash-stats.mozilla.com %{__make} -j1 -C obj-%{_target_cpu} buildsymbols %endif %install rm -rf $RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/%{name}/plugins,%{_datadir}/%{name},%{_pixmapsdir},%{_desktopdir}} cd %{objdir} %{__make} -C mail/installer stage-package \ DESTDIR=$RPM_BUILD_ROOT \ installdir=%{_libdir}/%{name} \ PKG_SKIP_STRIP=1 cp -a dist/thunderbird/* $RPM_BUILD_ROOT%{_libdir}/%{name}/ # Enable crash reporter for Thunderbird application %if %{with crashreporter} %{__sed} -i -e 's/\[Crash Reporter\]/[Crash Reporter]\nEnabled=1/' $RPM_BUILD_ROOT%{_libdir}/%{name}/application.ini # Add debuginfo for crash-stats.mozilla.com install -d $RPM_BUILD_ROOT%{_exec_prefix}/lib/debug%{_libdir}/%{name} cp -a dist/%{name}-%{version}.en-US.linux-*.crashreporter-symbols.zip $RPM_BUILD_ROOT%{_prefix}/lib/debug%{_libdir}/%{name} %endif %{__sed} -e 's,@LIBDIR@,%{_libdir},' %{SOURCE2} > $RPM_BUILD_ROOT%{_bindir}/%{name} cp -p dist/thunderbird/chrome/icons/default/default48.png $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop # use system dict %{__rm} -rv $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries ln -s %{_datadir}/myspell $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries ln -s %{_datadir}/myspell $RPM_BUILD_ROOT%{_libdir}/%{name}/hyphenation # move arch independant ones to datadir mv $RPM_BUILD_ROOT%{_libdir}/%{name}/chrome $RPM_BUILD_ROOT%{_datadir}/%{name}/chrome mv $RPM_BUILD_ROOT%{_libdir}/%{name}/defaults $RPM_BUILD_ROOT%{_datadir}/%{name}/defaults mv $RPM_BUILD_ROOT%{_libdir}/%{name}/isp $RPM_BUILD_ROOT%{_datadir}/%{name}/isp ln -s ../../share/%{name}/chrome $RPM_BUILD_ROOT%{_libdir}/%{name}/chrome ln -s ../../share/%{name}/defaults $RPM_BUILD_ROOT%{_libdir}/%{name}/defaults ln -s ../../share/%{name}/isp $RPM_BUILD_ROOT%{_libdir}/%{name}/isp # mozldap %{__sed} -i '/lib\(ldap\|ldif\|prldap\)60.so/d' $RPM_BUILD_ROOT%{_libdir}/%{name}/dependentlibs.list %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/lib{ldap,ldif,prldap}60.so # remove unecessary stuff %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/removed-files %clean rm -rf $RPM_BUILD_ROOT %pretrans if [ -d %{_libdir}/%{name}/dictionaries ] && [ ! -L %{_libdir}/%{name}/dictionaries ]; then mv -v %{_libdir}/%{name}/dictionaries{,.rpmsave} fi for d in chrome defaults icons isp modules res; do if [ -d %{_libdir}/%{name}/$d ] && [ ! -L %{_libdir}/%{name}/$d ]; then install -d %{_datadir}/%{name} mv %{_libdir}/%{name}/$d %{_datadir}/%{name}/$d fi done exit 0 %post %update_desktop_database_post # make temporary HOME, as it attempts to touch files in $HOME/.mozilla # dangerous if you run this with sudo with keep_env += HOME # also TMPDIR could be pointing to sudo user's homedir so we reset that too. export HOME=$(mktemp -d) unset TMPDIR TMP || : umask 022 %{_libdir}/%{name}/thunderbird -register rm -rf $HOME %postun %update_desktop_database_postun %files %defattr(644,root,root,755) %attr(755,root,root) %{_bindir}/%{name} %dir %{_libdir}/%{name} %dir %{_libdir}/%{name}/plugins %if %{with gtk3} %dir %{_libdir}/%{name}/gtk2 %attr(755,root,root) %{_libdir}/%{name}/gtk2/libmozgtk.so %attr(755,root,root) %{_libdir}/%{name}/libmozgtk.so %endif %attr(755,root,root) %{_libdir}/%{name}/liblgpllibs.so %{?with_shared_js:%attr(755,root,root) %{_libdir}/%{name}/libmozjs.so} %attr(755,root,root) %{_libdir}/%{name}/libmozsandbox.so %attr(755,root,root) %{_libdir}/%{name}/libxul.so %attr(755,root,root) %{_libdir}/%{name}/*.sh %attr(755,root,root) %{_libdir}/%{name}/*-bin %attr(755,root,root) %{_libdir}/%{name}/plugin-container %attr(755,root,root) %{_libdir}/%{name}/thunderbird %{_libdir}/%{name}/application.ini %{_libdir}/%{name}/blocklist.xml %{_libdir}/%{name}/dependentlibs.list %{_libdir}/%{name}/omni.ja %{_libdir}/%{name}/platform.ini %{!?with_system_icu:%{_libdir}/%{name}/icudt58l.dat} %dir %{_libdir}/%{name}/fonts %{_libdir}/%{name}/fonts/EmojiOneMozilla.ttf %if %{with crashreporter} %attr(755,root,root) %{_libdir}/%{name}/crashreporter %{_libdir}/%{name}/crashreporter.ini %{_libdir}/%{name}/Throbber-small.gif %endif %dir %{_libdir}/%{name}/extensions %{_libdir}/%{name}/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}.xpi %dir %{_libdir}/%{name}/distribution %dir %{_libdir}/%{name}/distribution/extensions # symlinks %{_libdir}/%{name}/chrome %{_libdir}/%{name}/defaults %{_libdir}/%{name}/dictionaries %{_libdir}/%{name}/hyphenation %{_libdir}/%{name}/isp %{_pixmapsdir}/*.png %{_desktopdir}/*.desktop %dir %{_datadir}/%{name} %{_datadir}/%{name}/chrome %{_datadir}/%{name}/defaults %{_datadir}/%{name}/isp %if %{with lightning} %files addon-lightning %defattr(644,root,root,755) %dir %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103} %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/app.ini %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/chrome.jar %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/chrome.manifest %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/defaults %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/install.rdf %dir %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.js %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*manifest %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.xpt %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/modules %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/calendar-js %dir %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/timezones %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/timezones/zones.json %endif