Sophie

Sophie

distrib > Mageia > 1 > i586 > media > core-updates-src > by-pkgid > 3e2f51d45418af46283808fef5dfae8c > files > 14

mozilla-thunderbird-10.0.8-1.mga1.src.rpm

%define __libtoolize /bin/true
%define __cputoolize /bin/true

%define upstream_version %{version}esr
%define release_dir comm-esr10

%define official_branding 1

%define release %mkrel 1

%if %{official_branding}
%define title Mozilla Thunderbird
%else
%define title Mail/News
%endif

%define oname thunderbird
%define tb_appid \{3550f703-e582-4d05-9a08-453d09bdfdc6\}
%define tbdir %{_libdir}/%{oname}-%{version}
%define tbextdir %{_libdir}/mozilla/extensions/%{tb_appid}

%define xpi 0
%define enigmail_version 1.4
%define enigmail_short_version 1.4
%define enigmail_id \{847b3a00-7ab1-11d4-8f02-006008948af5\}

%define _provides_exceptions libgtkembedmoz.so\\|libxpcom.so
%define _requires_exceptions libgtkembedmoz.so\\|libxpcom.so\\|libxul.so

# FIXME: Bug in nsExtensionManager.js prevents using x86_64 as arch
# FIXME: I tried to modify nsExtensionManager.js.in, but it
# FIXME: complained that I had modified it
%ifarch %{ix86}
%define tbarch x86
%else # ix86
%ifarch x86_64
%define tbarch %{_arch}
%else # x86_64
%define tbarch %{_arch}
%endif # x86_64
%endif # ix86

# this seems fragile, so require the exact version or later (#58754)
%define sqlite3_version %(pkg-config --modversion sqlite3 &>/dev/null && pkg-config --modversion sqlite3 2>/dev/null || echo 0)
# this one as well (#59759)
%define nss_libname %mklibname nss 3
%define nss_version %(pkg-config --modversion nss &>/dev/null && pkg-config --modversion nss 2>/dev/null || echo 0)

Name:		mozilla-thunderbird
Epoch:		0
Version:	10.0.8
Release:	%{release}
Summary:	Full-featured email, RSS, and newsgroup client
License:	MPL
Group:		Networking/Mail
URL:		http://www.mozilla.org/en-US/thunderbird/organizations/all-esr.html
Source0:        ftp://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/%{upstream_version}/source/thunderbird-%{upstream_version}.source.tar.bz2
Source12:       mozilla-thunderbird-mageia-default-prefs.js
Source30:       mozilla-thunderbird-open-browser.sh
Source31:       mozilla-thunderbird-open-browser-xdg.sh
# Mandriva sources (Source300+)
Source300:      http://www.mozilla-enigmail.org/download/source/enigmail-%{enigmail_version}.tar.gz
Source301:      http://www.mozilla-enigmail.org/download/source/enigmail-%{enigmail_version}.tar.gz.asc
Source302:      %{name}-icons.tar.bz2
# Language package template
Source400:	mozilla-thunderbird-enigmail-l10n-template.in
# Build patches
Patch2:         mozilla-firefox-1.0-prdtoa.patch
# Mageia patches (patch100+)
# use libcanberra to play sounds rather than deprecated esound
# taken from upstream: https://bugzilla.mozilla.org/show_bug.cgi?id=635918
Patch100:	mozilla-thunderbird-mga-use-libcanberra.patch
# Debian patches (Patch200+)
Patch201:	mozilla-thunderbird-5.0-mga-default-mailer.patch
# Mandriva patches (Patch300+)
Patch300:       mozilla-thunderbird-0.8-progname.patch
Patch301:       mozilla-thunderbird-enigmail-package.patch
Patch304:       mozilla-thunderbird-run-mozilla.patch
# OpenSuse patches (Patch400+)
Patch400:	thunderbird-appname.patch

BuildRequires:	autoconf2.1
BuildRequires:	cairo-devel >= 1.8.8
Requires:	%{mklibname sqlite3_ 0} >= %{sqlite3_version}
BuildRequires:	sqlite3-devel >= 3.7.5
Requires:	%{nss_libname} >= 2:%{nss_version}
BuildRequires:  yasm
BuildRequires:  mesagl-devel
BuildRequires:  gtk2-devel
BuildRequires:  gzip
BuildRequires:	python-devel
BuildRequires:  libjpeg-devel
#(tpg) older versions doesn't support apng extension
# disabled because we use bundled libpng
#BuildRequires:	libpng-devel >= 2:1.4
BuildRequires:  nspr-devel >= 2:4.8.8
BuildRequires:  nss-static-devel >= 2:3.12.10
BuildRequires:  unzip
BuildRequires:  zip
BuildRequires:	zlib-devel
BuildRequires:	libIDL-devel
# Needed by xmlterm (not built) and unused enigmail scripts
#BuildRequires:	tcsh
BuildRequires:	freetype2-devel
BuildRequires:	xft2-devel
BuildRequires:	libxt-devel
BuildRequires:	hunspell-devel
BuildRequires:	dbus-glib-devel
Requires(post):	mktemp
Requires(post): rpm-helper
Requires(postun): rpm-helper
Suggests:	%{_lib}canberra0
# Integrates thunderbird with xdg-utils.
Requires: xdg-utils
%if %{official_branding}
BuildRequires:	imagemagick
%endif
# Thunderbird 3 requires alsa
BuildRequires:	libalsa-devel
BuildRequires:	python
BuildRequires:	libnotify-devel
BuildRequires:	startup-notification-devel
BuildRequires:	libiw-devel
BuildRequires:  libevent-devel >= 1.4.7
BuildRequires:  libvpx-devel >= 0.9.7

