head	1.19;
access;
symbols
	pkgsrc-2013Q2:1.19.0.10
	pkgsrc-2013Q2-base:1.19
	pkgsrc-2012Q4:1.19.0.8
	pkgsrc-2012Q4-base:1.19
	pkgsrc-2011Q4:1.19.0.6
	pkgsrc-2011Q4-base:1.19
	pkgsrc-2011Q2:1.19.0.4
	pkgsrc-2011Q2-base:1.19
	pkgsrc-2009Q4:1.19.0.2
	pkgsrc-2009Q4-base:1.19
	pkgsrc-2008Q4:1.18.0.14
	pkgsrc-2008Q4-base:1.18
	pkgsrc-2008Q3:1.18.0.12
	pkgsrc-2008Q3-base:1.18
	cube-native-xorg:1.18.0.10
	cube-native-xorg-base:1.18
	pkgsrc-2008Q2:1.18.0.8
	pkgsrc-2008Q2-base:1.18
	cwrapper:1.18.0.6
	pkgsrc-2008Q1:1.18.0.4
	pkgsrc-2008Q1-base:1.18
	pkgsrc-2007Q4:1.18.0.2
	pkgsrc-2007Q4-base:1.18
	pkgsrc-2007Q3:1.17.0.6
	pkgsrc-2007Q3-base:1.17
	pkgsrc-2007Q2:1.17.0.4
	pkgsrc-2007Q2-base:1.17
	pkgsrc-2007Q1:1.17.0.2
	pkgsrc-2007Q1-base:1.17
	pkgsrc-2006Q4:1.15.0.12
	pkgsrc-2006Q4-base:1.15
	pkgsrc-2006Q3:1.15.0.10
	pkgsrc-2006Q3-base:1.15
	pkgsrc-2006Q2:1.15.0.8
	pkgsrc-2006Q2-base:1.15
	pkgsrc-2006Q1:1.15.0.6
	pkgsrc-2006Q1-base:1.15
	pkgsrc-2005Q4:1.15.0.4
	pkgsrc-2005Q4-base:1.15
	pkgsrc-2005Q3:1.15.0.2
	pkgsrc-2005Q3-base:1.15
	pkgsrc-2005Q2:1.13.0.2
	pkgsrc-2005Q2-base:1.13
	pkgsrc-2005Q1:1.12.0.10
	pkgsrc-2005Q1-base:1.12
	pkgsrc-2004Q4:1.12.0.8
	pkgsrc-2004Q4-base:1.12
	pkgsrc-2004Q3:1.12.0.6
	pkgsrc-2004Q3-base:1.12
	pkgsrc-2004Q2:1.12.0.4
	pkgsrc-2004Q2-base:1.12
	pkgsrc-2004Q1:1.12.0.2
	pkgsrc-2004Q1-base:1.12
	pkgsrc-2003Q4:1.11.0.2
	pkgsrc-2003Q4-base:1.11
	netbsd-1-6-1:1.9.0.2
	netbsd-1-6-1-base:1.9
	netbsd-1-6:1.8.0.8
	netbsd-1-6-RELEASE-base:1.8
	pkgviews:1.8.0.4
	pkgviews-base:1.8
	buildlink2:1.8.0.2
	buildlink2-base:1.8
	netbsd-1-5-PATCH003:1.8
	netbsd-1-5-PATCH001:1.4
	netbsd-1-5-RELEASE:1.3
	netbsd-1-4-PATCH003:1.3
	netbsd-1-4-PATCH002:1.1.1.1
	pkgsrc-base:1.1.1.1
	TNF:1.1.1;
locks; strict;
comment	@# @;


1.19
date	2009.02.10.12.39.57;	author abs;	state dead;
branches;
next	1.18;

1.18
date	2008.01.01.16.45.35;	author abs;	state Exp;
branches;
next	1.17;

1.17
date	2007.04.02.21.59.31;	author abs;	state Exp;
branches;
next	1.16;

1.16
date	2007.03.21.12.36.17;	author abs;	state Exp;
branches;
next	1.15;

1.15
date	2005.07.06.19.16.15;	author abs;	state Exp;
branches;
next	1.14;

1.14
date	2005.07.06.19.13.24;	author abs;	state Exp;
branches;
next	1.13;

1.13
date	2005.03.23.11.40.34;	author abs;	state Exp;
branches;
next	1.12;

1.12
date	2004.02.14.01.03.29;	author grant;	state Exp;
branches;
next	1.11;

1.11
date	2003.08.14.04.55.58;	author grant;	state Exp;
branches;
next	1.10;

1.10
date	2003.08.05.20.22.46;	author abs;	state Exp;
branches;
next	1.9;

