ports/75635: [NEW PORT] www/mozilla-urihelper: A sample URI helper for mozilla apps

Jose M Rodriguez (freebsd) josemi at freebsd.jazztel.es
Wed Dec 29 20:50:33 UTC 2004


>Number:         75635
>Category:       ports
>Synopsis:       [NEW PORT] www/mozilla-urihelper: A sample URI helper for mozilla apps
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Dec 29 20:50:33 GMT 2004
>Closed-Date:
>Last-Modified:
>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: Mon Dec 27 17:00:42 CET 2004
>Description:
mozilla-urihelper is a simple sh script for mozilla URI support

It can be asigned to any external protocol in mozilla apps using
the prefs js (about:config) with entries of the form:

pref("network.protocol-handler.app.<protocol>",
     "%%PREFIX%%/bin/mozilla-urihelper");

When running on a KDE session, it uses kfmclient to use predefined
KDE URI support.

When running on a GNOME session, it uses gnome-open to use predefined
GNOME URI support.

When running out of GNOME/KDE, try to use a selection of apps to get
http, https, ftp, mailto, nntp, news, snews working.

This script can be also configured on place.

Author: Jose M. Rodriguez
	josemi at freebsd.jazztel.es

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

--- mozilla-urihelper-0.1.shar begins here ---
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	mozilla-urihelper
#	mozilla-urihelper/pkg-descr
#	mozilla-urihelper/Makefile
#	mozilla-urihelper/files
#	mozilla-urihelper/files/mozilla-urihelper.sh
#
echo c - mozilla-urihelper
mkdir -p mozilla-urihelper > /dev/null 2>&1
echo x - mozilla-urihelper/pkg-descr
sed 's/^X//' >mozilla-urihelper/pkg-descr << 'END-of-mozilla-urihelper/pkg-descr'
Xmozilla-urihelper is a simple sh script for mozilla URI support
X
XIt can be asigned to any external protocol in mozilla apps using
Xthe prefs js (about:config) with entries of the form:
X
Xpref("network.protocol-handler.app.<protocol>",
X     "%%PREFIX%%/bin/mozilla-urihelper");
X
XWhen running on a KDE session, it uses kfmclient to use predefined
XKDE URI support.
X
XWhen running on a GNOME session, it uses gnome-open to use predefined
XGNOME URI support.
X
XWhen running out of GNOME/KDE, try to use a selection of apps to get
Xhttp, https, ftp, mailto, nntp, news, snews working.
X
XThis script can be also configured on place.
X
XAuthor: Jose M. Rodriguez
X	josemi at freebsd.jazztel.es
END-of-mozilla-urihelper/pkg-descr
echo x - mozilla-urihelper/Makefile
sed 's/^X//' >mozilla-urihelper/Makefile << 'END-of-mozilla-urihelper/Makefile'
X# New ports collection makefile for:	mozilla-urihelper
X# Date created:		2004-12-29
X# Whom:			Jose M Rodriguez <josemi at freebsd.jazztel.es>
X#
X# $FreeBSD$
X#
X
X#
X# this port is self contained
X#
X
XPORTNAME=	mozilla-urihelper
XPORTVERSION=	0.1
XCATEGORIES=	www
XMASTER_SITES=	# none
XDISTFILES=	# none
X
XMAINTAINER=	josemi at freebsd.jazztel.es
XCOMMENT=	A sample URI helper for mozilla apps
X
XNO_BUILD=	yes
XUSE_X_PREFIX=	yes
X
XPLIST_FILES=	bin/mozilla-urihelper
X
Xdo-fetch:
X	@${DO_NADA}
X
Xdo-install:
X	${INSTALL_SCRIPT} ${FILESDIR}/mozilla-urihelper.sh \
X			${PREFIX}/bin/mozilla-urihelper
X
X.include <bsd.port.mk>
END-of-mozilla-urihelper/Makefile
echo c - mozilla-urihelper/files
mkdir -p mozilla-urihelper/files > /dev/null 2>&1
echo x - mozilla-urihelper/files/mozilla-urihelper.sh
sed 's/^X//' >mozilla-urihelper/files/mozilla-urihelper.sh << 'END-of-mozilla-urihelper/files/mozilla-urihelper.sh'
X#!/bin/sh
X#
X
X# mozilla-urihelper
X# a generic URI helper as mozilla external handler app
X#
X
X#
X# working definitions
XGNOME_OPEN="gnome-open"
XKDE_OPEN="kfmclient"
XKDE_OPEN_ARGS="exec"
XBROWSER_APPS="firefox kfmclient epiphany mozilla"
XMAIL_APPS="thunderbird kfmclient evolution balsa mozilla"
XNEWS_APPS="thunderbird kfmclient pan evolution mozilla"
XFTP_APPS="gftp firefox kfmclient mozilla"
X
X#
X# test for a running KDE session
Xif [ -n "${KDE_FULL_SESSION}" ]; then
X    # in a KDE session
X    KDE_OPEN=`which ${KDE_OPEN}`
X    if [ -n "${KDE_OPEN_ARGS}" ]; then
X	KDE_OPEN="${KDE_OPEN} ${KDE_OPEN_ARGS}"
X    fi
X    exec ${KDE_OPEN} "$@"
Xfi
X
X#
X# test for a running GNOME session
Xif [ -n "${GNOME_SESSION_ID}" ]; then
X    # in a GNOME session
X    GNOME_OPEN=`which ${GNOME_OPEN}`
X    if [ -n "${iGNOME_OPEN_ARGS}" ]; then
X	GNOME_OPEN="${GNOME_OPEN} ${GNOME_OPEN_ARGS}"
X    fi
X    exec ${GNOME_OPEN} "$@"
Xfi
X
X#
X# our best effort
Xcase "${1%%:*}" in
X    http | https)
X	for _app in "${BROWSER_APPS}"; do
X	    _app=`which ${_app}` >/dev/null 2>&1 || continue
X	    # got a browser
X	    eval _args=\$BROWSER_ARGS_${_app}
X	    if [ -n "${_args}" ]; then
X		_app="${_app} ${_args}"
X	    fi
X	    exec ${_app} "$@"
X	done
X	exit 1
X	;;
X    mailto)
X	for _app in "${MAIL_APPS}"; do
X	    _app=`which ${_app}` >/dev/null 2>&1 || continue
X	    # got a mailer
X	    eval _args=\$MAIL_ARGS_${_app}
X	    if [ -n "${_args}" ]; then
X		_app="${_app} ${_args}"
X	    fi
X	    exec ${_app} "$@"
X	done
X	exit 1
X	;;
X    nntp | news | snews)
X	for _app in "${NEWS_APPS}"; do
X	    _app=`which ${_app}` >/dev/null 2>&1 || continue
X	    # got a news app
X	    eval _args=\$NEWS_ARGS_${_app}
X	    if [ -n "${_args}" ]; then
X		_app="${_app} ${_args}"
X	    fi
X	    exec ${_app} "$@"
X	done
X	exit 1
X	;;
X    ftp)
X	for _app in "${FTP_APPS}"; do
X	    _app=`which ${_app}` >/dev/null 2>&1 || continue
X	    # got a ftp app
X	    eval _args=\$FTP_ARGS_${_app}
X	    if [ -n "${_args}" ]; then
X		_app="${_app} ${_args}"
X	    fi
X	    exec ${_app} "$@"
X	done
X	exit 1
X	;;
X    *)
X	exit 1
X	;;
Xesac
END-of-mozilla-urihelper/files/mozilla-urihelper.sh
exit
--- mozilla-urihelper-0.1.shar ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list