From josemi@freebsd.jazztel.es  Wed Jan  5 02:30:46 2005
Return-Path: <josemi@freebsd.jazztel.es>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP
	id C070816A4CE; Wed,  5 Jan 2005 02:30:46 +0000 (GMT)
Received: from 212.106.254.141.adsl.jazztel.es (212.106.254.141.adsl.jazztel.es [212.106.254.141])
	by mx1.FreeBSD.org (Postfix) with ESMTP
	id 3B93043D5E; Wed,  5 Jan 2005 02:30:44 +0000 (GMT)
	(envelope-from josemi@freebsd.jazztel.es)
Received: from redesjm.local (orion.redesjm.local [192.168.254.16])
	by 212.106.254.141.adsl.jazztel.es (8.13.1/8.13.1) with ESMTP id j052UhVC005330;
	Wed, 5 Jan 2005 03:30:43 +0100 (CET)
	(envelope-from freebsd@redesjm.local)
Received: (from freebsd@localhost)
	by redesjm.local (8.13.1/8.13.1/Submit) id j052Uikr076730;
	Wed, 5 Jan 2005 03:30:44 +0100 (CET)
	(envelope-from freebsd)
Message-Id: <200501050230.j052Uikr076730@redesjm.local>
Date: Wed, 5 Jan 2005 03:30:44 +0100 (CET)
From: Jose M Rodriguez (freebsd) <josemi@freebsd.jazztel.es>
To: FreeBSD-gnats-submit@freebsd.org
Cc: gnome@freebsd.org
Subject: [PATCH] mail/thunderbird: latest changes against thunderbird
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         75837
>Category:       ports
>Synopsis:       [PATCH] mail/thunderbird: latest changes against thunderbird
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gnome
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jan 05 02:40:21 GMT 2005
>Closed-Date:    Fri Mar 25 06:09:40 GMT 2005
>Last-Modified:  Fri Mar 25 06:09:40 GMT 2005
>Originator:     Jose M Rodriguez (freebsd)
>Release:        FreeBSD 5.3-STABLE i386
>Organization:
Redes JM
>Environment:
System: FreeBSD orion.redesjm.local 5.3-STABLE FreeBSD 5.3-STABLE #0: Tue Jan  4 07:32:56 CET
>Description:
	- new mozilla.sh
	- new pkg scripts
	- move thunderbird[-config] from bin to $MOZDIR
	- i18n desktop entry without StartupNotification
	- gconf enabled external protocol handler
	- MOZ_PIS scripts
		S50cleanhome
		S90dsp
	...

Added file(s):
- files/moz_pis_S50cleanhome
- files/moz_pis_S90dsp.sh
- files/patch-uriloader_exthandler_unix_nsGNOMERegistry.cpp

Port maintainer (gnome@FreeBSD.org) is cc'd.

Generated with FreeBSD Port Tools 0.63
>How-To-Repeat:
>Fix:

--- thunderbird-1.0_2.patch begins here ---
diff -ruN --exclude=CVS /usr/HEAD/ports/mail/thunderbird/Makefile /junk/wk/mail/thunderbird/Makefile
--- /usr/HEAD/ports/mail/thunderbird/Makefile	Tue Dec 28 01:51:57 2004
+++ /junk/wk/mail/thunderbird/Makefile	Wed Jan  5 02:00:24 2005
@@ -7,7 +7,7 @@
 
 PORTNAME=	thunderbird
 PORTVERSION=	1.0
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	mail
 MASTER_SITES=	${MASTER_SITE_MOZILLA}
 MASTER_SITE_SUBDIR=	thunderbird/releases/${PORTVERSION}/source
@@ -18,8 +18,7 @@
 
 LIB_DEPENDS=	jpeg.9:${PORTSDIR}/graphics/jpeg \
 		png.5:${PORTSDIR}/graphics/png \
-		mng.1:${PORTSDIR}/graphics/libmng \
-		nspr4.1:${PORTSDIR}/devel/nspr
+		mng.1:${PORTSDIR}/graphics/libmng
 BUILD_DEPENDS=	zip:${PORTSDIR}/archivers/zip
 
 USE_X_PREFIX=	yes
@@ -47,11 +46,15 @@
 
 THUNDERBIRD_ICON=	thunderbird.xpm
 THUNDERBIRD_ICON_SRC=	${WRKSRC}/other-licenses/branding/thunderbird/default.xpm
+MOZ_PIS_SCRIPTS=	S50cleanhome
+SCRIPTS_DIR=	${FAKEDIR}/${LOCAL_SUBDIR}/lib/${PORTNAME}-${PORTVERSION}
+MOZ_PIS_DIR=	${SCRIPTS_DIR}/init.d
 
 OPTIONS=	DEBUG "Build a debugging image" off \
 		LOGGING "Enable additional log messages" off \
 		OPTIMIZED_CFLAGS "Enable some additional optimizations" off \
-		XFT "Enable support for anti-aliased fonts" on
+		XFT "Enable support for anti-aliased fonts" on \
+		ARTSDSP "Add support for KDE arts (artsdsp)" on
 
 .include <bsd.port.pre.mk>
 
@@ -85,6 +88,10 @@
 LIB_DEPENDS+=	Xft.2:${PORTSDIR}/x11-fonts/libXft
 .endif # !defined(WITHOUT_XFT)
 
+.if !defined(WITHOUT_ARTSDSP)
+MOZ_PIS_SCRIPTS+=	S90dsp.sh
+.endif
+
 CPPFLAGS+=		-I${X11BASE}/include
 CFLAGS+=		${PTHREAD_CFLAGS}
 LDFLAGS+=		-L${X11BASE}/lib
@@ -133,10 +140,13 @@
 		${WRKSRC}/configure \
 		${WRKSRC}/intl/uconv/native/nsNativeUConvService.cpp \
 		${WRKSRC}/xpcom/io/nsNativeCharsetUtils.cpp
-	@${SED} -e 's|%%MOZDIR%%|${LOCAL_PREFIX}/lib/${PORTNAME}-${PORTVERSION}|g ; \
+	@${SED} -e 's|%%MOZDIR%%|${LOCAL_SUBDIR}/lib/${PORTNAME}-${PORTVERSION}|g ; \
+		s|%%PREFIX%%|${PREFIX}|g ; \
 		s|%%X11BASE%%|${X11BASE}|g' \
 		< ${MASTERDIR}/pkg-install.in > ${PKGINSTALL}
-	@${SED} -e 's|%%MOZDIR%%|${LOCAL_PREFIX}/lib/${PORTNAME}-${PORTVERSION}|g' \
+	@${SED} -e 's|%%MOZDIR%%|${LOCAL_SUBDIR}/lib/${PORTNAME}-${PORTVERSION}|g ; \
+		s|%%PREFIX%%|${PREFIX}|g ; \
+		s|%%X11BASE%%|${X11BASE}|g' \
 		< ${MASTERDIR}/pkg-deinstall.in > ${PKGDEINSTALL}
 	@${SED} -e 's|@THUNDERBIRD_ICON@|${THUNDERBIRD_ICON}|' \
 		< ${FILESDIR}/thunderbird.desktop.in > ${WRKDIR}/thunderbird.desktop
@@ -165,12 +175,19 @@
 .endfor
 .endfor
 	@${RM} -fr ${FAKEDIR}/share/idl ${FAKEDIR}/include
+	@${MKDIR} ${SCRIPTS_DIR}
+	@${MKDIR} ${MOZ_PIS_DIR}
 .for ii in thunderbird thunderbird-config
-	@${ECHO_CMD} bin/${ii} >> ${PLIST}
+	@${INSTALL_SCRIPT} ${FAKEDIR}/${LOCAL_SUBDIR}/bin/${ii} ${SCRIPTS_DIR}
 .endfor
+.for ii in ${MOZ_PIS_SCRIPTS}
+	@${INSTALL_SCRIPT} ${FILESDIR}/moz_pis_${ii} ${MOZ_PIS_DIR}/${ii}
+.endfor
+	@${RM} -fr ${FAKEDIR}/${LOCAL_SUBDIR}/bin
 	@${MKDIR} ${FAKEDIR}/${LOCAL_SUBDIR}/lib/${PORTNAME}-${PORTVERSION}/defaults
 	@${CP} -RL ${WRKSRC}/dist/bin/defaults/isp \
 		${FAKEDIR}/${LOCAL_SUBDIR}/lib/${PORTNAME}-${PORTVERSION}/defaults
+
 	@cd ${FAKEDIR} && ${FIND} * ! -type d | ${SORT} >> ${PLIST}; \
 	${FIND} * -type d -empty | ${SORT} | ${SED} -e \
 		"s:^:@exec ${MKDIR} %D/:" -e "s:$$: || true:" >> ${PLIST}; \