%description
%{title} is a full-featured email, RSS and newsgroup client that
makes emailing safer, faster and easier than ever before.

#===============================================================================

%package enigmail
Summary:        Access the authentication and encryption features provided by GnuPG
Group:          Networking/Mail
Requires:       %{name} = %{version}
Obsoletes:      %{name}-enigmime
Provides:       %{name}-enigmime = %{version}
Requires:       gnupg
Requires(post): %{name} = %{version}
Requires(preun): %{name} = %{version}
Requires(post):	mktemp
Requires(postun): mktemp
Suggests:	pinentry-gtk

%description enigmail
Enigmail is an extension to the mail client of %{title}
which allows users to access the authentication and encryption
features provided by GnuPG.

Main Features

    * Encrypt/sign mail when sending, decrypt/authenticate received
      mail
    * Support for inline-PGP (RFC 2440) and PGP/MIME (RFC 3156)
    * Per-Account based encryption and signing defaults
    * Per-Recipient rules for automated key selection, and
      enabling/disabling encryption and signing
    * OpenPGP key management interface

#===============================================================================

%package -n nsinstall
Summary:        Netscape portable install command
Group:          Development/Other

%description -n nsinstall
Netscape portable install command.

#===============================================================================
# enigmail-l10n
# Supported l10n language lists
%define l10n_langlist	ar ca cs de el es fi fr it ja ko nb nl pl pt pt_BR ru sl sv tr vi zh_CN zh_TW

# Disabled l10n languages, for any reason
# nl sk es_AR do not support 0.95.0 yet
%define disabled_l10n_langlist	hu
# define disabled_l10n_langlist %{nil}

# Language descriptions
%define language_ar ar
%define langname_ar Arabic
%define language_ca ca
%define langname_ca Catalan
%define language_cs cs-CZ
%define langname_cs Czech
%define language_de de
%define langname_de German
%define language_el el
%define langname_el Greek
%define language_es_AR es-AR
%define langname_es_AR Spanish (Argentina)
%define language_es es-ES
%define langname_es Spanish
%define language_fi fi-FI
%define langname_fi Finnish
%define language_fr fr
%define langname_fr French
%define language_hu hu-HU
%define langname_hu Hungarian
%define language_it it-IT
%define langname_it Italian
%define language_ja ja-JP
%define langname_ja Japanese
%define language_ko ko-KR
%define langname_ko Korean
%define language_nb nb-NO
%define langname_nb Norwegian Bokmaal
%define langname_nl Dutch
%define language_nl nl
%define language_pl pl
%define langname_pl Polish
%define langname_pt Portuguese
%define language_pt pt-PT
%define language_pt_BR pt-BR
%define langname_pt_BR Brazilian portuguese
%define language_ro ro-RO
%define langname_ro Romanian
%define language_ru ru-RU
%define langname_ru Russian
%define language_sk sk
%define langname_sk Slovak
%define language_sl sl-SI
%define langname_sl Slovenian
%define language_sv sv-SE
%define langname_sv Swedish
%define language_tr tr
%define langname_tr Turkish
%define language_vi vi
%define langname_vi Vietnamese
%define language_zh_CN zh-CN
%define langname_zh_CN Simplified Chinese
%define language_zh_TW zh-TW
%define langname_zh_TW Traditional Chinese

# --- Danger line ---

# All langs
%{expand:%%define langlist %(for lang in %l10n_langlist; do echo "$lang"; done | sort -u | sed ':a;$!N;s/\n/ /;ta')}

# Defaults (all languages enabled by default)
# l10n
%{expand:%(for lang in %l10n_langlist; do echo "%%define l10n_$lang 1"; done)}
%{expand:%(for lang in %disabled_l10n_langlist; do echo "%%define l10n_$lang 0"; done)}

# Params
%{expand:%(for lang in %langlist; do echo "%%bcond_without $lang"; done)}

# Locales
%{expand:%(for lang in %l10n_langlist; do echo "%%define locale_$lang `echo $lang | cut -d _ -f 1` "; done)}

# Expand all languages packages.
%{expand:%(\
	for lang in %langlist; do\
		echo "%%{expand:%%(sed "s!__LANG__!$lang!g" %{_sourcedir}/mozilla-thunderbird-enigmail-l10n-template.in 2> /dev/null)}";\
	done\
	)
}
#===============================================================================

%prep
%setup -q -c -n %{name}-%{version}

