aboutsummaryrefslogtreecommitdiff
path: root/network/surl
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2020-11-20 15:26:18 +0000
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2020-11-22 01:14:20 +0700
commit7eec2a29897a61406ebf1ff3dd8da9b3506d3f1e (patch)
tree57ffc99caa92ac62f79c796dc44af810d55380b4 /network/surl
parent9c7adf157333a16fbb7c911c510cee0ab2bb0f3a (diff)
network/surl: Added (URL shortener)
Signed-off-by: Dave Woodfall <dave@slackbuilds.org> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'network/surl')
-rw-r--r--network/surl/README14
-rw-r--r--network/surl/disable_broken_services.diff94
-rw-r--r--network/surl/slack-desc19
-rw-r--r--network/surl/surl.SlackBuild71
-rw-r--r--network/surl/surl.info10
5 files changed, 208 insertions, 0 deletions
diff --git a/network/surl/README b/network/surl/README
new file mode 100644
index 0000000000000..0fe4a8170ae2a
--- /dev/null
+++ b/network/surl/README
@@ -0,0 +1,14 @@
+surl (URL shortener)
+
+surl is a URL shortening command line application that supports
+various sites. It supports stdin or filename input. It grabs the
+URLs, converts them, and returns the same text that was used in the
+input. It is known to work with a few services, such as tinyurl.com,
+is.gd, and others.
+
+surl hasn't been updated in a few years, so not all of the services
+it supports are still functional due to changes in the services' APIs.
+The known non-working services have been disabled in this SlackBuild.
+
+Note: Another "surl" project exists, on github. It's a service, not a
+client like this surl.
diff --git a/network/surl/disable_broken_services.diff b/network/surl/disable_broken_services.diff
new file mode 100644
index 0000000000000..a8c35815322d1
--- /dev/null
+++ b/network/surl/disable_broken_services.diff
@@ -0,0 +1,94 @@
+diff -Naur recipe-0.7.1.1-1~ppa2/docs/surl.1 recipe-0.7.1.1-1~ppa2.patched/docs/surl.1
+--- recipe-0.7.1.1-1~ppa2/docs/surl.1 2013-09-01 08:27:48.000000000 -0400
++++ recipe-0.7.1.1-1~ppa2.patched/docs/surl.1 2020-11-14 00:21:20.723851357 -0500
+@@ -124,16 +124,16 @@
+ .INDENT 0.0
+ .IP \(bu 2
+ .
+-\fCecho \(aqhttp://google.co.uk\(aq | surl \-a myapikey123 \-u example \-s bit.ly\fP
++\fCecho \(aqhttp://google.co.uk\(aq | surl \-a myapikey123 \-u example \-s turl.ca\fP
+ .IP \(bu 2
+ .
+-\fCecho \(aqhttp://www.google.com\(aq | surl \-s tr.im\fP
++\fCecho \(aqhttp://www.google.com\(aq | surl \-s clck.ru\fP
+ .IP \(bu 2
+ .
+-\fCsurl \-c http://www.google.com \-s tr.im\fP
++\fCsurl \-c http://www.google.com \-s is.gd\fP
+ .IP \(bu 2
+ .
+-\fCsurl \-f example.txt \-i \-s tr.im\fP
++\fCsurl \-f example.txt \-i \-s is.gd\fP
+ .UNINDENT
+ .SH BUGS
+ .sp
+diff -Naur recipe-0.7.1.1-1~ppa2/docs/surl.rst recipe-0.7.1.1-1~ppa2.patched/docs/surl.rst
+--- recipe-0.7.1.1-1~ppa2/docs/surl.rst 2013-09-01 08:27:48.000000000 -0400
++++ recipe-0.7.1.1-1~ppa2.patched/docs/surl.rst 2020-11-14 00:19:23.019862057 -0500
+@@ -64,10 +64,10 @@
+
+ EXAMPLES
+ ========
+-* ``echo 'http://google.co.uk' | surl -a myapikey123 -u example -s bit.ly``
+-* ``echo 'http://www.google.com' | surl -s tr.im``
+-* ``surl -c http://www.google.com -s tr.im``
+-* ``surl -f example.txt -i -s tr.im``
++* ``echo 'http://google.co.uk' | surl -a myapikey123 -u example -s turl.ca``
++* ``echo 'http://www.google.com' | surl -s clck.ru``
++* ``surl -c http://www.google.com -s is.gd``
++* ``surl -f example.txt -i -s is.gd``
+
+ BUGS
+ ====
+diff -Naur recipe-0.7.1.1-1~ppa2/surl/services.py recipe-0.7.1.1-1~ppa2.patched/surl/services.py
+--- recipe-0.7.1.1-1~ppa2/surl/services.py 2013-09-01 08:27:48.000000000 -0400
++++ recipe-0.7.1.1-1~ppa2.patched/surl/services.py 2020-11-14 00:15:04.403885566 -0500
+@@ -29,30 +29,11 @@
+ def supportedServices():
+ """ Returns a dictionary with the supported surl services """
+ dict_service = {
+- 'bit.ly' : bitly_com('bit.ly'),
+- 'bitly.com' : bitly_com('bit.ly'),
+- 'j.mp' : bitly_com('j.mp'),
+ 'chilp.it' : chilp_it(),
+ 'clck.ru' : clck_ru(),
+- 'crum.bs' : crum_bs(),
+- 'decenturl.com': decenturl_com(),
+- 'goo.gl' : goo_gl(),
+ 'is.gd' : is_gd(),
+- 'liip.to' : liip_to(),
+- 'metamark.net' : metamark_net(),
+- 'redir.ec' : redir_ec(),
+- 'ri.ms' : tinyarro_ws('ri.ms'),
+- 'ta.gd' : tinyarro_ws('ta.gd'),
+- 'tinyarro.ws' : tinyarro_ws('tinyarro.ws'),
+- 'sn.im' : sn_im('sn.im'),
+- 'snipr.com' : sn_im('snipr.com'),
+- 'snipurl.com' : sn_im('snipurl.com'),
+- 'snurl.com' : sn_im('snurl.com'),
+- 'tiny.cc' : tiny_cc(),
+ 'tinyurl.com' : tinyurl_com(),
+ 'turl.ca' : turl_ca(),
+- 'twurl.nl' : twurl_nl(),
+- 'urlx.ru' : urlx_ru(),
+ }
+ return dict_service
+
+diff -Naur recipe-0.7.1.1-1~ppa2/surl/surl.py recipe-0.7.1.1-1~ppa2.patched/surl/surl.py
+--- recipe-0.7.1.1-1~ppa2/surl/surl.py 2013-09-01 08:27:48.000000000 -0400
++++ recipe-0.7.1.1-1~ppa2.patched/surl/surl.py 2020-11-14 00:17:42.283871214 -0500
+@@ -98,10 +98,10 @@
+ print(" -r, --script <path>\t\tThe surlscript to execute")
+ print("\n\nSupported URL shortening services:")
+ print(" %s\n" % ', '.join(service_list))
+- print("Example:\n echo 'http://google.co.uk' | surl -a myapikey123 -u example -s bit.ly")
+- print(" echo 'http://www.google.com' | surl -s tr.im")
+- print(" surl -c http://www.google.com -s tr.im")
+- print(" surl -f example.txt -i -s tr.im")
++ print("Example:\n echo 'http://google.co.uk' | surl -a myapikey123 -u example -s turl.ca")
++ print(" echo 'http://www.google.com' | surl -s clck.ru")
++ print(" surl -c http://www.google.com -s is.gd")
++ print(" surl -f example.txt -i -s is.gd")
+ ps.call("Help()")
+ ps.unload()
+ sys.exit(error)
diff --git a/network/surl/slack-desc b/network/surl/slack-desc
new file mode 100644
index 0000000000000..f47efc3aac8a4
--- /dev/null
+++ b/network/surl/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------------------------------------------------------|
+surl: surl (URL shortener)
+surl:
+surl: surl is a URL shortening command line application that supports
+surl: various sites. It supports stdin or filename input. It grabs the
+surl: URLs, converts them, and returns the same text that was used in the
+surl: input. It is known to work with a few services, such as tinyurl.com,
+surl: is.gd, and others.
+surl:
+surl:
+surl:
+surl:
diff --git a/network/surl/surl.SlackBuild b/network/surl/surl.SlackBuild
new file mode 100644
index 0000000000000..743b1ef192b68
--- /dev/null
+++ b/network/surl/surl.SlackBuild
@@ -0,0 +1,71 @@
+#!/bin/sh
+
+# Slackware build script for surl
+
+# Written by B. Watson (yalhcru@gmail.com)
+
+# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+
+PRGNAM=surl
+VERSION=${VERSION:-0.7.1.1}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i586 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+# Upstream files and directories are weirdly named.
+TARBALL=$CWD/${PRGNAM}_$VERSION-1~ppa2~ubuntu13.10.1.tar.gz
+SRCDIR=recipe-$VERSION-1~ppa2
+
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -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
+
+set -e
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $SRCDIR
+tar xvf $TARBALL
+cd $SRCDIR
+chown -R root:root .
+find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
+ \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
+
+patch -p1 < $CWD/disable_broken_services.diff
+
+sed -i 's,share/man,man,' setup.py
+python setup.py install --root=$PKG
+gzip -9 $PKG/usr/man/man1/$PRGNAM.1
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a AUTHORS LICENSE $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
diff --git a/network/surl/surl.info b/network/surl/surl.info
new file mode 100644
index 0000000000000..bc3564187c864
--- /dev/null
+++ b/network/surl/surl.info
@@ -0,0 +1,10 @@
+PRGNAM="surl"
+VERSION="0.7.1.1"
+HOMEPAGE="https://launchpad.net/surl"
+DOWNLOAD="http://ppa.launchpad.net/surl/ppa/ubuntu/pool/main/s/surl/surl_0.7.1.1-1~ppa2~ubuntu13.10.1.tar.gz"
+MD5SUM="a70434fabce4c865edd744dd49786e8a"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES=""
+MAINTAINER="B. Watson"
+EMAIL="yalhcru@gmail.com"