1.9
date	2002.09.20.11.26.52;	author abs;	state Exp;
branches;
next	1.8;

1.8
date	2002.03.26.22.43.46;	author abs;	state Exp;
branches;
next	1.7;

1.7
date	2002.03.11.10.18.25;	author abs;	state Exp;
branches;
next	1.6;

1.6
date	2001.12.22.14.43.20;	author abs;	state Exp;
branches;
next	1.5;

1.5
date	2001.07.27.14.26.19;	author abs;	state Exp;
branches;
next	1.4;

1.4
date	2001.01.12.23.11.05;	author tron;	state Exp;
branches;
next	1.3;

1.3
date	2000.09.01.16.05.20;	author abs;	state Exp;
branches;
next	1.2;

1.2
date	2000.08.29.09.04.03;	author abs;	state Exp;
branches;
next	1.1;

1.1
date	2000.01.12.15.03.42;	author abs;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2000.01.12.15.03.42;	author abs;	state Exp;
branches;
next	;


desc
@@


1.19
log
@Update ns-remote to 1.12:
 - Add PKG_DESTDIR_SUPPORT
 - Move source to code.google and import Makefile, patches and ns-open
   script from pkgsrc
@
text
@#!/bin/sh
#
# $NetBSD: ns-open,v 1.18 2008/01/01 16:45:35 abs Exp $
#
# Simple script to open a URL in Netscape, starting a new process if necessary
# If a netscape process is not running it will look for a valid netscape
# binary in the colon separated NETSCAPE_PREFERRED list, which can be
# overridden by the user in the environment.

if [ -z "$NETSCAPE_PREFERRED" ]; then
    NETSCAPE_PREFERRED=firefox:seamonkey:netscape7:mozilla:communicator:navigator:mozilla-netbsd:mozilla-linux:mozilla-solaris:firefox-netbsd:firefox-gtk2-linux:firefox-linux:firefox-solaris
fi

