aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Batts <vbatts@hashbangbash.com>2011-07-03 13:49:33 -0400
committerNiels Horn <niels.horn@slackbuilds.org>2011-07-14 21:54:02 -0300
commit167bca5c9dd1f8e601de1aa3fcc94fac02890649 (patch)
tree6af01f807b56c0459f02091d7ea8d57a8aa51210
parent267caa0dc01dbfa715b43a9537a8d3e4dacb9422 (diff)
network/torsocks: Added (socks friendly usage with tor)
Signed-off-by: dsomero <xgizzmo@slackbuilds.org>
-rw-r--r--network/torsocks/README5
-rw-r--r--network/torsocks/doinst.sh15
-rw-r--r--network/torsocks/slack-desc19
-rw-r--r--network/torsocks/torsocks.SlackBuild91
-rw-r--r--network/torsocks/torsocks.info10
5 files changed, 140 insertions, 0 deletions
diff --git a/network/torsocks/README b/network/torsocks/README
new file mode 100644
index 0000000000000..58fbc939f0b72
--- /dev/null
+++ b/network/torsocks/README
@@ -0,0 +1,5 @@
+torsocks (socks friendly usage with tor)
+
+Torsocks allows you to use most socks-friendly applications in a safe
+way with Tor. It ensures that DNS requests are handled safely and
+explicitly rejects UDP traffic from the application you're using
diff --git a/network/torsocks/doinst.sh b/network/torsocks/doinst.sh
new file mode 100644
index 0000000000000..8dd043ac28eef
--- /dev/null
+++ b/network/torsocks/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/torsocks.conf.new
+
diff --git a/network/torsocks/slack-desc b/network/torsocks/slack-desc
new file mode 100644
index 0000000000000..fbf1cba4eedef
--- /dev/null
+++ b/network/torsocks/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------------------------------------------------------|
+torsocks: torsocks (socks friendly usage with tor)
+torsocks:
+torsocks: Torsocks allows you to use most socks-friendly applications in a
+torsocks: safe way with Tor. It ensures that DNS requests are handled
+torsocks: safely and explicitly rejects UDP traffic from the
+torsocks: application you're using
+torsocks:
+torsocks:
+torsocks:
+torsocks:
+torsocks:
diff --git a/network/torsocks/torsocks.SlackBuild b/network/torsocks/torsocks.SlackBuild
new file mode 100644
index 0000000000000..63fac85dce07a
--- /dev/null
+++ b/network/torsocks/torsocks.SlackBuild
@@ -0,0 +1,91 @@
+#!/bin/sh
+
+# Slackware build script for torsocks
+
+# Written by Vincent Batts, vbatts@hashbangbash.com
+
+PRGNAM=torsocks
+VERSION=${VERSION:-1.1}
+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}
+
+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
+
+set -e
+
+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 . \
+ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
+ -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
+ -exec chmod 644 {} \;
+
+# Fix a hardcoded lib path.
+sed -i -e 's|@prefix@/lib|@libdir@|' src/Makefile.in
+
+CFLAGS="$SLKCFLAGS" \
+CXXFLAGS="$SLKCFLAGS" \
+./configure \
+ --prefix=/usr \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --mandir=/usr/man \
+ --docdir=/usr/doc/$PRGNAM-$VERSION \
+ --build=$ARCH-slackware-linux
+
+make
+make install DESTDIR=$PKG
+
+# do not clobber
+mv $PKG/etc/torsocks.conf{,.new}
+
+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
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a \
+ INSTALL FAQ README* COPYING TODO \
+ $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
+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/torsocks/torsocks.info b/network/torsocks/torsocks.info
new file mode 100644
index 0000000000000..3e33151c0c396
--- /dev/null
+++ b/network/torsocks/torsocks.info
@@ -0,0 +1,10 @@
+PRGNAM="torsocks"
+VERSION="1.1"
+HOMEPAGE="http://torsocks.googlecode.com/"
+DOWNLOAD="http://torsocks.googlecode.com/files/torsocks-1.1.tar.gz"
+MD5SUM="1704fd009ed1a1c1dc9c6b72305a5449"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+MAINTAINER="Vincent Batts"
+EMAIL="vbatts@hashbangbash.com"
+APPROVED="dsomero"