[PATCH] www/mozilla: New mozilla.sh and pkg scripts

Jose M Rodriguez (freebsd) josemi at freebsd.jazztel.es
Sun Jan 2 23:15:11 GMT 2005


>Submitter-Id:	current-users
>Originator:	Jose M Rodriguez (freebsd)
>Organization:	Redes JM
>Confidential:	no 
>Synopsis:	[PATCH] www/mozilla: New mozilla.sh and pkg scripts
>Severity:	non-critical
>Priority:	low
>Category:	ports 
>Class:		change-request
>Release:	FreeBSD 5.3-STABLE i386
>Environment:
System: FreeBSD orion.redesjm.local 5.3-STABLE FreeBSD 5.3-STABLE #0: Wed Dec 29 19:50:11 CET 2004
>Description:
	- patch xpfe/bootstrap/mozilla.in to work with the new
	  firefox/mozilla/thunderbird script

	  I'll try to merge this script mainstream after approval

	- install all scripts under $MOZDIR, and use pkg scripts to
	  generate $pefix/bin related entries

	- move browser-plugings works, included JPI, to pkg scripts
	  and don't pollute pkg-plist with this

	- add support for MOZ_PIS scripts

	- add support for KDE via artsdsp


Added file(s):
- files/moz_pis_S90dsp.sh
- files/patch-xpfe_bootstrap_mozilla.in

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

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

--- mozilla-1.7.5_2,2.patch begins here ---
diff -ruN --exclude=CVS /usr/HEAD/ports/www/mozilla/Makefile /junk/wk/www/mozilla/Makefile
--- /usr/HEAD/ports/www/mozilla/Makefile	Sun Dec 26 17:08:52 2004
+++ /junk/wk/www/mozilla/Makefile	Sun Jan  2 23:59:43 2005
@@ -7,7 +7,7 @@
 
 PORTNAME?=	mozilla
 PORTVERSION=	1.7.5
-PORTREVISION?=	1
+PORTREVISION?=	2
 PORTEPOCH?=	2
 CATEGORIES?=	www
 MASTER_SITES=	${MASTER_SITE_MOZILLA} \
@@ -99,6 +99,7 @@
 	${LOCALBASE}/jdk1.4.1/jre/plugin/${ARCH}/ns610/libjavaplugin_oji.so \
 	${LOCALBASE}/diablo-jdk1.3.1/jre/plugin/${ARCH}/ns600/libjavaplugin_oji.so \
 	${LOCALBASE}/jdk1.3.1/jre/plugin/${ARCH}/ns600/libjavaplugin_oji.so
+MOZ_PIS_SCRIPTS=
 
 OPTIONS=XFT "Enable Xft font anti-aliasing" on \
 	CALENDAR "Enable the Calendar module" off \
@@ -111,7 +112,8 @@
 	JAVASCRIPT_DEBUGGER "Enable the DTD and JavaScript debuggers" off \
 	OPTIMIZED_CFLAGS "Enable -O2 optimizations" off \
 	SMB "Enable smb:// URI support using gnomevfs" off \
-	MENU_ENTRY "Add mozilla to the GNOME menu" on
+	MENU_ENTRY "Add mozilla to the GNOME menu" on \
+	ARTSDSP "Add support for KDE arts (artsdsp)" on
 
 .include <bsd.port.pre.mk>
 
@@ -210,6 +212,10 @@
 CONFIGURE_ARGS+=	--enable-optimize=-O2
 .endif
 
+.if defined(WITH_ARTSDSP)
+MOZ_PIS_SCRIPTS+=S90dsp.sh
+.endif
+
 .if ${ARCH} == "alpha" && ${OSVERSION} < 500035
 IGNORE=	"core dumps on alpha during post-build"
 .endif
@@ -261,10 +267,14 @@
 			s|mozilla-nspr|mozilla-nspr${MOZ_SUFX}${PKGNAMESUFFIX}|g' \
 			${WRKSRC}/build/unix/$${pcfile}.pc.in; \
 	done
-	@${SED} -e 's|%%MOZDIR%%|${PREFIX}/lib/${MOZILLA}|g ; \
-		s|%%PREFIX%%|${PREFIX}|g' \
+	@${SED} -e 's|%%MOZILLA%%|${MOZILLA}|g ; \
+		s|%%PREFIX%%|${PREFIX}|g ; \
+		s|%%X11BASE%%|${X11BASE}|g ; \
+		s|%%JPI_LIST%%|${JPI_LIST}|g' \
 		< ${MASTERDIR}/pkg-install.in > ${PKGINSTALL}