# Locate appropriate netscape binary and set NETSCAPE_BIN
# If we cannot locate, do not fail with an error here as we may still be
# able to use ns-remote to talk to an existing netscape process.
#
oldIFS="$IFS"
IFS="${IFS}:"
for prog in $NETSCAPE_PREFERRED ; do
    case $prog in
	/*) if [ -x $prog ]; then
		NETSCAPE_BIN=$prog
		break 2
	    fi
	    ;;
	*)  for dir in $PATH;do
		if [ -x $dir/$prog ];then
		    NETSCAPE_BIN=$dir/$prog
		    break 2
		fi
	    done
	    ;;
    esac
done
IFS="$oldIFS"

escape()
    {
    str=$1
    echo "$str" | sed -e 's/ /%20/g' -e 's/"/%22/g' -e 's/,/%2c/g' -e 's/\`/%60/g'
    }

# Check if there are any '-' options which would not be understood by ns-remote
# Slightly involved to avoid changing $@@ in case we need it for real netscape
#
for a
do
    if [ "$SKIP_ARG" = 1 ];then
	NS_REMOTE_ARGS="$NS_REMOTE_ARGS $a"
	SKIP_ARG=0
	continue
    fi
    case $a in
	-display | -id)
	    SKIP_ARG=1
	    ;;
	-remote)
	    REMOTE_SPECIFIED=1
	    SKIP_ARG=1
	    ;;
	-raise | -noraise)
	    RAISE=
	    ;;
	-* ) # Unrecognised option
	    START_NEW_NETSCAPE=1
	    ;;
	*)
	    URL=`escape "$a"`
	    break;
	    ;;
    esac
    NS_REMOTE_ARGS="$NS_REMOTE_ARGS $a"
done

# If we recognised all the options, try ns-remote
#
if [ -z "$START_NEW_NETSCAPE" ];then
    NS_REMOTE_ARGS="$NS_REMOTE_ARGS $RAISE"
    if [ -z "$REMOTE_SPECIFIED" ];then
	if [ -z "$URL" ];then
	    URL=about:blank
	fi
	NS_REMOTE_ARGS="$NS_REMOTE_ARGS -remote openURL(${URL})"
    fi
    if ns-remote -noraise 2>/dev/null; then
        if ns-remote $NS_REMOTE_ARGS ; then
            exit 0
        fi
    else
        echo "Netscape not running. Spawning $NETSCAPE_BIN in background." >&2
    fi
fi

if [ -z "$NETSCAPE_BIN" ];then
    echo "Unable to locate netscape binary for '$NETSCAPE_PREFERRED'"
    exit 1
fi
case $1 in
    -*)
	$NETSCAPE_BIN "$@@"
	;;
    *)
	# Since using ns-remote will return, we start netscape in the
	# background to give consistent behaviour.
	$NETSCAPE_BIN "$@@" &
	;;
esac
exit 0
@


1.18
log
@Update ns-remote to 1.11nb4 - from PR/37624 by Eric Schnoebelen:
 - Include seamonkey as a valid option in NETSCAPE_PREFERRED
@
text
@d3 1
a3 1
# $NetBSD: ns-open,v 1.17 2007/04/02 21:59:31 abs Exp $
@


1.17
log
@Update to ns-remote-1.11nb3: correctly escape spaces in URLs in ns-open
@
text
@d3 1
a3 1
# $NetBSD: ns-open,v 1.16 2007/03/21 12:36:17 abs Exp $
d11 1
a11 1
    NETSCAPE_PREFERRED=netscape7:firefox:mozilla:communicator:navigator:mozilla-netbsd:mozilla-linux:mozilla-solaris:firefox-netbsd:firefox-gtk2-linux:firefox-linux:firefox-solaris
@


1.16
log
@update ns-remote to 1.11nb2 - -noraise breaks with some versions of firefox - default it to off
@
text
@d3 1
a3 1
# $NetBSD: ns-open,v 1.15 2005/07/06 19:16:15 abs Exp $
d38 6
d69 1
a69 1
	    URL=`echo $a | sed -e 's/"/%22/g' -e 's/\`/%60/g' -e 's/,/%2c/g'`
@


1.15
log
@checkin the right version for the v1.11 bump
@
text
@d3 1
a3 1
# $NetBSD: ns-open,v 1.13 2005/03/23 11:40:34 abs Exp $
a37 1
RAISE=-noraise
@


1.14
log
@update ns-remote to 1.11:
    ns-remote can handle URL encoded ','s in URLs
@
text
@d64 1
a64 1
	    URL=`echo $a | sed -e 's/"/%22/g' -e 's/\`/%60/g -e 's/,/%2c/'`
@


1.13
log
@update ns-remote to 1.10:
    - when giving the URL to a running 'netscape' do not explicitly
      specify a new window, let the browser decide (allows firefox to
      use a new tab based on user preference)
    - move firefox ahead of communicator in preference terms
@
text
@d3 1
a3 1
# $NetBSD: ns-open,v 1.12 2004/02/14 01:03:29 grant Exp $
a62 3
	*,* ) # ns-remote cannot handle a URL encoded comma (XChangeProperty)
	    START_NEW_NETSCAPE=1
	    ;;
d64 1
a64 1
	    URL=`echo $a | sed -e 's/"/%22/g' -e 's/\`/%60/g`
@


1.12
log
@replace phoenix with firefox in ns-open.

bump PKGREVISION.
@
text
@d3 1
a3 1
# $NetBSD: ns-open,v 1.11 2003/08/14 04:55:58 grant Exp $
d11 1
a11 1
    NETSCAPE_PREFERRED=netscape7:communicator:navigator:mozilla:firefox:mozilla-netbsd:mozilla-linux:mozilla-solaris:firefox-netbsd:firefox-gtk2-linux:firefox-linux:firefox-solaris
d82 1
a82 1
	NS_REMOTE_ARGS="$NS_REMOTE_ARGS -remote openURL(${URL},new-window)"
@


1.11
log
@add some phoenix and mozilla browsers to NETSCAPE_PREFERRED.

bump to 1.9.
@
text
@d3 1
a3 1
# $NetBSD: ns-open,v 1.10 2003/08/05 20:22:46 abs Exp $
d11 1
a11 1
    NETSCAPE_PREFERRED=netscape7:communicator:navigator:mozilla:phoenix:mozilla-linux:mozilla-solaris:phoenix-linux:phoenix-solaris
@


1.10
log
@Updated ns-remote to 1.8:
    - Use 'openURL(about:blank,new-window)' rather than 'openBrowser', so
      we can open blank windows with Mozilla >= 1.3. From Todd Vierling
@
text
@d3 1
a3 1
# $NetBSD: ns-open,v 1.9 2002/09/20 11:26:52 abs Exp $
d11 1
a11 1
    NETSCAPE_PREFERRED=netscape7:communicator:navigator:mozilla
@


1.9
log
@Update to 1.7
	'Support' netscape7
	Fix multiple entry NETSCAPE_PREFERRED logic
@
text
@d3 1
a3 1
# $NetBSD: ns-open,v 1.8 2002/03/26 22:43:46 abs Exp $
d79 2
a80 5
	if [ -n "$URL" ];then
	    # encode , " and ` to avoid problems with openURL(x,y)
	    NS_REMOTE_ARGS="$NS_REMOTE_ARGS -remote openURL(${URL},new-window)"
	else
	    NS_REMOTE_ARGS="$NS_REMOTE_ARGS -remote openBrowser"
d82 1
@


1.8
log
@Update ns-remote to 1.6
    Replace 'ns-remote: not running on display :0.0' error message with more
    appropriate 'Netscape not running. Spawning new browser in the background'
    From Benjamin Wong in PR pkg/15615
@
text
@d3 1
a3 1
# $NetBSD: ns-open,v 1.7 2002/03/11 10:18:25 abs Exp $
d11 1
a11 1
    NETSCAPE_PREFERRED=communicator:navigator:mozilla
d24 1
a24 1
		break
d30 1
a30 1
		    break
d91 1
a91 1
        echo "Netscape not running. Spawning new browser in the background." >&2
d96 1
a96 1
    echo "Unable to locate netscape binary '$NETSCAPE_PREFERRED'"
@


1.7
log
@correctly quote $@@
@
text
@d3 1
a3 1
# $NetBSD: ns-open,v 1.6 2001/12/22 14:43:20 abs Exp $
d86 6
a91 2
    if ns-remote $NS_REMOTE_ARGS ; then
	exit 0
@


1.6
log
@Update ns-remote to 1.5:
Change ns-open to always start a new netscape process for URLs containing a
comma, rather than trying to URL encode them.
The XChangeProperty() call inside ns-remote interprets commas as deliminating
optional arguments and does not handle URL encoded commas.
Fixes PR pkg/14984 from reed@@reedmedia.net
@
text
@d3 1
a3 1
# $NetBSD: ns-open,v 1.5 2001/07/27 14:26:19 abs Exp $
d97 1
a97 1
	$NETSCAPE_BIN $@@
d102 1
a102 1
	$NETSCAPE_BIN $@@ &
@


1.5
log
@Permit netscape to default to mozilla as well as communicator and navigator.
Leave default as communicator
@
text
@d3 1
a3 1
# $NetBSD: ns-open,v 1.4 2001/01/12 23:11:05 tron Exp $
d60 5
a64 2
	-* )
	    UNRECOGNISED_OPTION=1
d67 1
a67 1
	    URL=`echo $a | sed -e 's/"/%22/g' -e 's/,/%2c/g' -e 's/\`/%60/g`
d76 1
a76 1
if [ -z "$UNRECOGNISED_OPTION" ];then
@


1.4
log
@Fix this script for Solaris's "/bin/sh".
@
text
@d3 1
a3 1
# $NetBSD: ns-open,v 1.3 2000/09/01 16:05:20 abs Exp $
d11 1
a11 1
    NETSCAPE_PREFERRED=communicator:navigator
@


1.3
log
@Extend ns-open for potential replacement of the 'netscape' binary
Update ns-remote to 1.3
@
text
@d3 1
a3 1
# $NetBSD: ns-open,v 1.2 2000/08/29 09:04:03 abs Exp $
d42 2
a43 1
for a ; do
@


1.2
log
@Update to 1.2 - escape ` in urls in ns-open
@
text
@d3 1
a3 1
# $NetBSD: ns-open,v 1.1.1.1 2000/01/12 15:03:42 abs Exp $
d6 3
a8 3
# If a netscape process is not running will run 'netscape'.
# If you want this to use a different binary (such as navigator), set
# the environment variable 'NS_OPEN_MOZILLA'.
d10 2
a11 2
if [ -z "$NS_OPEN_MOZILLA" ]; then
    NS_OPEN_MOZILLA=netscape
d14 71
a84 7
if [ -z "$1" ]
then
    ns-remote -noraise -remote openBrowser
else
    # encode ',' or '`' to avoid problems with the openURL(x,y) command
    URL=`echo $1 | sed -e 's/,/%2c/g' -e 's/\`/%60/g`
    echo ns-remote -noraise -remote openURL\(${URL}\,new-window\)
d87 3
a89 4
if [ $? -ne 0 ]
then
    echo "Starting new Netscape process..."
    $NS_OPEN_MOZILLA $1 &
d91 10
a100 1

@


1.1
log
@Initial revision
@
text
@d3 1
a3 1
# $NetBSD$
d18 3
a20 3
	# encode any ',' to avoid problems with the openURL(x,y) command
    URL=`echo $1 | sed 's/,/%2c/g'`
    ns-remote -noraise -remote openURL\(${URL}\,new-window\)
@


1.1.1.1
log
@ns-remote 1.1 - remote-control Netscape Navigator and Communicator
@
text
@@