@@ -189,16 +206,9 @@
 
 post-install:
 	@${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
-	${MKDIR} ${PREFIX}/bin
-	${RM} -f ${PREFIX}/bin/thunderbird
-	${LN} -s ${LOCAL_PREFIX}/bin/thunderbird \
-		${PREFIX}/bin/thunderbird
-	${RM} -f ${PREFIX}/bin/thunderbird-config
-	${LN} -s ${LOCAL_PREFIX}/bin/thunderbird-config \
-		${PREFIX}/bin/thunderbird-config
 	${PERL} -pi -e 's|${FAKEDIR}|${PREFIX}|g' \
-		${LOCAL_PREFIX}/bin/thunderbird \
-		${LOCAL_PREFIX}/bin/thunderbird-config
+		${LOCAL_PREFIX}/lib/${PORTNAME}-${PORTVERSION}/thunderbird \
+		${LOCAL_PREFIX}/lib/${PORTNAME}-${PORTVERSION}/thunderbird-config
 	${FIND} ${LOCAL_PREFIX}/lib/pkgconfig -type f | ${XARGS} \
 		${PERL} -pi -e 's|${FAKEDIR}|${PREFIX}|g'
 	${INSTALL_DATA} ${THUNDERBIRD_ICON_SRC} ${PREFIX}/share/gnome/pixmaps/${THUNDERBIRD_ICON}
diff -ruN --exclude=CVS /usr/HEAD/ports/mail/thunderbird/files/moz_pis_S50cleanhome /junk/wk/mail/thunderbird/files/moz_pis_S50cleanhome
--- /usr/HEAD/ports/mail/thunderbird/files/moz_pis_S50cleanhome	Thu Jan  1 01:00:00 1970
+++ /junk/wk/mail/thunderbird/files/moz_pis_S50cleanhome	Wed Jan  5 01:15:20 2005
@@ -0,0 +1,34 @@
+#!/bin/sh
+#
+
+# S50cleanhome
+# a script to polite ${HOME}/${MOZ_PIS_USER_DIR}
+
+# We run in our own subshell
+
+# First, verify protocol
+[ "$1" != "start" ] && exit 1
+[ -z "${MOZ_PIS_API}" -o ${MOZ_PIS_API} -ne 2 ] && exit 1
+[ -z "${MOZ_PIS_MOZBINDIR}" -o ! -d "${MOZ_PIS_MOZBINDIR}" ] && exit 1
+[ -z "${HOME}" -o ! -d "${HOME}" ] && exit 1
+[ -z "${MOZ_PIS_USER_DIR}" -o ! -d "${HOME}/${MOZ_PIS_USER_DIR}" ] && exit 1
+
+# Try to polite ${HOME}/${MOZ_PIS_USER_DIR}
+
+# This must be really needed?
+# rm -f "${$HOME}/${MOZ_PIS_USER_DIR}/pluginreg.dat"
+
+# Try to polite profile dirs
+if [ -f "${HOME}/${MOZ_PIS_USER_DIR}/profiles.ini" ]; then
+    sed -e '/Path=/! d' -e "s,Path=,${HOME}/${MOZ_PIS_USER_DIR}/," \
+	"${HOME}/${MOZ_PIS_USER_DIR}/profiles.ini" \
+	| while read dir
+    do
+	[ ! -d "${dir}" ] && continue
+	# at last, debian do this, we do for new builds
+	# rm -f "${dir}/XUL.mfast"
+	# make reclaculate compreg.dat, xpti.dat for new builds
+	[ "${dir}/compreg.dat" -ot "${MOZ_PIS_MOZBINDIR}/components.ini" ] &&
+	    rm -f "${dir}/compatibility.ini" "${dir}/XUL.mfast"
+    done
+fi
diff -ruN --exclude=CVS /usr/HEAD/ports/mail/thunderbird/files/moz_pis_S90dsp.sh /junk/wk/mail/thunderbird/files/moz_pis_S90dsp.sh
--- /usr/HEAD/ports/mail/thunderbird/files/moz_pis_S90dsp.sh	Thu Jan  1 01:00:00 1970
+++ /junk/wk/mail/thunderbird/files/moz_pis_S90dsp.sh	Wed Jan  5 01:14:40 2005
@@ -0,0 +1,33 @@
+#!/bin/sh
+#
+
+# S90dsp.sh
+# dsp aids for mozilla
+# WARN, this is sourced in the main mozilla.sh script.  Be carefull
+
+# esd support seems to be built-in in mozilla now
+# support only arts
+
+if [ -x "${run_moz}" ]; then
+    case "${MOZILLA_DSP}" in
+	[Aa][Rr][Tt][Ss] | artsdsp)
+	    MOZILLA_DSP="artsdsp"
+	    ;;
+	[Nn][Oo][Nn][Ee])
+	    MOZILLA_DSP=""
+	    ;;
+	*) # auto
+	    if [ -n "${KDE_FULL_SESSION}" ]; then
+		MOZILLA_DSP="artsdsp"
+	    else
+		MOZILLA_DSP=""
+	    fi
+	    ;;
+    esac
+    [ -n "${MOZILLA_DSP}" ] && MOZILLA_DSP=`which "${MOZILLA_DSP}"` &&
+    run_moz="${MOZILLA_DSP} ${run_moz}"
+fi
+
+if [ -n "${debuggin}" ]; then
+    echo "dsp: ${run_moz}"
+fi
diff -ruN --exclude=CVS /usr/HEAD/ports/mail/thunderbird/files/patch-mail_app_mozilla.in /junk/wk/mail/thunderbird/files/patch-mail_app_mozilla.in
--- /usr/HEAD/ports/mail/thunderbird/files/patch-mail_app_mozilla.in	Wed Dec 29 04:28:51 2004
+++ /junk/wk/mail/thunderbird/files/patch-mail_app_mozilla.in	Wed Jan  5 01:05:24 2005
@@ -1,50 +1,507 @@
---- mail/app/mozilla.in.orig	Sat Jul 24 19:58:06 2004
-+++ mail/app/mozilla.in	Mon Dec 27 18:40:04 2004
-@@ -167,12 +167,12 @@
- done #others arg
+--- mail/app/mozilla.in.orig	Sun Jul 25 01:58:06 2004
++++ mail/app/mozilla.in	Wed Jan  5 01:03:17 2005
+@@ -16,64 +16,92 @@
+ # Reserved.
+ #
  