-	@${SED} -e 's|%%MOZDIR%%|${PREFIX}/lib/${MOZILLA}|g' \
+	@${SED} -e 's|%%MOZILLA%%|${MOZILLA}|g ; \
+		s|%%PREFIX%%|${PREFIX}|g ; \
+		s|%%X11BASE%%|${X11BASE}|g' \
 		< ${MASTERDIR}/pkg-deinstall.in > ${PKGDEINSTALL}
 	@${SED} -e 's|%%PREFIX%%|${PREFIX}|g' \
 		< ${FILESDIR}/mozilla.desktop.in > \
@@ -276,10 +286,6 @@
 		${FALSE}; \
 	fi
 
-post-build:
-	${SED} -e "s|%%PREFIX%%|${PREFIX}|g" -e "s|%%MOZILLA%%|${MOZILLA}|g" \
-		${FILESDIR}/mozilla.sh >${WRKSRC}/${MOZILLA}
-
 pre-install:
 	${RM} -rf ${FAKEDIR} ${PLIST}
 	${TOUCH} -f ${PLIST}
@@ -288,22 +294,6 @@
 	${REINPLACE_CMD} -e 's|${FAKEDIR}|${PREFIX}|g' \
 		${FAKEDIR}/bin/mozilla \
 		${FAKEDIR}/bin/mozilla-config
-	if [ ! -x ${PREFIX}/bin/mozilla -a ! -L ${PREFIX}/bin/mozilla ]; then \
-		${ECHO_CMD} bin/mozilla >> ${PLIST} ; \
-	fi
-	if [ "${MOZILLA}" != "mozilla" ]; then \
-		${ECHO_CMD} bin/${MOZILLA} >> ${PLIST} ; \
-	fi
-	if [ ! -L ${PREFIX}/lib/browser_plugins/libjavaplugin_oji.so ]; then \
-		for jpi in ${JPI_LIST}; do \
-			if [ -f $${jpi} ]; then \
-				${ECHO_CMD} lib/browser_plugins/libjavaplugin_oji.so >> ${PLIST} ; \
-				break; \
-			fi; \
-		done; \
-	fi
-	${ECHO_CMD} lib/browser_plugins/.${PORTNAME}.keep >> ${PLIST}
-	${ECHO_CMD} "@unexec ${RMDIR} %D/lib/browser_plugins 2>/dev/null || ${TRUE}" >> ${PLIST}
 	${ECHO_CMD} lib/${MOZILLA}/mozilla >> ${PLIST}
 	${ECHO_CMD} lib/${MOZILLA}/mozilla-config >> ${PLIST}
 .if !defined(WITHOUT_MAILNEWS)
@@ -312,6 +302,10 @@
 .if defined(WITH_MENU_ENTRY)
 	${ECHO_CMD} share/gnome/applications/mozilla.desktop >> ${PLIST}
 .endif
+.for ii in ${MOZ_PIS_SCRIPTS}
+	${INSTALL_SCRIPT} ${FILESDIR}/moz_pis_${ii} \
+	${FAKEDIR}/lib/${MOZILLA}/init.d/${ii}
+.endfor
 	cd ${FAKEDIR}/lib/${MOZILLA} && ${FIND} -s * -type f -o -type l | \
 		${SED} -e 's:^:lib/${MOZILLA}/:' >> ${PLIST} \
 			&& ${FIND} -d * -type d | \
@@ -333,23 +327,6 @@
 	${INSTALL_SCRIPT} ${FAKEDIR}/bin/mozilla-config ${PREFIX}/lib/${MOZILLA}
 	cd ${FAKEDIR}/lib/${MOZILLA} && ${FIND} . | \
 		${CPIO} -pdm -L -R ${LIBOWN}:${LIBGRP} ${PREFIX}/lib/${MOZILLA}