#===================
# Thunderbird itself
%setup -q -T -D -n %{name}-%{version}/%{release_dir}

%patch2 -p0

%patch100 -p2 -b .libcanberra

%patch201 -p0 -b .default_mailer
%patch300 -p0 -b .progname
%patch301 -p1 -b .enigmailpackage
%patch304 -p0 -b .run-mozilla

%patch400 -p1 -b .appname

#===============================================================================
# Enigmail
%setup -q -T -D -n %{name}-%{version}/%{release_dir}/mozilla/extensions -a300

%if !%{official_branding}
%setup -q -T -D -n %{name}-%{version}/%{release_dir} -a302
%endif

%setup -q -T -D -n %{name}-%{version}/%{release_dir}

#===============================================================================

%build
export BUILD_OFFICIAL=1
export MOZILLA_OFFICIAL=1

CFLAGS=$(echo %optflags | %{__sed} -e 's/-fexceptions//')
CFLAGS="$CFLAGS -fno-strict-aliasing -fpermissive"
CXXFLAGS="$CFLAGS"
RPM_OPT_FLAGS="$CFLAGS"
LDFLAGS="%ldflags"
export CFLAGS
export CXXFLAGS
export RPM_OPT_FLAGS
export LDFLAGS

export MOZCONFIG=`pwd`/.mozconfig
cat > $MOZCONFIG << EOF
mk_add_options MOZILLA_OFFICIAL=1
mk_add_options BUILD_OFFICIAL=1
mk_add_options MOZ_MAKE_FLAGS="%{_smp_mflags}"
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@
ac_add_options --prefix="%{_prefix}"
ac_add_options --libdir="%{_libdir}"
ac_add_options --sysconfdir="%{_sysconfdir}"
ac_add_options --mandir="%{_mandir}"
ac_add_options --includedir="%{_includedir}"
ac_add_options --datadir="%{_datadir}"
ac_add_options --enable-application=mail
ac_add_options --with-system-nspr
ac_add_options --with-system-nss
ac_add_options --with-system-jpeg
ac_add_options --with-system-zlib
ac_add_options --without-system-png
ac_add_options --with-system-bz2
ac_add_options --enable-system-sqlite
ac_add_options --enable-system-hunspell
ac_add_options --enable-system-cairo
ac_add_options --with-pthreads
ac_add_options --disable-tests
ac_add_options --disable-debug
ac_add_options --disable-installer
ac_add_options --disable-updater
ac_add_options --enable-xinerama
ac_add_options --disable-crashreporter
ac_add_options --enable-default-toolkit=cairo-gtk2
ac_add_options --disable-xprint
ac_add_options --disable-strip
ac_add_options --enable-pango
ac_add_options --enable-startup-notification
ac_add_options --enable-svg
ac_add_options --enable-canvas
ac_add_options --enable-crypto
ac_add_options --enable-mathml
ac_add_options --disable-gnomevfs
ac_add_options --enable-gio
ac_add_options --disable-calendar
ac_add_options --with-system-libevent
ac_add_options --with-system-libvpx
ac_add_options --enable-optimize
ac_add_options --enable-official-branding
ac_add_options --with-distribution-id=org.mageia
EOF

# Fix ABI for thunderbird and enigmail
%{__perl} -pi -e 's|^TARGET_XPCOM_ABI =.*|TARGET_XPCOM_ABI = %{tbarch}-gcc3|' config/autoconf.mk.in
%{__perl} -pi -e 's|^ENIG_XPCOM_ABI =.*|ENIG_XPCOM_ABI = Linux_%{tbarch}-gcc3|' mozilla/extensions/enigmail/Makefile.in

# Compress jars
%{__perl} -pi -e 's|\-0|\-9|g' config/make-jars.pl

%make -f client.mk build

#===============================================================================

pushd mozilla/extensions/enigmail

for i in `find . -type f -name Makefile.in`; do
    if [ -f $i.bak ]; then
        cp $i.bak $i
    else
        %{__cp} $i $i.bak
    fi
#    %{__perl} -pi -e 's|^(DEPTH.*= )../|\1|;' $i
done

./makemake -r
%{make} LOCAL_INCLUDES+="-I\$(DEPTH)/mailnews/mime/src -I../build -I../src -I../ipc/src"

(cd lang
 %{__perl} -pi -e 's|es-AR/enigmail.properties|es-ES/enigmail.properties|' jar.mn
 echo 'zh-TW' >> current-languages.txt
 %{make} LOCAL_INCLUDES+="-I\$(DEPTH)/mailnews/mime/src -I../build -I../src -I../ipc/src"
 for i in `cat current-languages.txt`; do
   ./make-lang.sh $i %{enigmail_short_version}
 done
)

%{make} xpi

popd

#===============================================================================

%install
%{__rm} -rf %{buildroot}
%{__mkdir_p} %{buildroot}{%{_libdir},%{_bindir},%{_datadir}/applications}
%{__mkdir_p} %buildroot%tbdir

rm -f extensions/spellcheck/locales/en-US/hunspell/en-US.{dic,aff}

