Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Jun 2013 08:38:43 GMT
From:      Horia Racoviceanu <horia@racoviceanu.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/180022: New port: textproc/extract_url Perl script that extracts URLs from email
Message-ID:  <201306270838.r5R8cht1052194@oldred.freebsd.org>
Resent-Message-ID: <201306270840.r5R8e1Ub064352@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         180022
>Category:       ports
>Synopsis:       New port: textproc/extract_url Perl script that extracts URLs from email
>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:   Thu Jun 27 08:40:01 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Horia Racoviceanu
>Release:        FreeBSD 9.1-RELEASE-p4 amd64
>Organization:
>Environment:
FreeBSD unitone.vedetta.com 9.1-RELEASE-p4 FreeBSD 9.1-RELEASE-p4 #0: Mon Jun 17 11:42:37 UTC 2013 root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64
>Description:
This is a Perl script that extracts URLs from correctly-encoded MIME
email messages or plain text. This can be used either as a
pre-parser for urlview, or to replace urlview entirely.

This is designed primarily for use with the mutt emailer. The idea
is that if you want to access a URL in an email, you pipe the email
to a URL extractor (like this one) which then lets you select a URL
to view in some third program (such as Firefox). An alternative
design is to access URLs from within mutt's pager by defining macros
and tagging the URLs in the display to indicate which macro to use.
A script you can use to do that is tagurl.pl.

Main features:
    - Configurable
    - Handles URLs that have been broken over several lines in
      format=flowed delsp=yes email messages
    - Handles quoted-printable email messages
    - Sanitizes URLs so that they can't break out of the command shell

WWW: http://www.memoryhole.net/~kyle/extract_url/
>How-To-Repeat:
https://redports.org/buildarchive/20130627065800-33451/
Note: RedPorts had a known problem with libtool on CLANG at the time of build, unrelated to this port.
>Fix:


Patch attached with submission follows:

# 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:
#
#	extract_url
#	extract_url/files
#	extract_url/files/extract_urlview.sample
#	extract_url/pkg-descr
#	extract_url/Makefile
#	extract_url/distinfo
#
echo c - extract_url
mkdir -p extract_url > /dev/null 2>&1
echo c - extract_url/files
mkdir -p extract_url/files > /dev/null 2>&1
echo x - extract_url/files/extract_urlview.sample
sed 's/^X//' >extract_url/files/extract_urlview.sample << '2a5a1d36ed0372017f5f57245a2fe6ef'
X################################
X### extract_url(1) configuration
X#
X# Copy this file to ~/.extract_urlview
X
X# Command used to view URLs
X#COMMAND firefox %s &
X
X# URL will be opened without prompting when emails contains only one
X#SHORTCUT
X
X# Turn off showing the full URL before opening it
X#NOREVIEW
X
X# Disable the automatic exit of URL selection menu after viewing a URL
X#PERSISTENT
X
X# Ignore links that don't correspond to any text
X#IGNORE_EMPTY_TAGS
X
X# Specify which HTML tags will be examined for URLs
X#HTML_TAGS a,applet,area,blockquote,embed,form,frame,iframe,input,ins,isindex,head,layer,link,object,q,script,xmp
X
X# Key for PERSISTENT behaviour, or opposite if PERSISTENT is specified
X#ALTSELECT k
X
X# Show [url] list or show URLs in [context] when the program is run
X#DEFAULT_VIEW url
X
X# Sanitize URLs before they are displayed
X#DISPLAY_SANITIZED
2a5a1d36ed0372017f5f57245a2fe6ef
echo x - extract_url/pkg-descr
sed 's/^X//' >extract_url/pkg-descr << 'ea377c214de33213bbc4145965c82be6'
XThis is a Perl script that extracts URLs from correctly-encoded MIME
Xemail messages or plain text. This can be used either as a
Xpre-parser for urlview, or to replace urlview entirely.
X
XThis is designed primarily for use with the mutt emailer. The idea
Xis that if you want to access a URL in an email, you pipe the email
Xto a URL extractor (like this one) which then lets you select a URL
Xto view in some third program (such as Firefox). An alternative
Xdesign is to access URLs from within mutt's pager by defining macros
Xand tagging the URLs in the display to indicate which macro to use.
XA script you can use to do that is tagurl.pl.
X
XMain features:
X    - Configurable
X    - Handles URLs that have been broken over several lines in
X      format=flowed delsp=yes email messages
X    - Handles quoted-printable email messages
X    - Sanitizes URLs so that they can't break out of the command shell
X
XWWW: http://www.memoryhole.net/~kyle/extract_url/
ea377c214de33213bbc4145965c82be6
echo x - extract_url/Makefile
sed 's/^X//' >extract_url/Makefile << 'eabb160ffe371da3487115b0673b508f'
X# Created by: Horia Racoviceanu <horia@racoviceanu.com>
X# $FreeBSD$
X
XPORTNAME=	extract_url
XPORTVERSION=	1.5.8
XCATEGORIES=	textproc
XMASTER_SITES=	${MASTER_SITE_GOOGLE_CODE}
XPROJECTHOST=	extracturl
X
XMAINTAINER=	horia@racoviceanu.com
XCOMMENT=	Perl script that extracts URLs from email in MIME or plain text format
X
XLICENSE=	BSD
XLICENSE_FILE=	${WRKSRC}/COPYING
X
XBUILD_DEPENDS=	p5-MIME-Tools>=0:${PORTSDIR}/mail/p5-MIME-Tools \
X		p5-HTML-Parser>=0:${PORTSDIR}/www/p5-HTML-Parser
XRUN_DEPENDS:=	${BUILD_DEPENDS}
X
XUSE_PERL5=	yes
XUSE_GMAKE=	yes
X
XMAKE_ARGS=	all prefix=${PREFIX} man_prefix=${PREFIX}
X
XWRKSRC=		${WRKDIR}/${PORTNAME}
X
XMAN1=		${PORTNAME}.1
XPLIST_FILES=	bin/${PORTNAME} \
X		etc/${PORTNAME}view.sample
X
XOPTIONS_DEFINE=			URI_FIND GETOPT_LONG
XOPTIONS_RADIO=			URL_Selector
XOPTIONS_RADIO_URL_Selector=	CURSES_UI URLVIEW
XOPTIONS_DEFAULT=		CURSES_UI
XURI_FIND_DESC=			recognizes more exotic URL variations in plain text
XGETOPT_LONG_DESC=		recognizes long options --version and --list
XCURSES_UI_DESC=			allows it to fully replace urlview
XURLVIEW_DESC=			uses urlview for the URL selector menu
X
X.include <bsd.port.options.mk>
X
X.if ${PORT_OPTIONS:MURI_FIND}
XRUN_DEPENDS+=	p5-URI-Find>=0:${PORTSDIR}/textproc/p5-URI-Find
X.endif
X
X.if ${PORT_OPTIONS:MGETOPT_LONG}
XRUN_DEPENDS+=	p5-Getopt-Long>=0:${PORTSDIR}/devel/p5-Getopt-Long
X.endif
X
X.if ${PORT_OPTIONS:MCURSES_UI}
XRUN_DEPENDS+=	p5-Curses-UI>=0:${PORTSDIR}/devel/p5-Curses-UI
X.endif
X
X.if ${PORT_OPTIONS:MURLVIEW}
XRUN_DEPENDS+=	urlview>=0:${PORTSDIR}/textproc/urlview
X.endif
X
Xpre-patch:
X	@${REINPLACE_CMD} "/pod2man.mk/s,make,${GMAKE}," ${WRKSRC}/${MAKEFILE}
X
Xpost-install:
X	@${INSTALL_DATA} ${FILESDIR}/${PORTNAME}view.sample ${PREFIX}/etc/
X	@${ECHO_MSG} "===>   Sample configuration installed in ${PREFIX}/etc/"
X
X.include <bsd.port.mk>
eabb160ffe371da3487115b0673b508f
echo x - extract_url/distinfo
sed 's/^X//' >extract_url/distinfo << '46d3d3b500faeec3122f63d4c8cd8206'
XSHA256 (extract_url-1.5.8.tar.gz) = 58eac907cb926deba74ab81e7503a1055fd3cbe20952f011d8e6b75da12d6bcc
XSIZE (extract_url-1.5.8.tar.gz) = 13861
46d3d3b500faeec3122f63d4c8cd8206
exit



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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201306270838.r5R8cht1052194>