-	${INSTALL_SCRIPT} ${WRKSRC}/${MOZILLA} ${PREFIX}/bin
-	if [ ! -x ${PREFIX}/bin/mozilla -a ! -L ${PREFIX}/bin/mozilla ]; then \
-		${LN} -sf ${PREFIX}/bin/${MOZILLA} ${PREFIX}/bin/mozilla ; \
-	fi
-	if [ ! -d ${PREFIX}/lib/browser_plugins ]; then \
-		${MKDIR} ${PREFIX}/lib/browser_plugins ; \
-	fi
-	${TOUCH} -f ${PREFIX}/lib/browser_plugins/.${PORTNAME}.keep
-	if [ ! -L ${PREFIX}/lib/browser_plugins/libjavaplugin_oji.so ]; then \
-		for jpi in ${JPI_LIST}; do \
-			if [ -f $${jpi} ]; then \
-		    		${LN} -sf $${jpi} \
-			    		${PREFIX}/lib/browser_plugins/libjavaplugin_oji.so ; \
-				break; \
-			fi; \
-		done; \
-	fi
 	for pcfile in ${PKGCONFIG_FILES}; do \
 		${REINPLACE_CMD} -e 's|${FAKEDIR}|${PREFIX}|g' \
 			${WRKSRC}/build/unix/$${pcfile}.pc; \
diff -ruN --exclude=CVS /usr/HEAD/ports/www/mozilla/files/moz_pis_S90dsp.sh /junk/wk/www/mozilla/files/moz_pis_S90dsp.sh
--- /usr/HEAD/ports/www/mozilla/files/moz_pis_S90dsp.sh	Thu Jan  1 01:00:00 1970
+++ /junk/wk/www/mozilla/files/moz_pis_S90dsp.sh	Mon Jan  3 00:05:31 2005
@@ -0,0 +1,33 @@
+#!/bin/sh
+#
+
+# S90dsp.sh
+# dsp aids for mozilla
+# WARN, this is sourced in the main mozilla.sh scrpit.  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/www/mozilla/files/mozilla.sh /junk/wk/www/mozilla/files/mozilla.sh
--- /usr/HEAD/ports/www/mozilla/files/mozilla.sh	Sun Dec 26 17:08:52 2004
+++ /junk/wk/www/mozilla/files/mozilla.sh	Sun Jan  2 17:25:19 2005
@@ -1,85 +1,362 @@
 #!/bin/sh
+#
+# The contents of this file are subject to the Netscape Public License
+# Version 1.0 (the "NPL"); you may not use this file except in
+# compliance with the NPL.  You may obtain a copy of the NPL at
+# http://www.mozilla.org/NPL/
+#
+# Software distributed under the NPL is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+# for the specific language governing rights and limitations under the
+# NPL.
+#
+# The Initial Developer of this code under the NPL is Netscape
+# Communications Corporation.  Portions created by Netscape are
+# Copyright (C) 1998 Netscape Communications Corporation.  All Rights
+# Reserved.
+#
 
-MOZILLA_DIR="%%PREFIX%%/lib/%%MOZILLA%%"
-MOZILLA_EXEC="./mozilla"
-MOZILLA_REMOTE_EXEC="${MOZILLA_EXEC} -remote"
-APPLICATION_ID="mozilla"
+# $from: mozilla.in,v 1.3.4.9 2004/10/26 09:26:11 bryner%brianryner.com Exp $
 
-LOCATION='new-tab'
+#
+# Usage:
+#
+#	$ mozilla [args]
+#
+# The script will setup all the environment voodoo needed to make
+# the mozilla-bin binary to work.
+#
+
+#uncomment for debugging
+#set -x
+
+#
+# variables
+#
+location="new-tab"
 #MOZILLA_UILOCALE="en-US"
 #MOZILLA_UIREGION="US"
-#MOZILLA_DSP="auto"
 
-cd $MOZILLA_DIR                                     || exit 1
+#
+# working definitions
+#
+MOZ_USER_DIR=".mozilla"
+moz_libdir="%%PREFIX%%/lib/%%MOZILLA%%"
+MOZILLA_BIN="mozilla-bin"
+
+debugging=		# set the debugging level
+use_openFile="yes"	# use openfile for file/dir
+here=`pwd`
 