# workaround to use system nss shlibsign instead currently missing bundled one
# https://bugzilla.mozilla.org/show_bug.cgi?id=736327
ln -s  %{_bindir}/shlibsign %{_builddir}/%{name}-%{version}/%{release_dir}/mozilla/dist/bin/shlibsign

%makeinstall_std

rm -rf %buildroot%tbdir/dictionaries
ln -s /usr/share/dict/mozilla %buildroot%tbdir/dictionaries

%if %{official_branding}
%{__install} -p -D %{buildroot}/%{tbdir}/chrome/icons/default/default256.png %{buildroot}%{_datadir}/pixmaps/%{name}.png
%else
%{__install} -p -D %{SOURCE302} %{buildroot}%{_datadir}/pixmaps/%{name}.png
%endif

cat << EOF > %{buildroot}/%{_datadir}/applications/%_real_vendor-%{name}.desktop
[Desktop Entry]
Version=1.0
Name=%{title}
GenericName=Mail/News
Comment=Mail and News Client
Exec=%{name}
Icon=mozilla-thunderbird
Terminal=false
Type=Application
StartupWMClass=Thunderbird-bin
MimeType=message/rfc822;x-scheme-handler/mailto;
Categories=GTK;Network;News;Email;X-MandrivaLinux-CrossDesktop;
EOF

# set up the thunderbird start script
(cd %{buildroot}%{_bindir} && %{__ln_s} thunderbird %{name})

%{__perl} -pi -e 's|^moz_libdir=.*|moz_libdir=%{tbdir}|' %{buildroot}/%{_bindir}/thunderbird
%{__perl} -pi -e 's|^MRE_HOME=.*|MRE_HOME=%{tbdir}|' %{buildroot}/%{_bindir}/thunderbird

# <mrl> 200800 is safe here.
# For backwards compatibility with old profiles. Bug #37528
%{__install} -m 755 %{SOURCE31} %{buildroot}/%{tbdir}/open-browser.sh
# For new profiles
%define COMMAND /usr/bin/xdg-open

#used for matching system locale on startup
%{__cat} %{SOURCE12} | %{__perl} -p -e 's,THUNDERBIRD_RPM_VR,%{version}-%{release},g;' \
                                    -e 's,THUNDERBIRD_VENDOR_COMMENT,%{product_release},g;' \
                                    -e 's,COMMAND,%{COMMAND},g' \
  > %{buildroot}/mga-default-prefs
%{__cp} -a %{buildroot}/mga-default-prefs %{buildroot}%{tbdir}/defaults/pref/all-mageia.js
%{__rm} -f %{buildroot}/mga-default-prefs

#===============================================================================

# icons
%{__mkdir_p} %{buildroot}{%{_liconsdir},%{_iconsdir},%{_miconsdir}}
%if %{official_branding}
%{__mkdir_p} %{buildroot}%{_datadir}/icons/hicolor/{16x16,22x22,24x24,32x32,48x48,256x256}/apps
%{__install} -m 644 %{buildroot}/%{tbdir}/chrome/icons/default/default48.png %{buildroot}%{_liconsdir}/%{name}.png
%{__install} -m 644 %{buildroot}/%{tbdir}/chrome/icons/default/default32.png %{buildroot}%{_iconsdir}/%{name}.png
%{__install} -m 644 %{buildroot}/%{tbdir}/chrome/icons/default/default16.png %{buildroot}%{_miconsdir}/%{name}.png
%{__install} -m 644 %{buildroot}/%{tbdir}/chrome/icons/default/default16.png %{buildroot}%{_datadir}/icons/hicolor/16x16/apps/%{name}.png
%{__install} -m 644 %{buildroot}/%{tbdir}/chrome/icons/default/default22.png %{buildroot}%{_datadir}/icons/hicolor/22x22/apps/%{name}.png
%{__install} -m 644 %{buildroot}/%{tbdir}/chrome/icons/default/default24.png %{buildroot}%{_datadir}/icons/hicolor/24x24/apps/%{name}.png
%{__install} -m 644 %{buildroot}/%{tbdir}/chrome/icons/default/default32.png %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/%{name}.png
%{__install} -m 644 %{buildroot}/%{tbdir}/chrome/icons/default/default48.png %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/%{name}.png
%{__install} -m 644 %{buildroot}/%{tbdir}/chrome/icons/default/default256.png %{buildroot}%{_datadir}/icons/hicolor/256x256/apps/%{name}.png
%else
#%{__mkdir_p} %{buildroot}%{_datadir}/icons/hicolor/{64x64,128x128}/apps
%{__mkdir_p} %{buildroot}%{_datadir}/icons/hicolor/{16x16,22x22,24x24,32x32,48x48,256x256}/apps
%{__install} -m 644 %{name}-48.png %{buildroot}%{_liconsdir}/%{name}.png
%{__install} -m 644 %{name}-32.png %{buildroot}%{_iconsdir}/%{name}.png
%{__install} -m 644 %{name}-16.png %{buildroot}%{_miconsdir}/%{name}.png
# Converting up, but not a big issue now that we have official branding
%{__install} -m 644 %{name}-16.png %{buildroot}%{_datadir}/icons/hicolor/16x16/apps/%{name}.png
%{__install} -m 644 %{name}-22.png %{buildroot}%{_datadir}/icons/hicolor/22x22/apps/%{name}.png
%{__install} -m 644 %{name}-24.png %{buildroot}%{_datadir}/icons/hicolor/24x24/apps/%{name}.png
%{__install} -m 644 %{name}-32.png %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/%{name}.png
%{__install} -m 644 %{name}-48.png %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/%{name}.png
%{__install} -m 644 %{name}-256.png %{buildroot}%{_datadir}/icons/hicolor/256x256/apps/%{name}.png
%endif

