aboutsummaryrefslogtreecommitdiff
path: root/network/tor
diff options
context:
space:
mode:
authorErik Hanson <erik@slackbuilds.org>2010-05-11 15:01:37 +0200
committerRobby Workman <rworkman@slackbuilds.org>2010-05-11 15:01:37 +0200
commit38ee9adc8bed3fd9d3d4d2328fb0639b3002935f (patch)
tree8b0de1124feb7decb0c7271dc76f6471fc25c85b /network/tor
parent7d81370b4d67036e1696db79a2ee9b8b28295e5f (diff)
network/tor: Initial import
Diffstat (limited to 'network/tor')
-rw-r--r--network/tor/README8
-rw-r--r--network/tor/doinst.sh23
-rw-r--r--network/tor/rc.tor42
-rw-r--r--network/tor/slack-desc11
-rw-r--r--network/tor/tor.SlackBuild69
-rw-r--r--network/tor/tor.info8
6 files changed, 161 insertions, 0 deletions
diff --git a/network/tor/README b/network/tor/README
new file mode 100644
index 000000000000..634050597902
--- /dev/null
+++ b/network/tor/README
@@ -0,0 +1,8 @@
+Tor is a toolset for a wide range of organizations and people that want
+to improve their safety and security on the Internet. Using Tor can help
+you anonymize web browsing and publishing, instant messaging, IRC,
+SSH, and other applications that use the TCP protocol. Tor also
+provides a platform on which software developers can build new
+applications with built-in anonymity, safety, and privacy features.
+
+Tor requires the libevent library which is also available from SlackBuilds.org.
diff --git a/network/tor/doinst.sh b/network/tor/doinst.sh
new file mode 100644
index 000000000000..4a7f53f556c8
--- /dev/null
+++ b/network/tor/doinst.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+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...
+}
+
+# Keep same perms on rc.tor.new:
+if [ -e etc/rc.d/rc.tor ]; then
+ cp -a etc/rc.d/rc.tor etc/rc.d/rc.tor.new.incoming
+ cat etc/rc.d/rc.tor.new > etc/rc.d/rc.tor.new.incoming
+ mv etc/rc.d/rc.tor.new.incoming etc/rc.d/rc.tor.new
+fi
+
+config etc/rc.d/rc.tor.new
+config etc/tor/tor-tsocks.conf.new
diff --git a/network/tor/rc.tor b/network/tor/rc.tor
new file mode 100644
index 000000000000..5c2d99eb0a37
--- /dev/null
+++ b/network/tor/rc.tor
@@ -0,0 +1,42 @@
+#!/bin/bash
+
+PIDFILE="/var/lib/tor/tor.pid"
+
+tor_start() {
+ echo -n "Starting tor: "
+ if [ ! -f $PIDFILE ]; then
+ /usr/bin/tor 1> /dev/null
+ echo "OK"
+ else
+ echo -n "Removing stale lock.. "
+ rm -f $PIDFILE
+ /usr/bin/tor 1> /dev/null
+ echo "OK"
+ fi
+}
+
+tor_stop() {
+ echo -n "Stopping tor: "
+ if [ -f $PIDFILE ]; then
+ killall tor &> /dev/null
+ rm -f $PIDFILE
+ echo "OK"
+ else
+ echo "Not Running"
+ fi
+}
+
+case "$1" in
+ start)
+ tor_start
+ ;;
+ stop)
+ tor_stop
+ ;;
+ restart)
+ tor_stop
+ tor_start
+ ;;
+ *)
+ echo "Usage: rc.tor {start|stop|restart}"
+esac
diff --git a/network/tor/slack-desc b/network/tor/slack-desc
new file mode 100644
index 000000000000..3a05a2dbe013
--- /dev/null
+++ b/network/tor/slack-desc
@@ -0,0 +1,11 @@
+tor: tor - The second-generation onion router
+tor:
+tor: Tor is a toolset for a wide range of organizations and people that want
+tor: to improve their safety and security on the Internet. Using Tor can help
+tor: you anonymize web browsing and publishing, instant messaging, IRC,
+tor: SSH, and other applications that use the TCP protocol. Tor also
+tor: provides a platform on which software developers can build new
+tor: applications with built-in anonymity, safety, and privacy features.
+tor:
+tor: http://tor.eff.org/
+tor:
diff --git a/network/tor/tor.SlackBuild b/network/tor/tor.SlackBuild
new file mode 100644
index 000000000000..8be9c6471c60
--- /dev/null
+++ b/network/tor/tor.SlackBuild
@@ -0,0 +1,69 @@
+#!/bin/sh
+
+# Slackware build script for tor
+# Written by Erik Hanson erik@slackbuilds.org
+
+# Modified by the SlackBuilds.org project
+
+PRGNAM=tor
+VERSION=0.1.2.14
+ARCH=${ARCH:-i486}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+if [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+fi
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP || exit 1
+rm -rf $PRGNAM-$VERSION
+tar xvf $CWD/$PRGNAM-$VERSION.tar.gz || exit 1
+cd $PRGNAM-$VERSION || exit 1
+chown -R root:root .
+chmod -R u+w,go+r-w,a-s .
+
+CFLAGS="$SLKCFLAGS" \
+./configure \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --mandir=/usr/man \
+ || exit 1
+
+make || exit 1
+make install-strip DESTDIR=$PKG || exit 1
+
+if [ -d $PKG/usr/man ]; then
+( cd $PKG/usr/man
+ find . -type f -exec gzip -9 {} \;
+ for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done
+)
+fi
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a AUTHORS LICENSE README doc/* $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
+# Remove doc/ cruft
+( cd $PKG/usr/doc
+ find . -name Makefile* -exec rm {} \;
+ find . -name *.1 -exec rm {} \;
+ find . -name *.in -exec rm {} \;
+)
+
+mkdir -p $PKG/install $PKG/etc/rc.d
+cat $CWD/slack-desc > $PKG/install/slack-desc
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
+cat $CWD/rc.tor > $PKG/etc/rc.d/rc.tor.new
+mv $PKG/etc/tor/tor-tsocks.conf $PKG/etc/tor/tor-tsocks.conf.new
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz
diff --git a/network/tor/tor.info b/network/tor/tor.info
new file mode 100644
index 000000000000..2a61c8956f1f
--- /dev/null
+++ b/network/tor/tor.info
@@ -0,0 +1,8 @@
+PRGNAM="tor"
+VERSION="0.1.2.14"
+HOMEPAGE="http://tor.eff.org/"
+DOWNLOAD="http://tor.eff.org/dist/tor-0.1.2.14.tar.gz"
+MD5SUM="dc93a52f9c12ec7fe73b3905a28f09ec"
+MAINTAINER="Erik Hanson"
+EMAIL="erik@slackbuilds.org"
+APPROVED="rworkman"