-# LANG, MOZILLA_UILOCALE, MOZILLA_UIREGION
-if [ -n "$LANG" -a ! -n "${MOZILLA_UILOCALE}" ]; then
-    _locale="${LANG%%.*}"
-    if [ "${_locale}" != "en_US" -a "${_locale}" != "C" ]; then
-	_region="${_locale##*_}"
-	_locale="${_locale%_*}"
-	[ -r chrome/${_locale}-${_region}.jar ] && \
-	    MOZILLA_EXEC="${MOZILLA_EXEC} -UILocale ${_locale}-${_region}"
-    fi
-elif [ -n "${MOZILLA_UILOCALE}" ]; then
-    MOZILLA_EXEC="${MOZILLA_EXEC} -UILocale ${MOZILLA_UILOCALE}"
-    if [ -n "${MOZILLA_UIREGION}" ]; then
-	MOZILLA_EXEC="${MOZILLA_EXEC} -UIRegion ${MOZILLA_UIREGION}"
+# obey the predefined MRE_HOME (not in the original script)
+if [ -z "${MRE_HOME}" -o ! -d "${MRE_HOME}" ]; then
+    # Try our complied default
+    MRE_HOME="%%PREFIX%%/lib/mre/mre-1.7.5"
+    if [ ! -d "${MRE_HOME}" ]; then
+	# use moz_libdir as MRE_HOME
+	MRE_HOME="${moz_libdir}"
     fi
 fi
+export	MRE_HOME
 
-# find a /dev/dsp handler
-case "${MOZILLA_DSP}" in
-#    [Ee][Ss][Dd]|esddsp) # Use the esd dsp wrapper
-#	MOZILLA_DSP="esddsp"
-#	;;
-    [Aa][Rr][Tt][Ss]|artsdsp) # Use the arts dsp wrapper
-	MOZILLA_DSP="artsdsp"
-	;;
-    [Nn][Oo][Nn][Ee]) # Direct dsp output
-	MOZILLA_DSP=""
-	;;
-    *) # Guest one (auto)
-	if [ -n "${KDE_FULL_SESSION}" ]; then
-		MOZILLA_DSP="artsdsp"
-#	elif [ -r ${HOME}/.esd_auth ]; then
-#		MOZILLA_DSP="esddsp"
-	else
-		MOZILLA_DSP=""
+if [ "$OSTYPE" = "beos" ]; then
+    mimeset -F "$MOZILLA_BIN"
+fi
+
+#
+# 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_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
+}
+
+#
+# Search for a valid mozilla bind-dist
+# Use run-mozilla.sh in the current dir if it exists
+# If not, then start resolving symlinks until we find run-mozilla.sh
+found=0
+progname="$0"
+curdir=`dirname "${progname}"`
+progbase=`basename "${progname}"`
+run_moz="${curdir}/run-mozilla.sh"
+# Check for $MOZILLA_FIVE_HOME if present
+if [ -n "${MOZILLA_FIVE_HOME}" -a \
+     -x "${MOZILLA_FIVE_HOME}/run-mozilla.sh" ]; then
+    dist_bin="${MOZILLA_FIVE_HOME}"
+    run_moz="${dist_bin}/run-mozilla.sh"
+elif [ -x "${run_moz}" ]; then
+    dist_bin="${curdir}"
+    found=1
+else
+    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
-	;;
-esac
+    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}"
+	run_moz="${dist_bin}/run-mozilla.sh"
+    else
+	echo "$0: Cannot find mozilla runtime directory. Exiting." 1>&2
+	exit 1
+    fi
+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
+
+#
+# guest a default remote command
+_remote_cmd="xfeDoCommand(openBrowser)"
+
+#
+# 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
+	${run_moz_remote} ${MOZ_CLIENT_PROGRAM} 'ping()' >/dev/null 2>&1 &&
+		ALREADY_RUNNING="yes"
+    fi
+elif [ -n "${debugging}" ]; then
+    echo "$0: WARN, no DISPLAY environment" 1>&2
+fi
+
+#
+# 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
+	    ;;
+	# teak next extries for browser/mailapp/suite ?
+	-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
+	    ;;
+	*)
+	    target="$1"
+	    shift
+	    ;;
+    esac
+done
 
-if [ -n "${MOZILLA_DSP}" ] && type "${MOZILLA_DSP}" > /dev/null 2>&1; then
-	MOZILLA_EXEC="${MOZILLA_DSP} ${MOZILLA_EXEC}"
+#
+# 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
+	    echo "$0: WARN, target: ${target} not an URI/file/dir" 1>&2
+	    ALREADY_RUNNING=	# null
+	fi
+    else
+	use_openFile=	# null
+    fi
 fi
 
-case $1 in
-    -browser)
-    	REMOTE_COMMAND="xfeDoCommand (openBrowser)"
-	;;
-    -mail)
-    	REMOTE_COMMAND="xfeDoCommand (openInbox)"
-	;;
-    -compose)
-    	REMOTE_COMMAND="xfeDoCommand (composeMessage)"
-	;;
-    -*)
-    	exec ${MOZILLA_EXEC} "$@"
-	;;
-    *)
-	if [ -n "${LOCATION}" ]; then
-    		REMOTE_COMMAND="openURL($@,$LOCATION)"
+#
+# 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_COMMAND="openURL($@)"
+	    _remote_cmd="openURL(${target})"
 	fi