#===============================================================================

%{__mkdir_p} %{buildroot}%{tbextdir}/%{enigmail_id}
%if !%{xpi}
%{_bindir}/unzip -q mozilla/dist/bin/enigmail-%{enigmail_short_version}*.xpi -d %{buildroot}%{tbextdir}/%{enigmail_id}
%{__chmod} 644 %{buildroot}%{tbextdir}/%{enigmail_id}/chrome.manifest
# as we rename libipc.so & libenigmime.so and don't install them into %%{tbdir}
# we need to remove them from %%{tbdir}/components/binary.manifest
# otherwise thunderbird will try to load them, which will fail
sed -i 's,binary-component libipc.so,,' %{buildroot}%{tbdir}/components/binary.manifest
sed -i 's,binary-component libenigmime.so,,' %{buildroot}%{tbdir}/components/binary.manifest
%else
%{__cp} -aL mozilla/dist/bin/enigmail-%{enigmail_short_version}*.xpi %{buildroot}%{tbextdir}/%{enigmail_id}/%{enigmail_id}.xpi
%endif

#==============================================================================
#enigmail lang package
# Convert rpm macros to bash variables
%{expand:%(for lang in %langlist; do echo "language_$lang=%%{language_$lang}"; done)}
%{expand:%(for lang in %langlist; do echo "with_$lang=%%{with $lang}"; done)}
%{expand:%(for lang in %l10n_langlist; do echo "l10n_$lang=%%{l10n_$lang}"; done)}
pushd mozilla/extensions/enigmail/lang
 for lang in %langlist; do
    %{__mkdir_p} %{buildroot}%{_datadir}/mozilla/extensions/%{tb_appid}/enigmail-$lang@enigmail.mozdev.org
    language="language_$lang"
    language=${!language}
    %{_bindir}/unzip -q enigmail-${language}-%{enigmail_short_version}.xpi -d %{buildroot}%{_datadir}/mozilla/extensions/%{tb_appid}/enigmail-$lang@enigmail.mozdev.org/
 done
popd

#===============================================================================

%{__cp} -aL mozilla/dist/bin/nsinstall %{buildroot}%{_bindir}

#===============================================================================
#exclude devel files
%{__rm} -rf %{buildroot}%{_datadir}/idl/%{oname}-%{version}
%{__rm} -rf %{buildroot}%{_includedir}/%{oname}-%{version}
%{__rm} -rf %{buildroot}%{_libdir}/%{oname}-devel-%{version}

%clean
%{__rm} -rf %{buildroot}

#===============================================================================

%pre
if [ $1 == 2 ]; then
  if [ -d %{tbdir}/dictionaries ]; then
    # Otherelse rpm can't switch this into a symlink :(
    rm -rf %{tbdir}/dictionaries
  fi
fi

%post

mktemp="/bin/mktemp -d -q -p /tmp -t %{name}.XXXXXXXXXX"

TMPDIR= TB_TMPDIR=`$mktemp` && {
    HOME="$TB_TMPDIR" LD_LIBRARY_PATH="%{tbdir}" %{tbdir}/thunderbird-bin -nox -register
    test -d "$TB_TMPDIR" && %{__rm} -rf -- "$TB_TMPDIR"
}


#===============================================================================

%post enigmail
if [ -f %{tbdir}/components/compreg.dat ]; then
    %{__rm} -f %{tbdir}/components/compreg.dat
fi

if [ -f %{tbdir}/components/xpti.dat ]; then
    %{__rm} -f %{tbdir}/components/xpti.dat
fi

mktemp="/bin/mktemp -d -q -p /tmp -t %{name}.XXXXXXXXXX"

TMPDIR= TB_TMPDIR=`$mktemp` && {
%if %{xpi}
    HOME="$TB_TMPDIR" LD_LIBRARY_PATH="%{tbdir}" %{tbdir}/thunderbird-bin -nox -install-global-extension %{tbextdir}/enigmail-%{enigmail_version}-linux-*.xpi
%endif
    HOME="$TB_TMPDIR" LD_LIBRARY_PATH="%{tbdir}" %{tbdir}/thunderbird-bin -nox -register
    test -d "$TB_TMPDIR" && %{__rm} -rf -- "$TB_TMPDIR"
}

%preun enigmail
if [ -f %{tbdir}/components/compreg.dat ]; then
    %{__rm} -f %{tbdir}/components/compreg.dat