- #???: needs check if othersopt begin with -* ?
+-## $Id: mozilla.in,v 1.2.6.1 2004/07/24 23:58:06 bryner%brianryner.com Exp $
+-## 
+-## Usage:
+-##
+-## $ mozilla [args]
+-##
+-## This script is meant to run the mozilla-bin binary from either 
+-## mozilla/xpfe/bootstrap or mozilla/dist/bin.
+-##
+-## The script will setup all the environment voodoo needed to make
+-## the mozilla-bin binary to work.
+-##
+-
++# $from: mozilla.in,v 1.3.4.9 2004/10/26 09:26:11 bryner%brianryner.com Exp $
++# Usage:
++#
++# $ mozilla [args]
++#
++# The script will setup all the environment voodoo needed to make
++# the mozilla-bin binary to work.
++#
++
++#
++# MOZ_PIS, "Mozilla Plugable Init Scripts"
++# MOZ_PIS_ is the name space used
++# These variables and there meaning are specified in
++# mozilla/xpfe/bootstrap/init.d/README
+ moz_pis_startstop_scripts()
+ {
+-  MOZ_USER_DIR="%MOZ_USER_DIR%"
+-  # MOZ_PIS_ is the name space for "Mozilla Plugable Init Scripts"
+-  # These variables and there meaning are specified in
+-  # mozilla/xpfe/bootstrap/init.d/README
+-  MOZ_PIS_API=2
+-  MOZ_PIS_MOZBINDIR="${dist_bin}"
+-  MOZ_PIS_SESSION_PID="$$"
+-  MOZ_PIS_USER_DIR="${MOZ_USER_DIR}"
+-  export MOZ_PIS_API MOZ_PIS_MOZBINDIR MOZ_PIS_SESSION_PID MOZ_PIS_USER_DIR
+-  
+-  case "${1}" in
+-    "start")
+-      for curr_pis in "${dist_bin}/init.d"/S* "${HOME}/${MOZ_USER_DIR}/init.d"/S* ; do
+-        if [ -x "${curr_pis}" ] ; then
+-          case "${curr_pis}" in
+-            *.sh) .  "${curr_pis}"         ;;
+-            *)       "${curr_pis}" "start" ;;
+-          esac
+-        fi
+-      done
+-      ;;
+-    "stop")
+-      for curr_pis in "${HOME}/${MOZ_USER_DIR}/init.d"/K* "${dist_bin}/init.d"/K* ; do
+-        if [ -x "${curr_pis}" ] ; then
+-          case "${curr_pis}" in
+-            *.sh) . "${curr_pis}"        ;;
+-            *)      "${curr_pis}" "stop" ;;
+-          esac
+-        fi
+-      done
+-      ;;
+-    *)
+-      echo 1>&2 "$0: Internal error in moz_pis_startstop_scripts."
+-      exit 1
+-      ;;
+-  esac
++    MOZ_PIS_API=2
++    MOZ_PIS_MOZBINDIR="${dist_bin}"
++    MOZ_PIS_SESSION_PID="$$"
++    MOZ_PIS_USER_DIR="${MOZ_USER_DIR}"
++    export MOZ_PIS_API MOZ_PIS_MOZBINDIR MOZ_PIS_SESSION_PID MOZ_PIS_USER_DIR
++
++    case "${1}" in
++	"start")
++	    for curr_pis in "${MOZ_PIS_MOZBINDIR}/init.d"/S* \
++			    "${HOME}/${MOZ_PIS_USER_DIR}/init.d"/S*; do
++		if [ -x "${curr_pis}" ]; then
++		    case "${curr_pis}" in
++			*.sh)
++			    . "${curr_pis}"
++			    ;;
++			*)
++			    ${curr_pis} "start"
++			    ;;
++		    esac
++		fi
++	    done
++	    ;;
++	"stop")
++	    for curr_pis in "${MOZ_PIS_MOZBINDIR}/init.d"/K* \
++			    "${HOME}/${MOZ_PIS_USER_DIR}/init.d"/K*; do
++		if [ -x "${curr_pis}" ]; then
++		    case "${curr_pis}" in
++			*.sh)
++			    . "${curr_pis}"
++			    ;;
++			*)
++			    ${curr_pis} "stop"
++			    ;;
++		    esac
++		fi
++	    done
++	    ;;
++	*)
++	    echo "$0: Internal error in moz_pis_startstop_scripts." 1>&2
++	    exit 1
++	    ;;
++    esac
+ }
+ 
+-#uncomment for debugging
++# uncomment for debugging
+ #set -x
+ 
+-moz_libdir=%MOZAPPDIR%
+-MRE_HOME=%MREDIR%
++#
++# variables
++#
++#location="new-tab"
++#MOZILLA_UILOCALE="en-US"
++#MOZILLA_UIREGION="US"
++
++#
++# working definitions
++#
++MOZ_USER_DIR="%MOZ_USER_DIR%"
++moz_libdir="%MOZAPPDIR%"
++MRE_HOME="%MREDIR%"
++
++debugging=		# set the debugging level
++use_openFile="yes"	# use openFile() for file/dir
++here=`pwd`
++
++if [ ! -d "${MRE_HOME}" ]; then
++    # use moz_libdir as MRE_HOME
++    MRE_HOME="${moz_libdir}"
++fi
++export	MRE_HOME
+ 
+ # Use run-mozilla.sh in the current dir if it exists
+ # If not, then start resolving symlinks until we find run-mozilla.sh
+@@ -82,160 +110,227 @@
+ curdir=`dirname "$progname"`
+ progbase=`basename "$progname"`
+ run_moz="$curdir/run-mozilla.sh"
+-if test -x "$run_moz"; then
+-  dist_bin="$curdir"
+-  found=1
++if [ -x "$run_moz" ]; then
++    dist_bin="$curdir"
++    found=1
+ else
+-  here=`/bin/pwd`
+-  while [ -h "$progname" ]; do
+-    bn=`basename "$progname"`
+-    cd `dirname "$progname"`
+-    progname=`/bin/ls -l "$bn" | sed -e 's/^.* -> //' `
+-    if [ ! -x "$progname" ]; then
+-      break
+-    fi
+-    curdir=`dirname "$progname"`
+-    run_moz="$curdir/run-mozilla.sh"
+-    if [ -x "$run_moz" ]; then
+-      cd "$curdir"
+-      dist_bin=`pwd`
+-      found=1
+-      break
+-    fi
+-  done
+-  cd "$here"
++    while [ -h "${progname}" ]; do
++	bn=`basename "${progname}"`
++	cd `dirname "${progname}"`
++	progname=`ls -l "${bn}" | sed -e 's/^.* -> //'`
++	if [ ! -x "$progname" ]; then
++	    break
++	fi
++    	curdir=`dirname "${progname}"`
++    	run_moz="${curdir}/run-mozilla.sh"
++    	if [ -x "${run_moz}" ]; then
++	    cd "$curdir"
++	    dist_bin=`pwd`
++	    run_moz="${dist_bin}/run-mozilla.sh"
++	    found=1
++	    break
++	fi
++    done
++    cd "${here}"
+ fi
+ if [ $found = 0 ]; then
+-  # Check default compile-time libdir
+-  if [ -x "$moz_libdir/run-mozilla.sh" ]; then
+-    dist_bin="$moz_libdir"
+-  else 
+-    echo "Cannot find mozilla runtime directory. Exiting."
++    # Check default compile-time libdir
++    if [ -x "${moz_libdir}/run-mozilla.sh" ]; then
++	dist_bin="$moz_libdir"
++	run_moz="${dist_bin}/run-mozilla.sh"
++    else
++	echo "$0: Cannot find mozilla runtime directory. Exiting." 1>&2
++	exit 1
++    fi
++fi
++MOZILLA_BIN="${progbase}-bin"
++
++if [ "$OSTYPE" = "beos" ]; then
++    mimeset -F "$MOZILLA_BIN"
++fi
++
++# test for binary apps in ${dist_bin}
++if [ -x "${dist_bin}/mozilla-xremote-client" ]; then
++    MOZ_CLIENT_PROGRAM="${dist_bin}/mozilla-xremote-client -a ${progbase}"
++elif [ -x "${dist_bin}/${progbase}-bin" ]; then
++    MOZ_CLIENT_PROGRAM="${MOZILLA_BIN} -remote -a ${progbase}"
++else
++    echo "$0: Cannot find mozilla binary executable. Exiting." 1>&2
++    exit 1
++fi
++if [ -x "${dist_bin}/${MOZILLA_BIN}" ]; then
++    MOZILLA_BIN="${dist_bin}/${progbase}-bin"
++else
++    echo "$0: Cannot find mozilla binary executable. Exiting." 1>&2
+     exit 1
+-  fi
+ fi
+ 
+-script_args=""
+-moreargs=""
+-debugging=0
+-MOZILLA_BIN="${progbase}-bin"
++# guest a default remote command
++_remote_cmd="xfeDoCommand(openInbox)"
+ 
+-# The following is to check for a currently running instance.
+-# This is taken almost verbatim from the Mozilla RPM package's launch script.
+-MOZ_CLIENT_PROGRAM="$dist_bin/mozilla-xremote-client"
+-check_running() {
+-    "${run_moz}" "$MOZ_CLIENT_PROGRAM" -a "${progbase}" 'ping()' 2>/dev/null >/dev/null
+-    RETURN_VAL=$?
+-    if [ $RETURN_VAL -eq 0 ]; then
+-        echo 1
+-        return 1
++# test for a running copy of firefox
++ALREADY_RUNNING=	# null
++if [ -n "${DISPLAY}" ]; then
++    if [ -n "${debugging}" ]; then
++	echo "${run_moz} ${MOZ_CLIENT_PROGRAM} ping()"
++	${run_moz} ${MOZ_CLIENT_PROGRAM} 'ping()' && ALREADY_RUNNING="yes"
+     else
+-        echo 0
+-        return 0
++	${run_moz} ${MOZ_CLIENT_PROGRAM} 'ping()' >/dev/null 2>&1 &&
++		ALREADY_RUNNING="yes"
+     fi
+-}
+-
+-if [ "$OSTYPE" = "beos" ]; then
+-  mimeset -F "$MOZILLA_BIN"
++elif [ -n "${debugging}" ]; then
++    echo "$0: WARN, no DISPLAY environment" 1>&2
+ fi
+ 
+-ALREADY_RUNNING=`check_running`
+-
+-################################################################ Parse Arguments
+-# If there's a command line argument but it doesn't begin with a -
+-# it's probably a url.  Try to send it to a running instance.
+-_USE_EXIST=0
+-_NEW_WINDOW=
+-_optOne="$1"
+-case "${_optOne}" in
+-	-*) 
+-		;;
++#parse options
++script_args=	# null
++moreargs=	# null
++target=		# null
++while [ $# -gt 0 ]
++do
++    if [ -n "${target}" ]; then
++	# well, this can't be the target if not last
++	moreargs="${moreargs} ${target}"
++	target=	# null
++    fi
++    case "$1" in
++	-p | --pure | -pure)
++	    MOZILLA_BIN="${MOZILLA_BIN}.pure"
++	    shift
++	    ;;
++	-g | --debug)
++	    script_args="${script_args} -g"
++	    debugging=1
++	    shift
++	    ;;
++	-d | --debugger)
++	    if [ -n "$2" ]; then
++		script_args="${script_args} -d $2"
++		shift 2
++	    else
++		"$0: ERROR, -d needs an argument. Exiting" 1>&2
++		exit 1
++	    fi
++	    ;;
++	-UILocale)
++	    if [ -n "$2" ]; then
++		uilocale="$2"
++		shift 2
++	    else
++		echo "$0: ERROR, -UILocale needs an argument. Exiting" 1>&2
++		exit 1
++	    fi
++	    ;;
++	-UIRegion)
++	    if [ -n "$2" ]; then
++		uiregion="$2"
++		shift 2
++	    else
++		echo "$0: ERROR, -UIRegion needs an argument. Exiting" 1>&2
++		exit 1
++	    fi
++	    ;;
++	-browser)
++	    _remote_cmd="xfeDoCommand(openBrowser)"
++	    moreargs="${moreargs} $1"
++	    shift
++	    ;;
++	-mail)
++	    _remote_cmd="xfeDoCommand(openInbox)"
++	    moreargs="${moreargs} $1"
++	    shift
++	    ;;
++	-compose)
++	    _remote_cmd="xfeDoCommand(composeMessage)"
++	    moreargs="${moreargs} $1"
++	    shift
++	    ;;
++	-chat | -edit | -webcal)
++	    # don't use remote for this
++	    ALREADY_RUNNING=	# null
++	    moreargs="${moreargs} $1"
++	    shift
++	    ;;
++	-*)
++	    moreargs="${moreargs} $1"
++	    shift
++	    ;;
+ 	*)
+-		_USE_EXIST=1
+-		;;
+-esac
+-
+-_optOthers=
+-_optLast=
+-for i in "$@"; do 
+-	_optLast="${i}"
+-done #last arg
+-
+-for i in "$@"; do
+-	[ $i = ${_optLast} ] && break
+-	_optOthers="${_optOthers} ${i}"
+-done #others arg
+-
+-#???: needs check if othersopt begin with -* ?
 -if [ `expr "${_optLast}" : '.*:/.*'` -eq 0 -a \( -f "${_optLast}" -o -d "${_optLast}" \) ]; then
-+if [ `expr X"${_optLast}" : 'X.*:/.*'` -eq 0 -a \( -f "${_optLast}" -o -d "${_optLast}" \) ]; then
- 	# Last argument seems to be a local file/directory
- 	# Check, if it is absolutely specified (ie. /home/foo/file vs. ./file)
- 	# If it is just "relatively" (./file) specified, make it absolutely
+-	# Last argument seems to be a local file/directory
+-	# Check, if it is absolutely specified (ie. /home/foo/file vs. ./file)
+-	# If it is just "relatively" (./file) specified, make it absolutely
 -	[ `expr "${_optLast}" : '/.*'` -eq 0 ] && _optLast="file://`pwd`/${_optLast}"
 -elif [ `expr "${_optLast}" : '.*:/.*'` -gt 0 -o -n "${_optOthers}" ]; then #???? like before...
-+	[ `expr X"${_optLast}" : 'X/.*'` -eq 0 ] && _optLast="file://`pwd`/${_optLast}"
-+elif [ `expr X"${_optLast}" : 'X.*:/.*'` -gt 0 -o -n "${_optOthers}" ]; then #???? like before...
- 	_NEW_WINDOW=1
+-	_NEW_WINDOW=1
+-fi
+-################################################################ Parse Arguments
+-
+-########################################################################### Main
+-if [ $ALREADY_RUNNING -eq 1 ]; then
+-	# There's an instance already running. Use it.
+-	# Any command line args passed in?
+-	if [ $# -gt 0 ]; then
+-		# There were "some" command line args.
+-		if [ ${_USE_EXIST} -eq 1 ]; then
+-			# We should use an existing instance, as _USE_EXIST=$_USE_EXIST=-1
+-			_open_type="window"
+-			#_open_type="tab"
+-			_remote_cmd="openURL(${_optLast} , new-${_open_type})"
+-			"${run_moz}" "$MOZ_CLIENT_PROGRAM" -a "${progbase}" "${_remote_cmd}"
+-			unset _remote_cmd _open_type
+-			exit $?
+-		fi
++	    target="$1"
++	    shift
++	    ;;
++    esac
++done
++
++# process target
++if [ -n "${target}" ]; then
++    if [ `expr "${target}" : '.*:.*'` -eq 0 ]; then
++	if [ `expr "${target}" : '/.*'` -eq 0 ]; then
++	    target="${here}/${target}"
++	fi
++	if [ -r "${target}" -o -d "${target}" ]; then
++	    [ -n "${use_openFile}" ] || target="file://${target}"
+ 	else
+-		# No command line args. Open new window/tab
+-		#exec "${run_moz}" "$MOZ_CLIENT_PROGRAM" -a "${progbase}" "xfeDoCommand(openBrowser)"
+-		"${run_moz}" "$MOZ_CLIENT_PROGRAM" -a "${progbase}" "xfeDoCommand(openInbox)"
+-		exit $?
++	    echo "$0: WARN, target: ${target} not an URI/file/dir" 1>&2
++	    ALREADY_RUNNING=	# null
+ 	fi
++    else
++	# an former URI, don't use openFile
++	use_openFile=	# null
++    fi
  fi
- ################################################################ Parse Arguments
-@@ -218,12 +218,31 @@
-       script_args="$script_args -d $2"
-       shift 2
-       ;;
-+    -UILocale)
-+      moreargs="$moreargs -UILocale $2"
-+      _done_locale="YES"
-+      shift 2
-+      ;;
-+    -UIRegion)
-+      if [ -n "${_done_locale}" ]; then
-+        moreargs="$moreargs -UIRegion $2"
-+      fi
-+      shift 2
-+      ;;
-     *)
-       moreargs="$moreargs \"$1\""
-       shift 1
-       ;;
-   esac
- done
-+
-+if [ ! -n "${_done_locale}" -a -n "${MOZILLA_UILOCALE}" ]; then
-+    moreargs="$moreargs -UILocale ${MOZILLA_UILOCALE}"
-+    if [ -n "${MOZILLA_UIREGION}" ]; then
-+      moreargs="$moreargs -UIRegion ${MOZILLA_UIREGION}"
+-# Default action - no running instance or _USE_EXIST (${_USE_EXIST}) ! -eq 1
+-########################################################################### Main
+ 
+-while [ $# -gt 0 ]
+-do
+-  case "$1" in
+-    -p | --pure | -pure)
+-      MOZILLA_BIN="${MOZILLA_BIN}.pure"
+-      shift
+-      ;;
+-    -g | --debug)
+-      script_args="$script_args -g"
+-      debugging=1
+-      shift
+-      ;;
+-    -d | --debugger)
+-      script_args="$script_args -d $2"
+-      shift 2
+-      ;;
+-    *)
+-      moreargs="$moreargs \"$1\""
+-      shift 1
+-      ;;
+-  esac
+-done
++# try remote protocol if running
++if [ -n "${ALREADY_RUNNING}" ]; then
++    if [ -n "${target}" ]; then
++	if [ -n "${use_openFile}" ]; then
++	    _remote_cmd="openFile(${target})"
++	elif [ -n "${location}" ]; then
++	    _remote_cmd="openURL(${target},${location})"
++	else
++	    _remote_cmd="openURL(${target})"
++	fi
++    fi
++    # FIXME problems with freedesktop StartupNotify
++    if [ -n "${debugging}" ]; then
++	echo "${run_moz} ${script_args} ${MOZ_CLIENT_PROGRAM} ${_remote_cmd}"
 +    fi
