From 2289b5dc210081b521c143d2612697086801bc93 Mon Sep 17 00:00:00 2001 From: Matteo Bernardini <ponce@slackbuilds.org> Date: Mon, 26 Jan 2015 15:21:11 +0100 Subject: network/urlview: Added (extract URLs from text files). Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org> Signed-off-by: Robby Workman <rworkman@slackbuilds.org> --- network/urlview/README | 10 +++ network/urlview/doinst.sh | 15 ++++ network/urlview/patches/Makefile.in.diff | 12 ++++ network/urlview/patches/include-fix.diff | 11 +++ network/urlview/patches/sample.urlview.diff | 15 ++++ network/urlview/patches/url_handler.sh.diff | 15 ++++ network/urlview/slack-desc | 19 +++++ network/urlview/urlview.SlackBuild | 108 ++++++++++++++++++++++++++++ network/urlview/urlview.info | 10 +++ 9 files changed, 215 insertions(+) create mode 100644 network/urlview/README create mode 100644 network/urlview/doinst.sh create mode 100644 network/urlview/patches/Makefile.in.diff create mode 100644 network/urlview/patches/include-fix.diff create mode 100644 network/urlview/patches/sample.urlview.diff create mode 100644 network/urlview/patches/url_handler.sh.diff create mode 100644 network/urlview/slack-desc create mode 100644 network/urlview/urlview.SlackBuild create mode 100644 network/urlview/urlview.info (limited to 'network') diff --git a/network/urlview/README b/network/urlview/README new file mode 100644 index 0000000000..a89983e2c4 --- /dev/null +++ b/network/urlview/README @@ -0,0 +1,10 @@ +urlview is a curses program for extracting URLs from text files and +displaying a menu from which you can select a specific URL to view using +your favorite browser program. + +It was originally part of mutt. See /etc/urlview.conf on how to configure +mutt, tin, or your default browser. + +Please be aware that /etc/urlview.conf and /usr/bin/url_handler.sh are +configuration files, so they are not overwritten on upgrades. Be sure to +merge/move the .new files after each upgrade. diff --git a/network/urlview/doinst.sh b/network/urlview/doinst.sh new file mode 100644 index 0000000000..4cf8309066 --- /dev/null +++ b/network/urlview/doinst.sh @@ -0,0 +1,15 @@ +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then + # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +config etc/urlview.conf.new +config usr/bin/url_handler.sh.new diff --git a/network/urlview/patches/Makefile.in.diff b/network/urlview/patches/Makefile.in.diff new file mode 100644 index 0000000000..2bb0334b83 --- /dev/null +++ b/network/urlview/patches/Makefile.in.diff @@ -0,0 +1,12 @@ +--- Makefile.in~ 2007-06-08 14:09:57.000000000 +0200 ++++ Makefile.in 2007-06-08 14:33:40.000000000 +0200 +@@ -318,7 +318,8 @@ + + + install-data-local: +- $(INSTALL_DATA) urlview.man $(mandir)/man1/urlview.1 ++ $(mkinstalldirs) $(DESTDIR)$(mandir)/man1 ++ $(INSTALL_DATA) urlview.man ${DESTDIR}$(mandir)/man1/urlview.1 + + # how to create a target for uninstall-data-local??? + diff --git a/network/urlview/patches/include-fix.diff b/network/urlview/patches/include-fix.diff new file mode 100644 index 0000000000..f4708e337a --- /dev/null +++ b/network/urlview/patches/include-fix.diff @@ -0,0 +1,11 @@ +--- urlview.c ++++ urlview.c +@@ -40,6 +40,8 @@ + #include <fcntl.h> + #include <sys/stat.h> + ++#include "quote.h" ++ + #ifdef HAVE_REGEX_H + #include <regex.h> + #else diff --git a/network/urlview/patches/sample.urlview.diff b/network/urlview/patches/sample.urlview.diff new file mode 100644 index 0000000000..111719f5e5 --- /dev/null +++ b/network/urlview/patches/sample.urlview.diff @@ -0,0 +1,15 @@ +--- sample.urlview~ 2007-06-08 14:11:09.000000000 +0200 ++++ sample.urlview 2007-06-08 14:11:33.000000000 +0200 +@@ -19,10 +19,10 @@ + #REGEXP (((http|https|ftp|gopher)|mailto):(//)?[^ >"\t]*|www\.[-a-z0-9.]+)[^ .,;\t>">\):] + REGEXP (((http|https|ftp|gopher)|mailto)[.:][^ >"\t]*|www\.[-a-z0-9.]+)[^ .,;\t>">\):] + +-# Command to invoke for selected URL. Use lynx, netscape, or url_handler.sh ++# Command to invoke for selected URL. Use lynx, firefox, or url_handler.sh + # shell script. + + #COMMAND lynx %s +-#COMMAND netscape -remote 'openURL(%s)' ++#COMMAND firefox -remote 'openURL(%s)' + COMMAND url_handler.sh + diff --git a/network/urlview/patches/url_handler.sh.diff b/network/urlview/patches/url_handler.sh.diff new file mode 100644 index 0000000000..d976e3c90b --- /dev/null +++ b/network/urlview/patches/url_handler.sh.diff @@ -0,0 +1,15 @@ +--- url_handler.sh~ 2007-06-08 14:12:20.000000000 +0200 ++++ url_handler.sh 2007-06-08 14:14:06.000000000 +0200 +@@ -28,8 +28,10 @@ + # 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" ++https_prgs="/usr/bin/firefox:XW /usr/bin/lynx:XT" ++https_prgs="/usr/bin/firefox:XW /usr/bin/lynx:XT" ++http_prgs="/usr/bin/lynx:XT /usr/bin/firefox:XW" ++http_prgs="/usr/bin/lynx:XT /usr/bin/firefox: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" diff --git a/network/urlview/slack-desc b/network/urlview/slack-desc new file mode 100644 index 0000000000..25cb759b22 --- /dev/null +++ b/network/urlview/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +urlview: urlview (extract URLs from text files) +urlview: +urlview: urlview is a curses program for extracting URLs from text files and +urlview: displaying a menu from which you can select a specific URL to view +urlview: using your favorite browser program. +urlview: +urlview: It was originally a part of mutt. +urlview: +urlview: +urlview: +urlview: diff --git a/network/urlview/urlview.SlackBuild b/network/urlview/urlview.SlackBuild new file mode 100644 index 0000000000..fc1673d0af --- /dev/null +++ b/network/urlview/urlview.SlackBuild @@ -0,0 +1,108 @@ +#!/bin/sh +# +# Slackware build script for urlview +# (C) 2007 Michael Wagner <lapinours@web.de> +# Copyright 2015 Matteo Bernardini <ponce@slackbuilds.org>, Pisa, Italy +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PRGNAM=urlview +VERSION=0.9 +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i486 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +DOCS="AUTHORS COPYING ChangeLog INSTALL README" + +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +cd $PRGNAM-$VERSION +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +# Apply patches for DESTDIR and mostly path fixes: +for i in $CWD/patches/*.diff; do + patch -p0 < $i || exit 1 +done + +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --libdir=/usr/lib${LIBDIRSUFFIX} + +make +make install DESTDIR=$PKG + +find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + +find $PKG/usr/man -type f -exec gzip -9 {} \; +for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done + +# Use sample.urlview as system-wide default configuration: +install -D -m 0644 sample.urlview $PKG/etc/urlview.conf.new + +# Let url_handler.sh do what it is supposed to be, handle URL events: +install -m 0755 url_handler.sh $PKG/usr/bin/url_handler.sh.new + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild +chmod 644 $PKG/usr/doc/$PRGNAM-$VERSION/* + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/network/urlview/urlview.info b/network/urlview/urlview.info new file mode 100644 index 0000000000..d7c5429dd0 --- /dev/null +++ b/network/urlview/urlview.info @@ -0,0 +1,10 @@ +PRGNAM="urlview" +VERSION="0.9" +HOMEPAGE="ftp://ftp.mutt.org/pub/mutt/contrib/urlview-0.9.README" +DOWNLOAD="http://ponce.cc/slackware/sources/repo/urlview-0.9.tar.gz" +MD5SUM="67731f73e69297ffd106b65c8aebb2ab" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="Matteo Bernardini" +EMAIL="ponce@slackbuilds.org" -- cgit v1.2.3