-	;;
-esac
+    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
 
-# process found
-${MOZILLA_REMOTE_EXEC} "ping()" >/dev/null 2>&1     &&
-${MOZILLA_REMOTE_EXEC} "${REMOTE_COMMAND}"          && exit 0
+#
+# 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 "${moz_uilocale}" ]; then
+    if [ -n "${moz_uiregion}" ]; then
+	moreargs="-UIRegion ${moz_uiregion} ${more_args}"
+    fi
+    moreargs="-UILocale ${moz_uilocale} ${more_args}"
+fi
+
+#
+# real invocation
+if [ -n "${target}" ]; then
+    eval "set -- ${moreargs} \"${target}\""
+else
+    eval "set -- ${moreargs}"
+fi
+
+## Start addon scripts
+moz_pis_startstop_scripts "start"
+
+if [ -n "${debugging}" ]; then
+    echo "${run_moz} ${script_args} ${MOZILLA_BIN} $@"
+fi
+${run_moz} ${script_args} ${MOZILLA_BIN} "$@"
+exitcode=$?
 
-# no existing process
-exec ${MOZILLA_EXEC} "$@"
+## Stop addon scripts
+moz_pis_startstop_scripts "stop"
 
+exit $exitcode
+# EOF
diff -ruN --exclude=CVS /usr/HEAD/ports/www/mozilla/files/patch-xpfe_bootstrap_mozilla.in /junk/wk/www/mozilla/files/patch-xpfe_bootstrap_mozilla.in
--- /usr/HEAD/ports/www/mozilla/files/patch-xpfe_bootstrap_mozilla.in	Thu Jan  1 01:00:00 1970
+++ /junk/wk/www/mozilla/files/patch-xpfe_bootstrap_mozilla.in	Sun Jan  2 17:18:48 2005
@@ -0,0 +1,474 @@
+--- xpfe/bootstrap/mozilla.in.orig	Fri Feb 20 19:13:46 2004
++++ xpfe/bootstrap/mozilla.in	Sun Jan  2 17:17:56 2005
+@@ -16,156 +16,347 @@
+ # Reserved.
+ #
+ 
+-## $Id: mozilla.in,v 1.6 2004/02/20 18:13:46 pkw%us.ibm.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 $
+ 
+-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
+-}
++#
++# Usage:
++#
++#	$ mozilla [args]
++#
++# The script will setup all the environment voodoo needed to make
++# the mozilla-bin binary to work.
++#
+ 
+ #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%"
++MOZILLA_BIN="%MOZILLA_BIN%"
++
++debugging=		# set the debugging level
++use_openFile="yes"	# use openfile for file/dir
++here=`pwd`
++
++# # obey the predefined MRE_HOME (not in the original script)
++# if [ -z "${MRE_HOME}" -o ! -d "${MRE_HOME}" ]; then
++    # Try our complied default
++    MRE_HOME="%MREDIR%"
++    if [ ! -d "${MRE_HOME}" ]; then
++	# use moz_libdir as MRE_HOME
++	MRE_HOME="${moz_libdir}"
++    fi
++# fi
++export	MRE_HOME
+ 
+-# honor MOZILLA_FIVE_HOME if it's there
+-if [ -n "$MOZILLA_FIVE_HOME" ] ; then
+-  dist_bin="$MOZILLA_FIVE_HOME"
+-else
+-  # Use run-mozilla.sh in the current dir if it exists
+-  # If not, then start resolving symlinks until we find run-mozilla.sh
+-  found=0
+-  progname=$0
+-  curdir=`dirname "$progname"`
+-  run_moz="$curdir/run-mozilla.sh"
+-  if test -x "$run_moz"; then
+-    dist_bin=$curdir
++if [ "$OSTYPE" = "beos" ]; then
++    mimeset -F "$MOZILLA_BIN"
++fi
++
++#
++# 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_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
++}
++
++#
++# Search for a valid mozilla bind-dist
++# Use run-mozilla.sh in the current dir if it exists
++# If not, then start resolving symlinks until we find run-mozilla.sh
++found=0
++progname="$0"
++curdir=`dirname "${progname}"`
++progbase=`basename "${progname}"`
++run_moz="${curdir}/run-mozilla.sh"
++# Check for $MOZILLA_FIVE_HOME if present
++if [ -n "${MOZILLA_FIVE_HOME}" -a \
++     -x "${MOZILLA_FIVE_HOME}/run-mozilla.sh" ]; then
++    dist_bin="${MOZILLA_FIVE_HOME}"
++    run_moz="${dist_bin}/run-mozilla.sh"
++elif [ -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
++else
++    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
++    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
+-  fi
++    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="%MOZILLA-BIN%"
++#
++# 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
+ 
+-if [ "$OSTYPE" = "beos" ]; then
+-  mimeset -F $MOZILLA_BIN
++#
++# guest a default remote command
++_remote_cmd="xfeDoCommand(openBrowser)"
++
++#
++# 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
++	${run_moz_remote} ${MOZ_CLIENT_PROGRAM} 'ping()' >/dev/null 2>&1 &&
++		ALREADY_RUNNING="yes"
++    fi
++elif [ -n "${debugging}" ]; then
++    echo "$0: WARN, no DISPLAY environment" 1>&2
+ fi
+ 
++#
++# parse options
++script_args=	# null
++moreargs=	# null
++target=	# null
+ while [ $# -gt 0 ]
+ do
+-  case "$1" in
+-    -p | -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
++    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
++	    ;;
++	# teak next extries for browser/mailapp/suite ?
++	-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
++	    ;;
++	*)
++	    target="$1"
++	    shift
++	    ;;
++    esac
+ done
+ 
+-export MRE_HOME
+-eval "set -- $moreargs"
++#
++# 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
++	    echo "$0: WARN, target: ${target} not an URI/file/dir" 1>&2
++	    ALREADY_RUNNING=	# null
++	fi
++    else
++	use_openFile=	# null
++    fi
++fi
++
++#
++# 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 "${moz_uilocale}" ]; then
++    if [ -n "${moz_uiregion}" ]; then
++	moreargs="-UIRegion ${moz_uiregion} ${more_args}"
++    fi
++    moreargs="-UILocale ${moz_uilocale} ${more_args}"
++fi
++
++#
++# 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
+ moz_pis_startstop_scripts "stop"
+ 
+ exit $exitcode
+-# EOF.
++# EOF
diff -ruN --exclude=CVS /usr/HEAD/ports/www/mozilla/pkg-deinstall.in /junk/wk/www/mozilla/pkg-deinstall.in
--- /usr/HEAD/ports/www/mozilla/pkg-deinstall.in	Sun Nov  7 23:24:21 2004
+++ /junk/wk/www/mozilla/pkg-deinstall.in	Sun Jan  2 23:58:46 2005
@@ -7,16 +7,55 @@
 # Fix the chrome registry.
 
 umask 022
-PATH=/bin:/usr/bin
+PATH="/bin:/usr/bin"
+
+prefix="${PKG_PREFIX:-%%PREFIX%%}"
 
 [ "x$1" = "x" ] && exit 1
 [ "x$2" != "xDEINSTALL" ] && exit 0
 
-MOZDIR=%%MOZDIR%%
+MOZDIR="${prefix}/lib/%%MOZILLA%%"
 
 rm -rf ${MOZDIR}/chrome/overlayinfo
 rm -f ${MOZDIR}/chrome/*.rdf
 rm -f ${MOZDIR}/component.reg
 rm -f ${MOZDIR}/components/*.dat
+
+# support for external bin commands
+rm -f ${prefix}/bin/%%MOZILLA%%
+rm -f ${prefix}/bin/mozilla ${prefix}/bin/mozilla-config
+for mozdir in ${prefix}/lib/mozilla* %%X11BASE%%/lib/mozilla*; do
+    if [ -d "${mozdir}" -a -x "${mozdir}/run-mozilla.sh" -a
+	 -x "${mozdir}/mozilla" -a -x "${mozdir}/mozilla-config" ]; then
+	install -m 555 ${mozdir}/mozilla ${prefix}/bin/
+	install -m 555 ${mozdir}/mozilla-config ${prefix}/bin/
+	break
+    fi
+done
+
+# support for shared browser-plugins directory (X11BASE)
+PLUGINDIR="%%X11BASE%%/lib/browser-plugins"
+# this is what we do now
+# But may be better use MOZLIB after tr / _
+KEEPFILE="${PLUGINDIR}/.%%MOZILLA%%.keep"
+# sure someone can work a clever way to do this
+rm -f "${KEEPFILE}"
+for file in "${PLUGINDIR}/.*.keep"; do
+    if [ -f "${file}" ]; then
+	break
+    fi
+    rm -rf "${PLUGINDIR}"
+    break
+done
+# alternate way to register browser-plugins
+# PLUGINDIR="%%X11BASE%%/lib/browser-plugins"
+# KEEPFILE="${PLUGINDIR}/.keepme"
+# if [ -r "${PLUGINDIR}/.keepme" ]; then
+#     if grep -v "${MOZDIR}" "${KEEPFILE}" > "${KEEPFILE}-%%MOZILLA%%"; then
+# 	mv "${KEEPFILE}-%%MOZILLA%%" "${KEEPFILE}"
+#     else
+# 	rm -rf "${PLUGINDIR}"
+#     fi
+# fi
 
 exit 0
diff -ruN --exclude=CVS /usr/HEAD/ports/www/mozilla/pkg-install.in /junk/wk/www/mozilla/pkg-install.in
--- /usr/HEAD/ports/www/mozilla/pkg-install.in	Sat Dec  4 10:47:25 2004
+++ /junk/wk/www/mozilla/pkg-install.in	Sun Jan  2 23:57:31 2005
@@ -7,14 +7,16 @@
 # Fix the chrome registry.
 
 umask 022
-PATH=/bin:/usr/bin
+PATH="/bin:/usr/bin"
+
+prefix="${PKG_PERFIX:-%%PREFIX%%}"
 
 [ "x$1" = "x" ] && exit 1
 [ "x$2" != "xPOST-INSTALL" ] && exit 0
 
-MOZDIR=%%MOZDIR%%
-REGXPCOM=${MOZDIR}/regxpcom
-REGCHROME=${MOZDIR}/regchrome
+MOZDIR="${prefix}/lib/%%MOZILLA%%"
+REGXPCOM="${MOZDIR}/regxpcom"
+REGCHROME="${MOZDIR}/regchrome"
 
 echo "===> Building Chrome's registry..."
 rm -rf ${MOZDIR}/chrome/overlayinfo
@@ -26,8 +28,39 @@
 ./run-mozilla.sh ${REGXPCOM} || true
 ./run-mozilla.sh ${REGCHROME} || true
 
-if [ ! -d %%PREFIX%%/lib/browser_plugins ]; then
-    mkdir -p %%PREFIX%%/lib/browser_plugins
+# support for shared browser-plugins directory (X11BASE)
+PLUGINDIR="%%X11BASE%%/lib/browser-plugins"
+# this is what we do now
+# But may be better use MOZLIB after tr / _
+KEEPFILE="${PLUGINDIR}/.%%MOZILLA%%.keep"
+mkdir -p "${PLUGINDIR}"
+touch "${KEEPFILE}"
+# an alternate way to register browser-plugins
+# PLUGINDIR="%%X11BASE%%/lib/browser-plugins"
+# KEEPFILE="${PLUGINDIR}/.keepme"
+# mkdir -p "${PLUGINDIR}"
+# touch "${KEEPFILE}"
+# grep -hqv "${MOZDIR}" "${KEEPFILE}" > "${KEEPFILE}-%%MOZILLA%%"
+# mv "${KEEPFILE}-%%MOZILLA%%" "${KEEPFILE}"
+
+# java plugin
+# FIXME, this must be done from plugins pkg_install
+jpidst="${PLUGINDIR}/libjavaplugin_oji.so"
+if [ ! -L "${jpidst}" ]; then
+    rm -f "${jpidst}"
+    jpilist="%%JPI_LIST%%"
+    for jpi in "${jpilist}"; do
+	if [ -r "${jpi}" ]; then
+	    ln -s "${jpi}" "${jpidst}"
+	    break
+	fi
+    done
 fi
+
+# install outer binaries
+# NOTE: you may use MOZILLA_FIVE_HOME
+install -m 555 ${MOZDIR}/mozilla ${prefix}/bin/%%MOZILLA%%
+install -m 555 ${MOZDIR}/mozilla ${prefix}/bin/
+install -m 555 ${MOZDIR}/mozilla-config ${prefix}/bin/
 
 exit 0
--- mozilla-1.7.5_2,2.patch ends here ---



More information about the freebsd-gnome mailing list