++    ${run_moz} ${script_args} ${MOZ_CLIENT_PROGRAM} ${_remote_cmd} && exit 0
++fi
++
++# fallback to direct invocation
++
++# UILocale, UIRegion
++if [ -z "${uilocale}" -a -n "${MOZILLA_UILOCALE}" ]; then
++    uilocale="${MOZILLA_UILOCALE}"
 +fi
-+unset _done_locale
++if [ -z "${uiregion}" -a -n "${MOZILLA_UIREGION}" ]; then
++    uiregion="${MOZILLA_UIREGION}"
++fi
++if [ -n "${uiregion}" -a -z "${uilocale}" ]; then
++    uilocale="en-US"
++fi
++if [ -n "${moz_uilocale}" ]; then
++    if [ -n "${moz_uiregion}" ]; then
++	moreargs="-UIRegion ${moz_uiregion} ${more_args}"
++    fi
++    moreargs="-UILocale ${moz_uilocale} ${more_args}"
++fi
+ 
+-export MRE_HOME
+-eval "set -- $moreargs"
++# real invocation
++if [ -n "${target}" ]; then
++    eval "set -- ${moreargs} \"${target}\""
++else
++    eval "set -- ${moreargs}"
++fi
+ 
+ ## Start addon scripts
+ moz_pis_startstop_scripts "start"
+ 
+-if [ $debugging = 1 ]
+-then
+-  echo $dist_bin/run-mozilla.sh $script_args $dist_bin/$MOZILLA_BIN "$@"
++if [ -n "${debugging}" ]; then
++    echo "${run_moz} ${script_args} ${MOZILLA_BIN} $@"
+ fi
+-"$dist_bin/run-mozilla.sh" $script_args "$dist_bin/$MOZILLA_BIN" "$@"
++${run_moz} ${script_args} ${MOZILLA_BIN} "$@"
+ exitcode=$?
  
- export MRE_HOME
- eval "set -- $moreargs"
+ ## Stop addon scripts
diff -ruN --exclude=CVS /usr/HEAD/ports/mail/thunderbird/files/patch-uriloader_exthandler_unix_nsGNOMERegistry.cpp /junk/wk/mail/thunderbird/files/patch-uriloader_exthandler_unix_nsGNOMERegistry.cpp
--- /usr/HEAD/ports/mail/thunderbird/files/patch-uriloader_exthandler_unix_nsGNOMERegistry.cpp	Thu Jan  1 01:00:00 1970
+++ /junk/wk/mail/thunderbird/files/patch-uriloader_exthandler_unix_nsGNOMERegistry.cpp	Wed Jan  5 01:15:46 2005
@@ -0,0 +1,29 @@
+--- uriloader/exthandler/unix/nsGNOMERegistry.cpp.orig	Fri Dec 24 04:30:00 2004
++++ uriloader/exthandler/unix/nsGNOMERegistry.cpp	Fri Dec 24 04:34:05 2004
+@@ -143,7 +143,7 @@
+     PR_END_MACRO
+ 
+   // Attempt to open libgconf
+-  gconfLib = LoadVersionedLibrary("gconf-2", ".4");
++  gconfLib = PR_LoadLibrary("libgconf-2.so");
+   ENSURE_LIB(gconfLib);
+ 
+   GET_LIB_FUNCTION(gconf, gconf_client_get_default);
+@@ -151,7 +151,7 @@
+   GET_LIB_FUNCTION(gconf, gconf_client_get_bool);
+ 
+   // Attempt to open libgnome
+-  gnomeLib = LoadVersionedLibrary("gnome-2", ".0");
++  gnomeLib = PR_LoadLibrary("libgnome-2.so");
+   ENSURE_LIB(gnomeLib);
+ 
+   GET_LIB_FUNCTION(gnome, gnome_url_show);
+@@ -160,7 +160,7 @@
+   GET_LIB_FUNCTION(gnome, gnome_program_get);
+ 
+   // Attempt to open libgnomevfs
+-  vfsLib = LoadVersionedLibrary("gnomevfs-2", ".0");
++  vfsLib = PR_LoadLibrary("libgnomevfs-2.so");
+   ENSURE_LIB(vfsLib);
+ 
+   GET_LIB_FUNCTION(vfs, gnome_vfs_mime_type_from_name);
diff -ruN --exclude=CVS /usr/HEAD/ports/mail/thunderbird/files/thunderbird.desktop.in /junk/wk/mail/thunderbird/files/thunderbird.desktop.in
--- /usr/HEAD/ports/mail/thunderbird/files/thunderbird.desktop.in	Mon Dec 13 01:04:24 2004
+++ /junk/wk/mail/thunderbird/files/thunderbird.desktop.in	Wed Jan  5 02:37:15 2005
@@ -1,9 +1,87 @@
 [Desktop Entry]
+Encoding=UTF-8
 Name=Thunderbird
