From: Elan Ruusamäe Date: Thu, 23 Sep 2010 10:30:11 +0000 (+0000) Subject: - create compreg.dat, xpti.dat on install X-Git-Tag: auto/th/icedove-3_1_3-2~1 X-Git-Url: http://git.pld-linux.org/?p=packages%2Ficedove.git;a=commitdiff_plain;h=e8f4ba81aeb455ed50d56ba490335d2682fa5d95 - create compreg.dat, xpti.dat on install - remove similar files from profile on upgrades (needed especially major upgrade 3.0 -> 3.1) to fix "silent" start failure - rel 2 Changed files: icedove.sh -> 1.9 icedove.spec -> 1.103 --- diff --git a/icedove.sh b/icedove.sh index 2c02dec..f7f4ef6 100644 --- a/icedove.sh +++ b/icedove.sh @@ -11,11 +11,12 @@ if [ ! -d $HOME/.icedove ] && [ -d $HOME/.thunderbird ]; then fi # compreg.dat and/or chrome.rdf will screw things up if it's from an -# older version. http://bugs.gentoo.org/show_bug.cgi?id=63999 +# older version. http://bugs.gentoo.org/show_bug.cgi?id=63999 for f in ~/.icedove/*/{compreg.dat,chrome.rdf,XUL.mfasl}; do - if [[ -f ${f} && ${f} -ot "$0" ]]; then - echo "Removing ${f} leftover from older Icedove" - rm -f "${f}" + [ -f "$f" ] || continue + if [ "$f" -ot "$0" ] || [ "$f" -ot "$LIBDIR/components/compreg.dat" ]; then + echo "Removing $f leftover from older Icedove" + rm -f "$f" fi done diff --git a/icedove.spec b/icedove.spec index caea23b..876711d 100644 --- a/icedove.spec +++ b/icedove.spec @@ -33,7 +33,7 @@ Summary: Icedove - email client Summary(pl.UTF-8): Icedove - klient poczty Name: icedove Version: 3.1.3 -Release: 1 +Release: 2 License: MPL 1.1 or GPL v2+ or LGPL v2.1+ Group: X11/Applications/Networking Source0: http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/%{version}/source/thunderbird-%{version}.source.tar.bz2 @@ -377,9 +377,21 @@ ln -s %{name} $RPM_BUILD_ROOT%{_bindir}/mozilla-thunderbird cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop cp -a %{topdir}/mozilla/icedove/branding/content/icon64.png $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png -# files created by regxpcom -register +# files created by regxpcom -register in post touch $RPM_BUILD_ROOT%{_libdir}/%{name}/components/compreg.dat touch $RPM_BUILD_ROOT%{_libdir}/%{name}/components/xpti.dat +cat << 'EOF' > $RPM_BUILD_ROOT%{_libdir}/%{name}/register +#!/bin/sh +umask 022 +# 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. +t=$(mktemp -d) +rm -f %{_libdir}/%{name}/components/{compreg,xpti}.dat +TMPDIR= TMP= HOME=$t %{_libdir}/%{name}/icedove -register +rm -rf $t +EOF +chmod a+rx $RPM_BUILD_ROOT%{_libdir}/%{name}/register %if %{with enigmail} ext_dir=$RPM_BUILD_ROOT%{_libdir}/%{name}/extensions/\{847b3a00-7ab1-11d4-8f02-006008948af5\} @@ -425,6 +437,9 @@ for d in chrome defaults greprefs icons isp modules res; do done exit 0 +%post +%{_libdir}/%{name}/register || : + %files %defattr(644,root,root,755) %attr(755,root,root) %{_bindir}/icedove @@ -444,6 +459,7 @@ exit 0 %attr(755,root,root) %{_libdir}/%{name}/*-bin %attr(755,root,root) %{_libdir}/%{name}/mozilla-xremote-client %attr(755,root,root) %{_libdir}/%{name}/icedove +%attr(755,root,root) %{_libdir}/%{name}/register # symlinks %{_libdir}/%{name}/chrome