fi

if [ -f %{tbdir}/components/xpti.dat ]; then
    %{__rm} -f %{tbdir}/components/xpti.dat
fi

if [ -x %{tbdir}/thunderbird-bin ]; then 
mktemp="/bin/mktemp -d -q -p /tmp -t %{name}.XXXXXXXXXX"

  TMPDIR= TB_TMPDIR=`$mktemp` && {
  %if %{xpi}
      HOME="$TB_TMPDIR" LD_LIBRARY_PATH="%{tbdir}" %{tbdir}/thunderbird-bin -nox -install-global-extension %{tbextdir}/enigmail-%{enigmail_version}-linux-*.xpi
  %endif
      HOME="$TB_TMPDIR" LD_LIBRARY_PATH="%{tbdir}" %{tbdir}/thunderbird-bin -nox -register
      test -d "$TB_TMPDIR" && %{__rm} -rf -- "$TB_TMPDIR"
  }
fi

#===============================================================================

%files
%defattr(-,root,root,-)
%doc mozilla/LEGAL
%attr(755,root,root) %{_bindir}/mozilla-thunderbird
%attr(755,root,root) %{_bindir}/thunderbird
%attr(644,root,root) %{_datadir}/applications/*.desktop
%attr(644,root,root) %{_datadir}/pixmaps/%{name}.png
%{tbdir}
%if %{xpi}
%dir %{tbextdir}
%endif
# Mandriva menu
%{_miconsdir}/%{name}.png
%{_iconsdir}/%{name}.png
%{_liconsdir}/%{name}.png
# other icons
%if %{official_branding}
%{_datadir}/icons/hicolor/16x16/apps/%{name}.png
%{_datadir}/icons/hicolor/22x22/apps/%{name}.png
%{_datadir}/icons/hicolor/24x24/apps/%{name}.png
%{_datadir}/icons/hicolor/32x32/apps/%{name}.png
%{_datadir}/icons/hicolor/48x48/apps/%{name}.png
%{_datadir}/icons/hicolor/256x256/apps/%{name}.png
%else
%{_datadir}/icons/hicolor/16x16/apps/%{name}.png
%{_datadir}/icons/hicolor/22x22/apps/%{name}.png
%{_datadir}/icons/hicolor/24x24/apps/%{name}.png
%{_datadir}/icons/hicolor/32x32/apps/%{name}.png
%{_datadir}/icons/hicolor/48x48/apps/%{name}.png
%{_datadir}/icons/hicolor/256x256/apps/%{name}.png
%endif
%exclude %{tbextdir}/%{enigmail_id}

%files enigmail
%defattr(-,root,root)
%{tbextdir}/%{enigmail_id}

%files -n nsinstall
%defattr(-,root,root)
%{_bindir}/nsinstall


%changelog

* Tue Oct 09 2012 fwang <fwang> 0:10.0.8-1.mga1
+ Revision: 303679
- new version 10.0.8esr
- new version 10.0.6
- new version 10.0.5esr
- new version 10.0.3 ESR (Extended Support Release)
  o fixes http://www.mozilla.org/security/announce/2012/mfsa2012-13.html
    (XSS with Drag and Drop and Javascript: URL [CVE-2012-0455])
  o fixes http://www.mozilla.org/security/announce/2012/mfsa2012-14.html
    (SVG issues found with Address Sanitizer [CVE-2012-0456, CVE-2012-0457])
  o fixes http://www.mozilla.org/security/announce/2012/mfsa2012-15.html
    (XSS with multiple Content Security Policy headers [CVE-2012-0451])
  o fixes http://www.mozilla.org/security/announce/2012/mfsa2012-16.html
    (Escalation of privilege with Javascript: URL as home page [CVE-2012-0458])
  o fixes http://www.mozilla.org/security/announce/2012/mfsa2012-17.html
    (Crash when accessing keyframe cssText after dynamic modification
    [CVE-2012-0459])
  o fixes http://www.mozilla.org/security/announce/2012/mfsa2012-18.html
    (window.fullScreen writeable by untrusted content [CVE-2012-0460])
  o fixes http://www.mozilla.org/security/announce/2012/mfsa2012-19.html
    (Miscellaneous memory safety hazards (rv:11.0/ rv:10.0.3 / rv:1.9.2.28)
    [CVE-2012-0461, CVE-2012-0462, CVE-2012-0464, CVE-2012-0463 ])
- new version 3.1.12

  + doktor5000 <doktor5000>
    - new version 10.0.7
    - new version 10.0.4 ESR (Extended Support Release)
      o fixes http://www.mozilla.org/security/announce/2012/mfsa2012-20.html
        (Miscellaneous memory safety hazards [CVE-2012-0468, CVE-2012-0467])
      o fixes http://www.mozilla.org/security/announce/2012/mfsa2012-22.html
        (use-after-free in IDBKeyRange[CVE-2012-0469])
      o fixes http://www.mozilla.org/security/announce/2012/mfsa2012-23.html
        (Invalid frees causes heap corruption in gfxImageSurface [CVE-2012-0470])
      o fixes http://www.mozilla.org/security/announce/2012/mfsa2012-24.html
        (Potential XSS via multibyte content processing errors [CVE-2012-0471])
      o fixes http://www.mozilla.org/security/announce/2012/mfsa2012-25.html
        (Potential memory corruption during font rendering using cairo-dwrite
         [CVE-2012-0472])
      o fixes http://www.mozilla.org/security/announce/2012/mfsa2012-26.html
        (WebGL.drawElements may read illegal video memory due to
         FindMaxUshortElement error [CVE-2012-0473])
      o fixes http://www.mozilla.org/security/announce/2012/mfsa2012-27.html
        (Page load short-circuit can lead to XSS [CVE-2012-0474])
      o fixes http://www.mozilla.org/security/announce/2012/mfsa2012-28.html
        (Ambiguous IPv6 in Origin headers may bypass webserver access restrictions
         [CVE-2012-0475])
      o fixes http://www.mozilla.org/security/announce/2012/mfsa2012-29.html
        (Potential XSS through ISO-2022-KR/ISO-2022-CN decoding issues
         [CVE-2012-0477])
      o fixes http://www.mozilla.org/security/announce/2012/mfsa2012-30.html
        (Crash with WebGL content using textImage2D [CVE-2012-0478])
      o fixes http://www.mozilla.org/security/announce/2012/mfsa2012-31.html
        (Off-by-one error in OpenType Sanitizer [CVE-2011-3062])
      o fixes http://www.mozilla.org/security/announce/2012/mfsa2012-33.html
        (Potential site identity spoofing when loading RSS and Atom feeds
         [CVE-2012-0479])
    - switch to Enigmail 1.4, officially supported version for ESR releases
      o fixes a problem with inline PGP decrpytion
    - use system nss shlibsign instead of missing bundled one
    - remove unused Sources
    - change Requires on libcanberra to Suggests
    - new version 10.0.2 ESR (Extended Support Release)
      o fixes http://www.mozilla.org/security/announce/2012/mfsa2012-11.html
        (libpng integer overflow [CVE-2011-3026])
    - drop all unused patches
    - remove useless commented-out stuff
    - new version 10.0.1, switch to ESR (Extended Support Release)
      o fixes http://www.mozilla.org/security/announce/2012/mfsa2012-01.html
        (miscellaneous memory safety hazards [CVE-2012-0442] [CVE-2012-0443]
         fixed in 10.0 )
      o fixes http://www.mozilla.org/security/announce/2012/mfsa2012-03.html
        (<iframe> element exposed across domains via name attribute [CVE-2012-0445]
         fixed in 10.0)
      o fixes http://www.mozilla.org/security/announce/2012/mfsa2012-04.html
        (child nodes from nsDOMAttribute still accessible after removal of nodes
         [CVE-2011-3659] fixed in 10.0)
      o fixes http://www.mozilla.org/security/announce/2012/mfsa2012-05.html
        (frame scripts calling into untrusted objects bypass security checks
         [CVE-2012-0446] fixed in 10.0)
      o fixes http://www.mozilla.org/security/announce/2012/mfsa2012-06.html
        (uninitialized memory appended when encoding icon images may cause
         information disclosure [CVE-2012-0447] fixed in 10.0
      o fixes http://www.mozilla.org/security/announce/2012/mfsa2012-07.html
        (potential Memory Corruption When Decoding Ogg Vorbis files
         [CVE-2012-0444] fixed in 10.0)
      o fixes http://www.mozilla.org/security/announce/2012/mfsa2012-08.html
        (crash with malformed embedded XSLT stylesheets [CVE-2012-0449]
      o fixes http://www.mozilla.org/security/announce/2012/mfsa2012-10.html
        (use after free in nsXBLDocumentInfo::ReadPrototypeBindings [CVE-2012-0452])
    - update enigmail to 1.3.5, needed for thunderbird 10.0
    - updated mageia-default-prefs.js, reenabled locale matching to system locale
    - change new default preference (extensions.autoDisableScopes) to not
      automatically disable systemwide installed addons, like language packs
    - added BuildRequires on yasm, mesagl-devel, startup-notification-devel, dbus,
      libevent-devel and libvpx-devel
    - added Requires on libcanberra for playing sounds
    - add Patch100 to use libcanberra for playing sounds (rediffed from upstream,
      mozilla-thunderbird-mga-use-libcanberra.patch)
    - rediffed Patch201, disabling default application dialog on Thunderbird start
    - use bundled libpng, system one is too old and updating it is a no-go for mga1
    - do not build against system libxul, add requires_exception for libxul
    - disable updater and bundled lightning, disable compilation of lightning
    - enable gio, vpx and libevent and optimization
    - use org.mageia as distribution id
    - removed thunderbird.cfg
    - add -fPIC to CFLAGS
    - new version 3.1.18
      o fixes http://www.mozilla.org/security/announce/2011/mfsa2011-59.html
        (.jar files not being treated as executables on MacOS [CVE-2011-3666]
         fixed in 3.1.17)
      o fixes http://www.mozilla.org/security/announce/2012/mfsa2012-01.html
        (Miscellaneous memory safety hazards [(rv:10.0/ 1.9.2.26) [CVE-2012-0443,
          CVE-2012-0442])
      o fixes http://www.mozilla.org/security/announce/2012/mfsa2012-02.html
        (Overly permissive IPv6 literal syntax [CVE-2011-3670])
      o fixes http://www.mozilla.org/security/announce/2012/mfsa2012-04.html
        (Child nodes from nsDOMAttribute still accessible after removal of nodes,
         [CVE-2011-3659])
      o fixes http://www.mozilla.org/security/announce/2012/mfsa2012-07.html
        (Potential Memory Corruption When Decoding Ogg Vorbis files [CVE-2012-0444])
      o fixes http://www.mozilla.org/security/announce/2012/mfsa2012-08.html
        (Crash with malformed embedded XSLT stylesheets [CVE-2012-0449])
    - new version 3.1.16
      o fixes http://www.mozilla.org/security/announce/2011/mfsa2011-46.html
        (loadSubScript unwraps XPCNativeWrapper scope parameter, a malicious page
         could potentially exploit a Thunderbird user who had installed an add-on
         that used loadSubscript in vulnerable ways)
      o fixes http://www.mozilla.org/security/announce/2011/mfsa2011-47.html
        (Potential cross-site-scripting against sites using Shift-JIS encoding,
         CVE-2011-3648)
      o fixes http://www.mozilla.org/security/announce/2011/mfsa2011-49.html
        (memory corruption while profiling using Firebug, CVE-2011-3650)
    - fixed CVE-2011-3640, untrusted search path vulnerability which might allow
      local users to gain privileges via a Trojan horse pkcs11.txt file in a
      top-level directory (fix-CVE-2011-3640.patch, from upstream)
    - new version 3.1.15
      o fixes http://www.mozilla.org/security/announce/2011/mfsa2011-34.html
        (Protection against fraudulent DigiNotar certificates,
         fixed in thunderbird 3.1.13)
      o fixes http://www.mozilla.org/security/announce/2011/mfsa2011-35.html
        (Additional protection against fraudulent DigiNotar certificates,
        fixed in thunderbird 3.1.14)

* Fri Apr 29 2011 ahmad <ahmad> 0:3.1.10-1.mga1
+ Revision: 93463
- Update to 3.1.10
- Rediff run-mozilla patch
- Drop an old patch from SOURCES dir

* Fri Mar 25 2011 ahmad <ahmad> 0:3.1.9-11.mga1
+ Revision: 77483
- revert previous commit, gio support doesn't work as it should resulting in http/
  https links handler having to be configured manually for all new and old tb profiles.
  gnomevfs support at least reads the value from gconf settings (which uses www-
  browser by default)

* Mon Mar 21 2011 ahmad <ahmad> 0:3.1.9-10.mga1
+ Revision: 75310
- disable gnomvfs support
- enable gio support
- disable updater as we don't support updating the application this way

* Wed Mar 16 2011 ahmad <ahmad> 0:3.1.9-8.mga1
+ Revision: 72283
- conflict with mozilla-thunderbird-lightning <= 1.3.9

* Fri Mar 11 2011 ahmad <ahmad> 0:3.1.9-7.mga1
+ Revision: 68321
- drop old/uneeded scriptlets that update the destkop-database and hicolor
  icon-cache; they were replaced by rpm filetriggers ages ago

* Fri Mar 11 2011 ahmad <ahmad> 0:3.1.9-6.mga1
+ Revision: 68246
- don't obsolete -lightning here and in the mozilla-thunderbird-lightning src.rpm
  urpmi can't smoothly handle a package obsoleted by two packages

* Fri Mar 11 2011 ahmad <ahmad> 0:3.1.9-5.mga1
+ Revision: 68165
- obsolete the -lightning sub-package that was built from thunderbird src.rpm

* Fri Mar 11 2011 ahmad <ahmad> 0:3.1.9-4.mga1
+ Revision: 68147
- define build_bundled_lightning, and disable it:
 o the thunderbird tarball doesn't have the langpacks for lightning
 o lightning has a separate release schedule (Fedora)

* Wed Mar 09 2011 colin <colin> 0:3.1.9-2.mga1
+ Revision: 66827
- Extract the correct plugin id from lightning extension

* Sat Mar 05 2011 ahmad <ahmad> 0:3.1.9-1.mga1
+ Revision: 64596
- update to 3.1.9

  + dmorgan <dmorgan>
    - obsoletes old package

* Tue Mar 01 2011 ahmad <ahmad> 0:3.1.8-1.mga1
+ Revision: 62332
- update to 3.1.8

* Mon Feb 28 2011 dmorgan <dmorgan> 0:3.1.7-3.mga1
+ Revision: 61407
- Remove remaining mdv macro
- Remove remaining mdv macro
- Fix %%els
- Fix %%else
- Adapt for mageia
- Remove mdv macros
  Adapt for mageia

  + ennael <ennael>
    - imported package mozilla-thunderbird