+Name[bn]=থাণ~Mডারবার~Mড
+Name[eo]=Mozilo Tondrobirdo
+Name[fi]=Mozilla Thunderbird
+Name[pa]=ਥੰਡਰਬਰਡ
+Name[tg]=~_а~@~@андаи бало
+GenericName=Mail Client
+GenericName[af]=Pos Kliënt
+GenericName[ar]=ا~Dبر~Jد ا~Dأ~D~Cتر~H~F~J
+GenericName[az]=Poçt Alıcısı
+GenericName[be]=~_а~H~Bов~K кл~Vен~B
+GenericName[bg]=~_о~Iен~Aки клиен~B
+GenericName[bn]=~Gম~G~Gল ~U~Mলা~_~Gন~M~_
+GenericName[br]=Arval postel
+GenericName[bs]=Program za ~Mitanje elektronske pošte
+GenericName[ca]=Client de correu electrònic
+GenericName[cs]=Klient pro ~Mtení elektronické pošty
+GenericName[cy]=Dibynnydd Ebost
+GenericName[da]=E-mail-klient
+GenericName[de]=E-Mail-Programm
+GenericName[el]=| ελά~Dη~B mail
+GenericName[eo]=Legi kaj sendi retpo~]ton
+GenericName[es]=Cliente de correo electrónico
+GenericName[et]=Meiliklient
+GenericName[eu]=Posta bezeroa
+GenericName[fa]=کارگ~Lر پست ا~Dکتر~H~F~Lک~L
+GenericName[fi]=Sähköpostiohjelma
+GenericName[fo]=Postforrit
+GenericName[fr]=Logiciel de messagerie électronique
+GenericName[ga]=Cliant Ríomhphoist
+GenericName[gl]=Cliente de correo
+GenericName[he]=ת~U~[| ~Yת ~S~U~Pר
+GenericName[hi]=डा~Uिया
+GenericName[hr]=Program za ~Mitanje elektronske pošte
+GenericName[hu]=Levelez~Qprogram
+GenericName[id]=Klien Mail
+GenericName[is]=Póstforrit
+GenericName[it]=Programma di posta elettronica
+GenericName[ja]=~C~C~C~B~C~B~B~C~C~H
+GenericName[ko]=~N~@를 주|  ~[~J~T ~T~D~\그~^
+GenericName[lt]=Pašto klientas
+GenericName[lo]=~D~D~A~@ອັ~Y~Hົ~Tຫມາ~M~@ອ~@ລັ~A~B~U~Yິ~A
+GenericName[lv]=Pasta Klients
+GenericName[mk]=~_~@ог~@ама за елек~B~@он~Aка по~H~Bа
+GenericName[mn]=Э-~Wа~Eиа-~_~@ог~@ам
+GenericName[mt]=Klijent tal-imejl
+GenericName[nb]=E-postklient
+GenericName[nds]=Mailprogramm
+GenericName[nl]=E-mailclient
+GenericName[nn]=Lesing og sending av e-post
+GenericName[nso]=Moreki wa Poso
+GenericName[oc]=Programari de correu electrònic
+GenericName[pa]=ਪੱਤਰ ~Uਲਾ~B~G~_
+GenericName[pl]=Program do wysy~Bania i odbierania poczty elektronicznej
+GenericName[pt]=Client de E-mail
+GenericName[pt_BR]=Cliente de E-mail
+GenericName[ro]=Program de po~_t~C electronic~C
+GenericName[ru]=~Zлиен~B ~Mлек~B~@онной по~G~B~K
+GenericName[se]=Boastaprográmma
+GenericName[sk]=Klient elektronickej pošty
+GenericName[sl]=Program za e-pošto
+GenericName[sr]=~_~@ог~@ам за e-по~H~B~C
+GenericName[sr@Latn]=Program za e-poštu
+GenericName[ss]=Likhasimende leliposi
+GenericName[sv]=E-postklient
+GenericName[ta]=~E~^~M~Zல~M ~Iற~Aப~Mபினர~M
+GenericName[tg]=~Zо~@ги~@и по~G~Bаи ~Mллек~B~@оникӣ
+GenericName[th]=~D~Dล~@อ~Y~U~L~H~Tหมายอิ~@ล~G~A~Wรอ~Yิ~Aส~L
+GenericName[tr]=Posta İstemcisi
+GenericName[uk]=~Zл~V~Tн~B елек~B~@онно~W по~H~Bи
+GenericName[uz]=Ха~B-~Eаба~@ клиен~Bи
+GenericName[ven]=Mushumisani na poso
+GenericName[wa]=Cliyint d'| emilaedje
+GenericName[xh]=Umxhasi Weposi
+GenericName[zh_CN]=~B件~K~O
+GenericName[zh_TW]=~C件~Y~U~P~F~K~O
+GenericName[zu]=Umxhasi weposi
 Comment=Mail client and News Reader
-Exec=thunderbird
+Comment[es]=Cliente de correo y lector de noticias
+Exec=thunderbird %U
 Icon=@THUNDERBIRD_ICON@
+StartupNotify=false
 Terminal=false
 Type=Application
 Categories=Application;Network;
-Encoding=UTF-8
diff -ruN --exclude=CVS /usr/HEAD/ports/mail/thunderbird/pkg-deinstall.in /junk/wk/mail/thunderbird/pkg-deinstall.in
--- /usr/HEAD/ports/mail/thunderbird/pkg-deinstall.in	Sat Nov  6 07:11:36 2004
+++ /junk/wk/mail/thunderbird/pkg-deinstall.in	Wed Jan  5 01:26:45 2005
@@ -9,10 +9,12 @@
 umask 022
 PATH=/bin:/usr/bin
 
+prefix="${PKG_PREFIX:-%%PREFIX%%}"
+
 [ "x$1" = "x" ] && exit 1
 [ "x$2" != "xDEINSTALL" ] && exit 0
 
-MOZDIR=%%MOZDIR%%
+MOZDIR="${prefix}/%%MOZDIR%%"
 
 rm -rf ${MOZDIR}/chrome/overlayinfo
 rm -f ${MOZDIR}/chrome/*.rdf
@@ -21,5 +23,11 @@
 rm -f ${MOZDIR}/defaults.ini
 rm -f ${MOZDIR}/components/*.dat
 rm -rf ${MOZDIR}/extensions
+
+# support for outer scripts
+for script in thunderbird thunderbird-config; do
+    rm -f "${prefix}/bin/${script}"
+done
+# TODO, others thunderbird ports?
 
 exit 0
diff -ruN --exclude=CVS /usr/HEAD/ports/mail/thunderbird/pkg-install.in /junk/wk/mail/thunderbird/pkg-install.in
--- /usr/HEAD/ports/mail/thunderbird/pkg-install.in	Mon Nov 22 05:16:25 2004
+++ /junk/wk/mail/thunderbird/pkg-install.in	Wed Jan  5 01:21:58 2005
@@ -9,13 +9,15 @@
 umask 022
 PATH=/bin:/usr/bin:/usr/local/bin
 
+prefix="${PKG_PERFIX:-%%PREFIX%%}"
+
 [ "x$1" = "x" ] && exit 1
 [ "x$2" != "xPOST-INSTALL" ] && exit 0
 
-MOZDIR=%%MOZDIR%%
-REGXPCOM=${MOZDIR}/regxpcom
-REGCHROME=${MOZDIR}/regchrome
-THUNDERBIRD=${MOZDIR}/thunderbird-bin
+MOZDIR="${prefix}/%%MOZDIR%%"
+REGXPCOM="${MOZDIR}/regxpcom"
+REGCHROME="${MOZDIR}/regchrome"
+THUNDERBIRD="${MOZDIR}/thunderbird-bin"
 
 echo "===> Building Chrome's registry..."
 rm -rf ${MOZDIR}/chrome/overlayinfo
@@ -28,5 +30,12 @@
 ./run-mozilla.sh ${REGXPCOM} || true
 ./run-mozilla.sh ${REGCHROME} || true
 ./run-mozilla.sh ${THUNDERBIRD} -register > /dev/null 2>&1
+
+# install outer scripts
+for script in thunderbird thunderbird-config; do
+    if [ -x "${MOZDIR}/${script}" ]; then
+	install -m 555 ${MOZDIR}/${script} ${prefix}/bin
+    fi
+done
 
 exit 0
--- thunderbird-1.0_2.patch ends here ---

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->gnome 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Wed Jan 5 04:19:38 GMT 2005 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=75837 

From: Jose M Rodriguez <josemi@freebsd.jazztel.es>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: ports/75837: [PATCH] mail-thunderbird: latest changes against thunderbird
Date: Sun, 27 Feb 2005 14:47:36 +0100 (CET)

 Latest pull-up for thunderbird
 As taken for firefox
 
 --- thunderbird-patch begins here ---
 diff -Nru /usr/HEAD/ports/mail/thunderbird/Makefile mail/thunderbird/Makefile
 --- /usr/HEAD/ports/mail/thunderbird/Makefile	Tue Dec 28 01:51:57 2004
 +++ mail/thunderbird/Makefile	Sun Feb 27 11:12:00 2005
 @@ -7,7 +7,7 @@
  
  PORTNAME=	thunderbird
  PORTVERSION=	1.0
 -PORTREVISION=	1
 +PORTREVISION=	2
  CATEGORIES=	mail
  MASTER_SITES=	${MASTER_SITE_MOZILLA}
  MASTER_SITE_SUBDIR=	thunderbird/releases/${PORTVERSION}/source
 @@ -18,8 +18,7 @@
  
  LIB_DEPENDS=	jpeg.9:${PORTSDIR}/graphics/jpeg \
  		png.5:${PORTSDIR}/graphics/png \
 -		mng.1:${PORTSDIR}/graphics/libmng \
 -		nspr4.1:${PORTSDIR}/devel/nspr
 +		mng.1:${PORTSDIR}/graphics/libmng
  BUILD_DEPENDS=	zip:${PORTSDIR}/archivers/zip
  
  USE_X_PREFIX=	yes
 @@ -45,8 +44,13 @@
  LOCAL_PREFIX=		${PREFIX}/${LOCAL_SUBDIR}
  ESD_LIB=		libesd.so.2
  
 +THUNDERBIRD=		${PORTNAME}
  THUNDERBIRD_ICON=	thunderbird.xpm
  THUNDERBIRD_ICON_SRC=	${WRKSRC}/other-licenses/branding/thunderbird/default.xpm
 +MOZ_PIS_SCRIPTS=	S50cleanhome
 +SCRIPTS_DIR=	${FAKEDIR}/${LOCAL_SUBDIR}/lib/${PORTNAME}-${PORTVERSION}
 +MOZ_PIS_DIR=	${SCRIPTS_DIR}/init.d
 +
  
  OPTIONS=	DEBUG "Build a debugging image" off \
  		LOGGING "Enable additional log messages" off \
 @@ -69,9 +73,9 @@
  .endif # defined(WITH_DEBUG)
  
  .if defined(WITH_OPTIMIZED_CFLAGS)
 -CFLAGS+=		-O2
 -CONFIGURE_ENV+=		WITH_OPTIMIZE=-O2
 +CFLAGS:=		-O2 -fno-strict-aliasing ${CFLAGS:N-O*}
  .else
 +CFLAGS:=		-O ${CFLAGS:N-O*:N-m*}
  CONFIGURE_ENV+=		WITH_OPTIMIZE=-O
  .endif # defined(WITH_OPTIMIZED_CFLAGS)
  
 @@ -140,7 +144,12 @@
  		< ${MASTERDIR}/pkg-deinstall.in > ${PKGDEINSTALL}
  	@${SED} -e 's|@THUNDERBIRD_ICON@|${THUNDERBIRD_ICON}|' \
  		< ${FILESDIR}/thunderbird.desktop.in > ${WRKDIR}/thunderbird.desktop
 -
 +.for ii in ${MOZ_PIS_SCRIPTS}
 +	@${SED} -e 's|%%MOZILLA%%|${THUNDERBIRD}|g ; \
 +		s|%%PREFIX%%|${PREFIX}|g ; \
 +		s|%%X11BASE%%|${X11BASE}|g' \
 +		< ${FILESDIR}/moz_pis_${ii} > ${WRKDIR}/moz_pis_${ii}
 +.endfor
  pre-configure:
  	@if [ -n "`${PKG_INFO} -xI '^bind[0-9]*-base-[0-9]'`" ]; then \
  		${ECHO_CMD} "${PKGNAME}: bind installed with PORT_REPLACES_BASE_BIND causes build problems."; \
 @@ -159,6 +168,8 @@
  	@${RM} -rf ${FAKEDIR} ${PLIST}
  	@cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} \
  		Makefile ${MAKE_ARGS} install
 +	@${MKDIR} ${SCRIPTS_DIR}
 +	@${MKDIR} ${MOZ_PIS_DIR}
  .for ii in mac win
  .for jj in / .jar
  	@${RM} -rf ${FAKEDIR}/lib/${PORTNAME}/lib/${PORTNAME}-${PORTVERSION}/chrome/en-${ii}${jj}
 @@ -167,6 +178,9 @@
  	@${RM} -fr ${FAKEDIR}/share/idl ${FAKEDIR}/include
  .for ii in thunderbird thunderbird-config
  	@${ECHO_CMD} bin/${ii} >> ${PLIST}
 +.endfor
 +.for ii in ${MOZ_PIS_SCRIPTS}
 +	${INSTALL_SCRIPT} ${WRKDIR}/moz_pis_${ii} ${MOZ_PIS_DIR}/${ii}
  .endfor
  	@${MKDIR} ${FAKEDIR}/${LOCAL_SUBDIR}/lib/${PORTNAME}-${PORTVERSION}/defaults
  	@${CP} -RL ${WRKSRC}/dist/bin/defaults/isp \
 diff -Nru /usr/HEAD/ports/mail/thunderbird/files/moz_pis_S50cleanhome mail/thunderbird/files/moz_pis_S50cleanhome
 --- /usr/HEAD/ports/mail/thunderbird/files/moz_pis_S50cleanhome	Thu Jan  1 01:00:00 1970
 +++ mail/thunderbird/files/moz_pis_S50cleanhome	Sun Feb 27 11:12:49 2005
 @@ -0,0 +1,34 @@
 +#!/bin/sh
 +#
 +
 +# S50cleanhome
 +# a script to polite ${HOME}/${MOZ_PIS_USER_DIR}
 +
 +# We run in our own subshell
 +
 +# First, verify protocol
 +[ "$1" != "start" ] && exit 1
 +[ -z "${MOZ_PIS_API}" -o ${MOZ_PIS_API} -ne 2 ] && exit 1
 +[ -z "${MOZ_PIS_MOZBINDIR}" -o ! -d "${MOZ_PIS_MOZBINDIR}" ] && exit 1
 +[ -z "${HOME}" -o ! -d "${HOME}" ] && exit 1
 +[ -z "${MOZ_PIS_USER_DIR}" -o ! -d "${HOME}/${MOZ_PIS_USER_DIR}" ] && exit 1
 +
 +# Try to polite ${HOME}/${MOZ_PIS_USER_DIR}
 +
 +# This must be really needed?
 +# rm -f "${$HOME}/${MOZ_PIS_USER_DIR}/pluginreg.dat"
 +
 +# Try to polite profile dirs
 +if [ -f "${HOME}/${MOZ_PIS_USER_DIR}/profiles.ini" ]; then
 +    sed -e '/Path=/! d' -e "s,Path=,${HOME}/${MOZ_PIS_USER_DIR}/," \
 +	"${HOME}/${MOZ_PIS_USER_DIR}/profiles.ini" \
 +	| while read dir
 +    do
 +	[ ! -d "${dir}" ] && continue
 +	# at last, debian do this, we do for new builds
 +	# rm -f "${dir}/XUL.mfasl"
 +	# make reclaculate compreg.dat, xpti.dat for new builds
 +	[ "${dir}/compreg.dat" -ot "${MOZ_PIS_MOZBINDIR}/components.ini" ] &&
 +	    rm -f "${dir}/compatibility.ini" "${dir}/XUL.mfasl"
 +    done
 +fi
 diff -Nru /usr/HEAD/ports/mail/thunderbird/files/patch-mail_app_mozilla.in mail/thunderbird/files/patch-mail_app_mozilla.in
 --- /usr/HEAD/ports/mail/thunderbird/files/patch-mail_app_mozilla.in	Wed Dec 29 04:28:51 2004
 +++ mail/thunderbird/files/patch-mail_app_mozilla.in	Sun Feb 27 11:47:11 2005
 @@ -1,50 +1,482 @@
 ---- mail/app/mozilla.in.orig	Sat Jul 24 19:58:06 2004
 -+++ mail/app/mozilla.in	Mon Dec 27 18:40:04 2004
 -@@ -167,12 +167,12 @@
 - done #others arg
 +--- mail/app/mozilla.in.orig	Sun Jul 25 01:58:06 2004
 ++++ mail/app/mozilla.in	Sun Feb 27 11:46:13 2005
 +@@ -29,51 +29,83 @@
 + ## the mozilla-bin binary to work.
 + ##
   
 - #???: needs check if othersopt begin with -* ?
 ++#
 ++# MOZ_PIS, "Mozilla Plugable Init Scripts"
 ++# MOZ_PIS_ is the name space used
 ++# These variables and there meaning are specified in
 ++# mozilla/xpfe/bootstrap/init.d/README
 + moz_pis_startstop_scripts()
 + {
 +-  MOZ_USER_DIR="%MOZ_USER_DIR%"
 +-  # MOZ_PIS_ is the name space for "Mozilla Plugable Init Scripts"
 +-  # These variables and there meaning are specified in
 +-  # mozilla/xpfe/bootstrap/init.d/README
 +-  MOZ_PIS_API=2
 +-  MOZ_PIS_MOZBINDIR="${dist_bin}"
 +-  MOZ_PIS_SESSION_PID="$$"
 +-  MOZ_PIS_USER_DIR="${MOZ_USER_DIR}"
 +-  export MOZ_PIS_API MOZ_PIS_MOZBINDIR MOZ_PIS_SESSION_PID MOZ_PIS_USER_DIR
 +-  
 +-  case "${1}" in
 +-    "start")
 +-      for curr_pis in "${dist_bin}/init.d"/S* "${HOME}/${MOZ_USER_DIR}/init.d"/S* ; do
 +-        if [ -x "${curr_pis}" ] ; then
 +-          case "${curr_pis}" in
 +-            *.sh) .  "${curr_pis}"         ;;
 +-            *)       "${curr_pis}" "start" ;;
 +-          esac
 +-        fi
 +-      done
 +-      ;;
 +-    "stop")
 +-      for curr_pis in "${HOME}/${MOZ_USER_DIR}/init.d"/K* "${dist_bin}/init.d"/K* ; do
 +-        if [ -x "${curr_pis}" ] ; then
 +-          case "${curr_pis}" in
 +-            *.sh) . "${curr_pis}"        ;;
 +-            *)      "${curr_pis}" "stop" ;;
 +-          esac
 +-        fi
 +-      done
 +-      ;;
 +-    *)
 +-      echo 1>&2 "$0: Internal error in moz_pis_startstop_scripts."
 +-      exit 1
 +-      ;;
 +-  esac
 ++    MOZ_PIS_API=2
 ++    MOZ_PIS_MOZBINDIR="${dist_bin}"
 ++    MOZ_PIS_SESSION_PID="$$"
 ++    MOZ_PIS_USER_DIR="${MOZ_USER_DIR}"
 ++    export MOZ_PIS_API MOZ_PIS_MOZBINDIR MOZ_PIS_SESSION_PID MOZ_PIS_USER_DIR
 ++
 ++    case "${1}" in
 ++	"start")
 ++	    for curr_pis in "${MOZ_PIS_MOZBINDIR}/init.d"/S* \
 ++			    "${HOME}/${MOZ_PIS_USER_DIR}/init.d"/S*; do
 ++		if [ -x "${curr_pis}" ]; then
 ++		    case "${curr_pis}" in
 ++			*.sh)
 ++			    . "${curr_pis}"
 ++			    ;;
 ++			*)
 ++			    ${curr_pis} "start"
 ++			    ;;
 ++		    esac
 ++		fi
 ++	    done
 ++	    ;;
 ++	"stop")
 ++	    for curr_pis in "${MOZ_PIS_MOZBINDIR}/init.d"/K* \
 ++			    "${HOME}/${MOZ_PIS_USER_DIR}/init.d"/K*; do
 ++		if [ -x "${curr_pis}" ]; then
 ++		    case "${curr_pis}" in
 ++			*.sh)
 ++			    . "${curr_pis}"
 ++			    ;;
 ++			*)
 ++			    ${curr_pis} "stop"
 ++			    ;;
 ++		    esac
 ++		fi
 ++	    done
 ++	    ;;
 ++	*)
 ++	    echo "$0: Internal error in moz_pis_startstop_scripts." 1>&2
 ++	    exit 1
 ++	    ;;
 ++    esac
 + }
 + 
 +-#uncomment for debugging
 ++# uncomment for debugging
 + #set -x
 + 
 +-moz_libdir=%MOZAPPDIR%
 +-MRE_HOME=%MREDIR%
 ++#
 ++# variables
 ++#
 ++#location="new-tab"
 ++#MOZILLA_UILOCALE="en-US"
 ++#MOZILLA_UIREGION="US"
 ++
 ++#
 ++# working definitions
 ++#
 ++MOZ_USER_DIR="%MOZ_USER_DIR%"
 ++moz_libdir="%MOZAPPDIR%"
 ++MRE_HOME="%MREDIR%"
 ++
 ++debugging=		# set the debugging level
 ++use_openFile="yes"	# use openFile() for file/dir
 ++here=`pwd`
 ++
 ++if [ ! -d "${MRE_HOME}" ]; then
 ++    # use moz_libdir as MRE_HOME
 ++    MRE_HOME="${moz_libdir}"
 ++fi
 ++export	MRE_HOME
 + 
 + # Use run-mozilla.sh in the current dir if it exists
 + # If not, then start resolving symlinks until we find run-mozilla.sh
 +@@ -82,160 +114,224 @@
 + curdir=`dirname "$progname"`
 + progbase=`basename "$progname"`
 + run_moz="$curdir/run-mozilla.sh"
 +-if test -x "$run_moz"; then
 +-  dist_bin="$curdir"
 +-  found=1
 ++if [ -x "$run_moz" ]; then
 ++    dist_bin="$curdir"
 ++    found=1
 + else
 +-  here=`/bin/pwd`
 +-  while [ -h "$progname" ]; do
 +-    bn=`basename "$progname"`
 +-    cd `dirname "$progname"`
 +-    progname=`/bin/ls -l "$bn" | sed -e 's/^.* -> //' `
 +-    if [ ! -x "$progname" ]; then
 +-      break
 +-    fi
 +-    curdir=`dirname "$progname"`
 +-    run_moz="$curdir/run-mozilla.sh"
 +-    if [ -x "$run_moz" ]; then
 +-      cd "$curdir"
 +-      dist_bin=`pwd`
 +-      found=1
 +-      break
 +-    fi
 +-  done
 +-  cd "$here"
 ++    while [ -h "${progname}" ]; do
 ++	bn=`basename "${progname}"`
 ++	cd `dirname "${progname}"`
 ++	progname=`ls -l "${bn}" | sed -e 's/^.* -> //'`
 ++	if [ ! -x "$progname" ]; then
 ++	    break
 ++	fi
 ++    	curdir=`dirname "${progname}"`
 ++    	run_moz="${curdir}/run-mozilla.sh"
 ++    	if [ -x "${run_moz}" ]; then
 ++	    cd "$curdir"
 ++	    dist_bin=`pwd`
 ++	    run_moz="${dist_bin}/run-mozilla.sh"
 ++	    found=1
 ++	    break
 ++	fi
 ++    done
 ++    cd "${here}"
 + fi
 + if [ $found = 0 ]; then
 +-  # Check default compile-time libdir
 +-  if [ -x "$moz_libdir/run-mozilla.sh" ]; then
 +-    dist_bin="$moz_libdir"
 +-  else 
 +-    echo "Cannot find mozilla runtime directory. Exiting."
 +-    exit 1
 +-  fi
 ++    # Check default compile-time libdir
 ++    if [ -x "${moz_libdir}/run-mozilla.sh" ]; then
 ++	dist_bin="$moz_libdir"
 ++	run_moz="${dist_bin}/run-mozilla.sh"
 ++    else
 ++	echo "$0: Cannot find mozilla runtime directory. Exiting." 1>&2
 ++	exit 1
 ++    fi
 + fi
 + 
 +-script_args=""
 +-moreargs=""
 +-debugging=0
 + MOZILLA_BIN="${progbase}-bin"
 ++if [ "$OSTYPE" = "beos" ]; then
 ++    mimeset -F "$MOZILLA_BIN"
 ++fi
 + 
 +-# The following is to check for a currently running instance.
 +-# This is taken almost verbatim from the Mozilla RPM package's launch script.
 +-MOZ_CLIENT_PROGRAM="$dist_bin/mozilla-xremote-client"
 +-check_running() {
 +-    "${run_moz}" "$MOZ_CLIENT_PROGRAM" -a "${progbase}" 'ping()' 2>/dev/null >/dev/null
 +-    RETURN_VAL=$?
 +-    if [ $RETURN_VAL -eq 0 ]; then
 +-        echo 1
 +-        return 1
 ++# test for binary apps in ${dist_bin}
 ++if [ -x "${dist_bin}/${MOZILLA_BIN}" ]; then
 ++    MOZILLA_BIN="${dist_bin}/${progbase}-bin"
 ++else
 ++    echo "$0: Cannot find mozilla binary executable. Exiting." 1>&2
 ++    exit 1
 ++fi
 ++if [ -x "${dist_bin}/mozilla-xremote-client" ]; then
 ++    MOZ_CLIENT_PROGRAM="${dist_bin}/mozilla-xremote-client -a ${progbase}"
 ++else
 ++    MOZ_CLIENT_PROGRAM="${MOZILLA_BIN} -remote -a ${progbase}"
 ++fi
 ++
 ++# guest a default remote command
 ++_remote_cmd="xfeDoCommand(openInbox)"
 ++
 ++# test for a running copy of firefox
 ++ALREADY_RUNNING=	# null
 ++if [ -n "${DISPLAY}" ]; then
 ++    if [ -n "${debugging}" ]; then
 ++	echo "${run_moz} ${MOZ_CLIENT_PROGRAM} ping()"
 ++	${run_moz} ${MOZ_CLIENT_PROGRAM} 'ping()' && ALREADY_RUNNING="yes"
 +     else
 +-        echo 0
 +-        return 0
 ++	${run_moz} ${MOZ_CLIENT_PROGRAM} 'ping()' >/dev/null 2>&1 &&
 ++		ALREADY_RUNNING="yes"
 +     fi
 +-}
 +-
 +-if [ "$OSTYPE" = "beos" ]; then
 +-  mimeset -F "$MOZILLA_BIN"
 ++elif [ -n "${debugging}" ]; then
 ++    echo "$0: WARN, no DISPLAY environment" 1>&2
 + fi
 + 
 +-ALREADY_RUNNING=`check_running`
 +-
 +-################################################################ Parse Arguments
 +-# If there's a command line argument but it doesn't begin with a -
 +-# it's probably a url.  Try to send it to a running instance.
 +-_USE_EXIST=0
 +-_NEW_WINDOW=
 +-_optOne="$1"
 +-case "${_optOne}" in
 +-	-*) 
 +-		;;
 ++# parse options
 ++script_args=	# null
 ++moreargs=	# null
 ++target=		# null
 ++while [ $# -gt 0 ]
 ++do
 ++    if [ -n "${target}" ]; then
 ++	# well, this can't be the target if not last
 ++	moreargs="${moreargs} ${target}"
 ++	target=	# null
 ++    fi
 ++    case "$1" in
 ++	-p | --pure | -pure)
 ++	    MOZILLA_BIN="${MOZILLA_BIN}.pure"
 ++	    shift
 ++	    ;;
 ++	-g | --debug)
 ++	    script_args="${script_args} -g"
 ++	    debugging=1
 ++	    shift
 ++	    ;;
 ++	-d | --debugger)
 ++	    if [ -n "$2" ]; then
 ++		script_args="${script_args} -d $2"
 ++		shift 2
 ++	    else
 ++		"$0: ERROR, -d needs an argument. Exiting" 1>&2
 ++		exit 1
 ++	    fi
 ++	    ;;
 ++	-UILocale)
 ++	    if [ -n "$2" ]; then
 ++		uilocale="$2"
 ++		shift 2
 ++	    else
 ++		echo "$0: ERROR, -UILocale needs an argument. Exiting" 1>&2
 ++		exit 1
 ++	    fi
 ++	    ;;
 ++	-UIRegion)
 ++	    if [ -n "$2" ]; then
 ++		uiregion="$2"
 ++		shift 2
 ++	    else
 ++		echo "$0: ERROR, -UIRegion needs an argument. Exiting" 1>&2
 ++		exit 1
 ++	    fi
 ++	    ;;
 ++	-browser)
 ++	    _remote_cmd="xfeDoCommand(openBrowser)"
 ++	    moreargs="${moreargs} $1"
 ++	    shift
 ++	    ;;
 ++	-mail)
 ++	    _remote_cmd="xfeDoCommand(openInbox)"
 ++	    moreargs="${moreargs} $1"
 ++	    shift
 ++	    ;;
 ++	-compose)
 ++	    _remote_cmd="xfeDoCommand(composeMessage)"
 ++	    moreargs="${moreargs} $1"
 ++	    shift
 ++	    ;;
 ++	-chat | -edit | -webcal)
 ++	    # don't use remote for this
 ++	    ALREADY_RUNNING=	# null
 ++	    moreargs="${moreargs} $1"
 ++	    shift
 ++	    ;;
 ++	-*)
 ++	    moreargs="${moreargs} $1"
 ++	    shift
 ++	    ;;
 + 	*)
 +-		_USE_EXIST=1
 +-		;;
 +-esac
 +-
 +-_optOthers=
 +-_optLast=
 +-for i in "$@"; do 
 +-	_optLast="${i}"
 +-done #last arg
 +-
 +-for i in "$@"; do
 +-	[ $i = ${_optLast} ] && break
 +-	_optOthers="${_optOthers} ${i}"
 +-done #others arg
 +-
 +-#???: needs check if othersopt begin with -* ?
  -if [ `expr "${_optLast}" : '.*:/.*'` -eq 0 -a \( -f "${_optLast}" -o -d "${_optLast}" \) ]; then
 -+if [ `expr X"${_optLast}" : 'X.*:/.*'` -eq 0 -a \( -f "${_optLast}" -o -d "${_optLast}" \) ]; then
 - 	# Last argument seems to be a local file/directory
 - 	# Check, if it is absolutely specified (ie. /home/foo/file vs. ./file)
 - 	# If it is just "relatively" (./file) specified, make it absolutely
 +-	# Last argument seems to be a local file/directory
 +-	# Check, if it is absolutely specified (ie. /home/foo/file vs. ./file)
 +-	# If it is just "relatively" (./file) specified, make it absolutely
  -	[ `expr "${_optLast}" : '/.*'` -eq 0 ] && _optLast="file://`pwd`/${_optLast}"
  -elif [ `expr "${_optLast}" : '.*:/.*'` -gt 0 -o -n "${_optOthers}" ]; then #???? like before...
 -+	[ `expr X"${_optLast}" : 'X/.*'` -eq 0 ] && _optLast="file://`pwd`/${_optLast}"
 -+elif [ `expr X"${_optLast}" : 'X.*:/.*'` -gt 0 -o -n "${_optOthers}" ]; then #???? like before...
 - 	_NEW_WINDOW=1
 +-	_NEW_WINDOW=1
 +-fi
 +-################################################################ Parse Arguments
 +-
 +-########################################################################### Main
 +-if [ $ALREADY_RUNNING -eq 1 ]; then
 +-	# There's an instance already running. Use it.
 +-	# Any command line args passed in?
 +-	if [ $# -gt 0 ]; then
 +-		# There were "some" command line args.
 +-		if [ ${_USE_EXIST} -eq 1 ]; then
 +-			# We should use an existing instance, as _USE_EXIST=$_USE_EXIST=-1
 +-			_open_type="window"
 +-			#_open_type="tab"
 +-			_remote_cmd="openURL(${_optLast} , new-${_open_type})"
 +-			"${run_moz}" "$MOZ_CLIENT_PROGRAM" -a "${progbase}" "${_remote_cmd}"
 +-			unset _remote_cmd _open_type
 +-			exit $?
 +-		fi
 ++	    target="$1"
 ++	    shift
 ++	    ;;
 ++    esac
 ++done
 ++
 ++# process target
 ++if [ -n "${target}" ]; then
 ++    if [ `expr "${target}" : '.*:.*'` -eq 0 ]; then
 ++	if [ `expr "${target}" : '/.*'` -eq 0 ]; then
 ++	    target="${here}/${target}"
 ++	fi
 ++	if [ -r "${target}" -o -d "${target}" ]; then
 ++	    [ -n "${use_openFile}" ] || target="file://${target}"
 + 	else
 +-		# No command line args. Open new window/tab
 +-		#exec "${run_moz}" "$MOZ_CLIENT_PROGRAM" -a "${progbase}" "xfeDoCommand(openBrowser)"
 +-		"${run_moz}" "$MOZ_CLIENT_PROGRAM" -a "${progbase}" "xfeDoCommand(openInbox)"
 +-		exit $?
 ++	    echo "$0: WARN, target: ${target} not an URI/file/dir" 1>&2
 ++	    ALREADY_RUNNING=	# null
 + 	fi
 ++    else
 ++	# an former URI, don't use openFile
 ++	use_openFile=	# null
 ++    fi
   fi
 - ################################################################ Parse Arguments
 -@@ -218,12 +218,31 @@
 -       script_args="$script_args -d $2"
 -       shift 2
 -       ;;
 -+    -UILocale)
 -+      moreargs="$moreargs -UILocale $2"
 -+      _done_locale="YES"
 -+      shift 2
 -+      ;;
 -+    -UIRegion)
 -+      if [ -n "${_done_locale}" ]; then
 -+        moreargs="$moreargs -UIRegion $2"
 -+      fi
 -+      shift 2
 -+      ;;
 -     *)
 -       moreargs="$moreargs \"$1\""
 -       shift 1
 -       ;;
 -   esac
 - done
 -+
 -+if [ ! -n "${_done_locale}" -a -n "${MOZILLA_UILOCALE}" ]; then
 -+    moreargs="$moreargs -UILocale ${MOZILLA_UILOCALE}"
 -+    if [ -n "${MOZILLA_UIREGION}" ]; then
 -+      moreargs="$moreargs -UIRegion ${MOZILLA_UIREGION}"
 +-# Default action - no running instance or _USE_EXIST (${_USE_EXIST}) ! -eq 1
 +-########################################################################### Main
 + 
 +-while [ $# -gt 0 ]
 +-do
 +-  case "$1" in
 +-    -p | --pure | -pure)
 +-      MOZILLA_BIN="${MOZILLA_BIN}.pure"
 +-      shift
 +-      ;;
 +-    -g | --debug)
 +-      script_args="$script_args -g"
 +-      debugging=1
 +-      shift
 +-      ;;
 +-    -d | --debugger)
 +-      script_args="$script_args -d $2"
 +-      shift 2
 +-      ;;
 +-    *)
 +-      moreargs="$moreargs \"$1\""
 +-      shift 1
 +-      ;;
 +-  esac
 +-done
 ++# try remote protocol if running
 ++if [ -n "${ALREADY_RUNNING}" ]; then
 ++    if [ -n "${target}" ]; then
 ++	if [ -n "${use_openFile}" ]; then
 ++	    _remote_cmd="openFile(${target})"
 ++	elif [ -n "${location}" ]; then
 ++	    _remote_cmd="openURL(${target},${location})"
 ++	else
 ++	    _remote_cmd="openURL(${target})"
 ++	fi
 ++    fi
 ++    # FIXME problems with freedesktop StartupNotify
 ++    if [ -n "${debugging}" ]; then
 ++	echo "${run_moz} ${script_args} ${MOZ_CLIENT_PROGRAM} ${_remote_cmd}"
 ++    fi
 ++    ${run_moz} ${script_args} ${MOZ_CLIENT_PROGRAM} ${_remote_cmd} && exit 0
 ++fi
 ++
 ++# fallback to direct invocation
 ++
 ++# UILocale, UIRegion
 ++if [ -z "${uilocale}" -a -n "${MOZILLA_UILOCALE}" ]; then
 ++    uilocale="${MOZILLA_UILOCALE}"
 ++fi
 ++if [ -z "${uiregion}" -a -n "${MOZILLA_UIREGION}" ]; then
 ++    uiregion="${MOZILLA_UIREGION}"
 ++fi
 ++if [ -n "${uiregion}" -a -z "${uilocale}" ]; then
 ++    uilocale="en-US"
 ++fi
 ++if [ -n "${uilocale}" ]; then
 ++    if [ -n "${uiregion}" ]; then
 ++	moreargs="-UIRegion ${uiregion} ${more_args}"
  +    fi
 ++    moreargs="-UILocale ${uilocale} ${more_args}"
  +fi
 -+unset _done_locale
   
 - export MRE_HOME
 - eval "set -- $moreargs"
 +-export MRE_HOME
 +-eval "set -- $moreargs"
 ++# real invocation
 ++if [ -n "${target}" ]; then
 ++    eval "set -- ${moreargs} \"${target}\""
 ++else
 ++    eval "set -- ${moreargs}"
 ++fi
 + 
 + ## Start addon scripts
 + moz_pis_startstop_scripts "start"
 + 
 +-if [ $debugging = 1 ]
 +-then
 +-  echo $dist_bin/run-mozilla.sh $script_args $dist_bin/$MOZILLA_BIN "$@"
 ++if [ -n "${debugging}" ]; then
 ++    echo "${run_moz} ${script_args} ${MOZILLA_BIN} $@"
 + fi
 +-"$dist_bin/run-mozilla.sh" $script_args "$dist_bin/$MOZILLA_BIN" "$@"
 ++${run_moz} ${script_args} ${MOZILLA_BIN} "$@"
 + exitcode=$?
 + 
 + ## Stop addon scripts
 diff -Nru /usr/HEAD/ports/mail/thunderbird/files/patch-uriloader_exthandler_unix_nsGNOMERegistry.cpp mail/thunderbird/files/patch-uriloader_exthandler_unix_nsGNOMERegistry.cpp
 --- /usr/HEAD/ports/mail/thunderbird/files/patch-uriloader_exthandler_unix_nsGNOMERegistry.cpp	Thu Jan  1 01:00:00 1970
 +++ mail/thunderbird/files/patch-uriloader_exthandler_unix_nsGNOMERegistry.cpp	Sun Feb 27 11:50:05 2005
 @@ -0,0 +1,29 @@
 +--- uriloader/exthandler/unix/nsGNOMERegistry.cpp.orig	Fri Dec 24 04:30:00 2004
 ++++ uriloader/exthandler/unix/nsGNOMERegistry.cpp	Fri Dec 24 04:34:05 2004
 +@@ -143,7 +143,7 @@
 +     PR_END_MACRO
 + 
 +   // Attempt to open libgconf
 +-  gconfLib = LoadVersionedLibrary("gconf-2", ".4");
 ++  gconfLib = PR_LoadLibrary("libgconf-2.so");
 +   ENSURE_LIB(gconfLib);
 + 
 +   GET_LIB_FUNCTION(gconf, gconf_client_get_default);
 +@@ -151,7 +151,7 @@
 +   GET_LIB_FUNCTION(gconf, gconf_client_get_bool);
 + 
 +   // Attempt to open libgnome
 +-  gnomeLib = LoadVersionedLibrary("gnome-2", ".0");
 ++  gnomeLib = PR_LoadLibrary("libgnome-2.so");
 +   ENSURE_LIB(gnomeLib);
 + 
 +   GET_LIB_FUNCTION(gnome, gnome_url_show);
 +@@ -160,7 +160,7 @@
 +   GET_LIB_FUNCTION(gnome, gnome_program_get);
 + 
 +   // Attempt to open libgnomevfs
 +-  vfsLib = LoadVersionedLibrary("gnomevfs-2", ".0");
 ++  vfsLib = PR_LoadLibrary("libgnomevfs-2.so");
 +   ENSURE_LIB(vfsLib);
 + 
 +   GET_LIB_FUNCTION(vfs, gnome_vfs_mime_type_from_name);
 diff -Nru /usr/HEAD/ports/mail/thunderbird/files/thunderbird.desktop.in mail/thunderbird/files/thunderbird.desktop.in
 --- /usr/HEAD/ports/mail/thunderbird/files/thunderbird.desktop.in	Mon Dec 13 01:04:24 2004
 +++ mail/thunderbird/files/thunderbird.desktop.in	Sun Feb 27 11:50:28 2005
 @@ -1,9 +1,87 @@
  [Desktop Entry]
 +Encoding=UTF-8
  Name=Thunderbird
 +Name[bn]=থাণ~Mডারবার~Mড
 +Name[eo]=Mozilo Tondrobirdo
 +Name[fi]=Mozilla Thunderbird
 +Name[pa]=ਥੰਡਰਬਰਡ
 +Name[tg]=~_а~@~@андаи бало
 +GenericName=Mail Client
 +GenericName[af]=Pos Kliënt
 +GenericName[ar]=ا~Dبر~Jد ا~Dأ~D~Cتر~H~F~J
 +GenericName[az]=Poçt Alıcısı
 +GenericName[be]=~_а~H~Bов~K кл~Vен~B
 +GenericName[bg]=~_о~Iен~Aки клиен~B
 +GenericName[bn]=~Gম~G~Gল ~U~Mলা~_~Gন~M~_
 +GenericName[br]=Arval postel
 +GenericName[bs]=Program za ~Mitanje elektronske pošte
 +GenericName[ca]=Client de correu electrònic
 +GenericName[cs]=Klient pro ~Mtení elektronické pošty
 +GenericName[cy]=Dibynnydd Ebost
 +GenericName[da]=E-mail-klient
 +GenericName[de]=E-Mail-Programm
 +GenericName[el]=| ελά~Dη~B mail
 +GenericName[eo]=Legi kaj sendi retpo~]ton
 +GenericName[es]=Cliente de correo electrónico
 +GenericName[et]=Meiliklient
 +GenericName[eu]=Posta bezeroa
 +GenericName[fa]=کارگ~Lر پست ا~Dکتر~H~F~Lک~L
 +GenericName[fi]=Sähköpostiohjelma
 +GenericName[fo]=Postforrit
 +GenericName[fr]=Logiciel de messagerie électronique
 +GenericName[ga]=Cliant Ríomhphoist
 +GenericName[gl]=Cliente de correo
 +GenericName[he]=ת~U~[| ~Yת ~S~U~Pר
 +GenericName[hi]=डा~Uिया
 +GenericName[hr]=Program za ~Mitanje elektronske pošte
 +GenericName[hu]=Levelez~Qprogram
 +GenericName[id]=Klien Mail
 +GenericName[is]=Póstforrit
 +GenericName[it]=Programma di posta elettronica
 +GenericName[ja]=~C~C~C~B~C~B~B~C~C~H
 +GenericName[ko]=~N~@를 주|  ~[~J~T ~T~D~\그~^
 +GenericName[lt]=Pašto klientas
 +GenericName[lo]=~D~D~A~@ອັ~Y~Hົ~Tຫມາ~M~@ອ~@ລັ~A~B~U~Yິ~A
 +GenericName[lv]=Pasta Klients
 +GenericName[mk]=~_~@ог~@ама за елек~B~@он~Aка по~H~Bа
 +GenericName[mn]=Э-~Wа~Eиа-~_~@ог~@ам
 +GenericName[mt]=Klijent tal-imejl
 +GenericName[nb]=E-postklient
 +GenericName[nds]=Mailprogramm
 +GenericName[nl]=E-mailclient
 +GenericName[nn]=Lesing og sending av e-post
 +GenericName[nso]=Moreki wa Poso
 +GenericName[oc]=Programari de correu electrònic
 +GenericName[pa]=ਪੱਤਰ ~Uਲਾ~B~G~_
 +GenericName[pl]=Program do wysy~Bania i odbierania poczty elektronicznej
 +GenericName[pt]=Client de E-mail
 +GenericName[pt_BR]=Cliente de E-mail
 +GenericName[ro]=Program de po~_t~C electronic~C
 +GenericName[ru]=~Zлиен~B ~Mлек~B~@онной по~G~B~K
 +GenericName[se]=Boastaprográmma
 +GenericName[sk]=Klient elektronickej pošty
 +GenericName[sl]=Program za e-pošto
 +GenericName[sr]=~_~@ог~@ам за e-по~H~B~C
 +GenericName[sr@Latn]=Program za e-poštu
 +GenericName[ss]=Likhasimende leliposi
 +GenericName[sv]=E-postklient
 +GenericName[ta]=~E~^~M~Zல~M ~Iற~Aப~Mபினர~M
 +GenericName[tg]=~Zо~@ги~@и по~G~Bаи ~Mллек~B~@оникӣ
 +GenericName[th]=~D~Dล~@อ~Y~U~L~H~Tหมายอิ~@ล~G~A~Wรอ~Yิ~Aส~L
 +GenericName[tr]=Posta İstemcisi
 +GenericName[uk]=~Zл~V~Tн~B елек~B~@онно~W по~H~Bи
 +GenericName[uz]=Ха~B-~Eаба~@ клиен~Bи
 +GenericName[ven]=Mushumisani na poso
 +GenericName[wa]=Cliyint d'| emilaedje
 +GenericName[xh]=Umxhasi Weposi
 +GenericName[zh_CN]=~B件~K~O
 +GenericName[zh_TW]=~C件~Y~U~P~F~K~O
 +GenericName[zu]=Umxhasi weposi
  Comment=Mail client and News Reader
 -Exec=thunderbird
 +Comment[es]=Cliente de correo y lector de noticias
 +Exec=thunderbird %U
  Icon=@THUNDERBIRD_ICON@
 +StartupNotify=false
  Terminal=false
  Type=Application
  Categories=Application;Network;
 -Encoding=UTF-8
 --- thunderbird-patch ends here ---
State-Changed-From-To: open->patched 
State-Changed-By: marcus 
State-Changed-When: Tue Mar 22 22:26:30 GMT 2005 
State-Changed-Why:  
The port has been updated to 1.0.2 in the MarcusCom ports-stable repository, 
and these patches have also been merged.  They will be committed to the ports 
tree after the freeze. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=75837 
State-Changed-From-To: patched->closed 
State-Changed-By: marcus 
State-Changed-When: Fri Mar 25 06:09:11 GMT 2005 
State-Changed-Why:  
Committed except for the i18n additions to the desktop file since many were 
not valid UTF. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=75837 
>Unformatted:
