Update of /cvsroot/fink/dists/10.7/stable/main/finkinfo/net
In directory vz-cvs-3.sog:/tmp/cvs-serv25792
Added Files:
urlview.info urlview.patch
Log Message:
urlview: welcome to lion
--- NEW FILE: urlview.patch ---
urlview patches
diff --git a/system.urlview b/system.urlview
new file mode 100644
--- /dev/null
+++ b/system.urlview
@@ -0,0 +1,10 @@
+#
+# Sample urlview(1) configuration file
+#
+
+# regular expression to use to match URLs
+REGEXP (((http|https|ftp|gopher)|mailto):(//)?[^ <>"\t]*|www\.[-a-z0-9.]+)[^
.,;\t<">\):]
+
+# command to invoke for selected URL
+COMMAND /etc/urlview/url_handler.sh
+
diff --git a/url_handler.sh.fink b/url_handler.sh.fink
new file mode 100644
--- /dev/null
+++ b/url_handler.sh.fink
@@ -0,0 +1,120 @@
+#! /bin/bash
+
+# Copyright (c) 1998 Martin Schulze <[email protected]>
+# Slightly modified by Luis Francisco Gonzalez <[email protected]>
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+###########################################################################
+# Configurable section
+###########################################################################
+#
+# Any entry in the lists of programs that urlview handler will try out will
+# be made of /path/to/program + ':' + TAG where TAG is one of
+# XW: XWindows program
+# XT: Launch with an xterm if possible or as VT if not
+# VT: Launch in the same terminal
+
+# The lists of programs to be executed are
+https_prgs="/usr/X11R6/bin/netscape:XW /usr/bin/lynx:XT"
+http_prgs="/usr/bin/lynx:XT /usr/X11R6/bin/netscape:XW"
+mailto_prgs="/usr/bin/mutt:VT /usr/bin/elm:VT /usr/bin/pine:VT
/usr/bin/mail:VT"
+gopher_prgs="/usr/bin/lynx:XT /usr/bin/gopher:XT"
+ftp_prgs="/usr/bin/lynx:XT /usr/bin/ncftp:XT"
+
+# Program used as an xterm (if it doesn't support -T you'll need to change
+# the command line in getprg)
+XTERM=/usr/X11R6/bin/xterm
+
+
+###########################################################################
+# Change bellow this at your own risk
+###########################################################################
+function getprg()
+{
+ local ele tag prog
+
+ for ele in $*
+ do
+ tag=${ele##*:}
+ prog=${ele%%:*}
+ if [ -x $prog ]; then
+ case $tag in
+ XW)
+ [ -n "$DISPLAY" ] && echo "X:$prog" && return 0
+ ;;
+ XT)
+ [ -n "$DISPLAY" ] && [ -x "$XTERM" ] && \
+ echo "X:$XTERM -e $prog" && return 0
+ echo "$prog" && return 0
+ ;;
+ VT)
+ echo "$prog" && return 0
+ ;;
+ esac
+ fi
+ done
+}
+
+url="$1"; shift
+
+type="${url%%:*}"
+
+if [ "$url" = "$type" ]; then
+ type="${url%%.*}"
+ case "$type" in
+ www|web)
+ type=http
+ ;;
+ esac
+ url="$type://$url"
+fi
+
+case $type in
+https)
+ prg=`getprg $https_prgs`
+ ;;
+http)
+ prg=`getprg $http_prgs`
+ ;;
+ftp)
+ prg=`getprg $ftp_prgs`
+ ;;
+mailto)
+ prg=`getprg $mailto_prgs`
+ url="${url#mailto:}"
+ ;;
+gopher)
+ prg=`getprg $gopher_prgs`
+ ;;
+*)
+ echo "Unknown URL type. Please report URL and viewer to:"
+ echo "[email protected]."
+ /bin/echo "Press enter to continue.\c"; read x
+ exit
+ ;;
+esac
+
+if [ -n "$prg" ]; then
+ if [ "${prg%:*}" = "X" ]; then
+ ${prg#*:} "$url" 2>/dev/null &
+ else
+ $prg "$url"
+ fi
+fi
+
+
+
+
diff --git a/urlview.c b/urlview.c
--- a/urlview.c
+++ b/urlview.c
@@ -48,7 +48,7 @@
#define DEFAULT_REGEXP "(((https?|ftp|gopher)://|(mailto|file|news):)[^'
\t<>\"]+|(www|web|w3)\\.[-a-z0-9.]+)[^' \t.,;<>\"\\):]"
#define DEFAULT_COMMAND "url_handler.sh %s"
-#define SYSTEM_INITFILE "/etc/urlview.conf"
+#define SYSTEM_INITFILE "@PREFIX@/etc/urlview.conf"
#define OFFSET 2
#define PAGELEN (LINES - 1 - OFFSET)
@@ -506,10 +506,11 @@
free (url[current]);
url[current] = strdup (buf);
endwin ();
+ quote (scratch, sizeof (scratch), url[current]);
if (strstr (command, "%s"))
- snprintf (buf, sizeof (buf), command, quote (scratch, sizeof
(scratch), url[current]));
+ snprintf (buf, sizeof (buf), command, scratch);
else
- snprintf (buf, sizeof (buf), "%s %s", command, quote (scratch,
sizeof (scratch), url[current]));
+ snprintf (buf, sizeof (buf), "%s %s", command, scratch);
printf ("Executing: %s...\n", buf);
fflush (stdout);
system (buf);
diff --git a/urlview.html b/urlview.html
new file mode 100644
--- /dev/null
+++ b/urlview.html
@@ -0,0 +1,90 @@
+<HTML>
+<HEAD><TITLE>urlview - URL extractor/launcher</TITLE></HEAD>
+<BODY>
+<H2><A NAME="ss0.1">0.1 NAME</A>
+</H2>
+
+<P>urlview - URL extractor/launcher</P>
+
+<H2><A NAME="ss0.2">0.2 SYNOPSIS</A>
+</H2>
+
+<P>urlview <filename> [ <filename> ... ]</P>
+
+<H2><A NAME="ss0.3">0.3 DESCRIPTION</A>
+</H2>
+
+<P><EM>urlview</EM> is a screen oriented program for extracting URLs from text
+files and displaying a menu from which you may launch a command to view a
+specific item.</P>
+
+<H2><A NAME="ss0.4">0.4 CONFIGURATION</A>
+</H2>
+
+<P><EM>urlview</EM> attempts to read <EM>~/.urlview</EM> upon startup.
+If this file doesn't exist, it will try to read a system wide file
+in <EM>/etc/urlview/system.urlview</EM>. There are
+two configuration commands (order does not matter):</P>
+<P>REGEXP <regular expression to use for URL matching></P>
+
+<P><EM>urlview</EM> uses a regular expression to extract URLs from the
specified
+text files. \r, \t, \n and \f are all converted to
+their normal printf(2) meanings. The default REGEXP is</P>
+<P>
+<PRE>
+(((https?|ftp|gopher)://|(mailto|file|news):)[^'
\t<>"]+|(www|web|w3)\.[-a-z0-9.]+)[^' \t.,;<>"\):]
+</PRE>
+</P>
+
+<P>COMMAND <command to launch with URL></P>
+<P>If the specified command contains a ``%s'', it will be subsituted
+with the URL that was requested, otherwise the URL is appended to the
+COMMAND string. The default COMMAND is
+<PRE>
+ url_handler.sh '%s'
+</PRE>
+
+another possibility would be
+<PRE>
+ Netscape -remote 'openURL(%s)'
+</PRE>
+
+<B>NOTE:</B> you should always put single quotes ('') around usage of
+``%s'' and never let the REGEXP to match any string containing
+a single quote (note <CODE>[⁁'...]</CODE> in the default REGEXP)
+to avoid characters in the selected URL from being interpreted
+by your shell. For example, I could put the following URL in my email
+messages:
+<PRE>
+ X-Nasty-Url: http://www.`program_to_execute_as_you`.com
+</PRE>
+
+If you pass this URL to your shell, it could have nasty consequences.</P>
+
+<H2><A NAME="ss0.5">0.5 FILES</A>
+</H2>
+
+<P>
+<DL>
+<DT><B>/etc/urlview/system.urlview</B><DD><P>system-wide urlview configuration
file</P>
+<DT><B>~/.urlview</B><DD><P>urlview configuration file</P>
+</DL>
+</P>
+
+<H2><A NAME="ss0.6">0.6 SEE ALSO</A>
+</H2>
+
+<P>regcomp(3)</P>
+
+<H2><A NAME="ss0.7">0.7 AUTHOR</A>
+</H2>
+
+<P>Michael Elkins <[email protected]>.
+Modified for Debian by Luis Francisco Gonzalez <[email protected]>.
+Modified for SuSE by Dr. Werner Fink <[email protected]> and Stepan Kasal
<[email protected]>.</P>
+<HR>
+Next
+Previous
+Contents
+</BODY>
+</HTML>
diff --git a/urlview.man b/urlview.man
--- a/urlview.man
+++ b/urlview.man
@@ -34,7 +34,7 @@
upon startup. If this file
doesn't exist, it will try to read a system wide file
in
-.IR /etc/urlview.conf .
+.IR @PREFIX@/etc/urlview.conf .
There are two configuration commands (order does not matter):
.TP
REGEXP \fIregexp\fP
@@ -76,7 +76,7 @@
explicitly excludes single quotes.)
.SH FILES
.PP
-.IP "/etc/urlview.conf"
+.IP "@PREFIX@/etc/urlview.conf"
system-wide urlview configuration file
.IP "~/.urlview"
urlview configuration file
diff --git a/urlview.sgml b/urlview.sgml
--- a/urlview.sgml
+++ b/urlview.sgml
@@ -20,7 +20,7 @@
<p>
<em/urlview/ attempts to read <em>˜/.urlview</em> upon startup.
If this file doesn't exist, it will try to read a system wide file
-in <em>/etc/urlview.conf</em>. There are
+in <em>/@PREFIX@etc/urlview.conf</em>. There are
two configuration commands (order does not matter):
<p>
REGEXP <regular expression to use for URL matching>
@@ -62,7 +62,7 @@
<p>
<descrip>
<tag>
-/etc/urlview.conf
+@PREFIX@/etc/urlview.conf
<p>
system-wide urlview configuration file
<tag>
--- NEW FILE: urlview.info ---
Package: urlview
Version: 0.9
Revision: 1015
Description: Extracts URLs from text
License: GPL
Maintainer: Brendan Cully <[email protected]>
BuildDepends: libncurses5 (>= 5.4-20041023-1006), fink (>= 0.24.12)
Depends: ncurses (>= 5.4-20041023-1006), libncurses5-shlibs (>=
5.4-20041023-1006)
Suggests: mutt
Source: ftp://ftp.mutt.org/mutt/contrib/urlview-%v.tar.gz
Source-MD5: 67731f73e69297ffd106b65c8aebb2ab
PatchFile: %n.patch
PatchFile-MD5: ba3970ef9115703506c2a2c59ff3432a
PatchScript: sed 's|@PREFIX@|%p|g' <%{PatchFile} | patch -p1
ConfigureParams: --sysconfdir=%p/etc/urlview --mandir=%i/share/man
ConfFiles: %p/etc/%n/system.urlview %p/etc/%n/url_handler.sh
InstallScript: <<
# the install-man target is a busted hand-rolled one.
mkdir -p %i/share/man/man1
make install DESTDIR=%d
mkdir -p %i/share/doc/%n/examples
install -m 644 sample.urlview %i/share/doc/%n/examples
install -m 644 text %i/share/doc/%n/examples
mkdir -p %i/share/doc/%n/html
install -m 644 %n.html %i/share/doc/%n/html
mkdir -p %i/etc/%n
install -m 644 system.urlview %i/etc/%n
install -m 644 url_handler.sh.fink %i/etc/%n/url_handler.sh
<<
DocFiles: AUTHORS README COPYING ChangeLog urlview.sgml
DescDetail: <<
This utility is used to extract URL from text files, especially from
mail messages in order to launch some browser to view them. This used
to be a part of mutt but has now become an independent tool
<<
DescUsage: <<
It compiles and runs fine, but requires additional customization to
call your preferred browser. See the docs and modify the url_handler.sh
script as necessary (at least until the package is update with sensible
defaults...).
<<
Homepage: http://www.mutt.org
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Fink-commits mailing list
[email protected]
http://news.gmane.org/gmane.os.apple.fink.cvs