network/tor: Initial import

This commit is contained in:
Erik Hanson 2010-05-11 15:01:37 +02:00 committed by Robby Workman
parent 7d81370b4d
commit 38ee9adc8b
6 changed files with 161 additions and 0 deletions

8
network/tor/README Normal file
View File

@ -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.

23
network/tor/doinst.sh Normal file
View File

@ -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

42
network/tor/rc.tor Normal file
View File

@ -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

11
network/tor/slack-desc Normal file
View File

@ -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:

View File

@ -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

8
network/tor/tor.info Normal file
View File

@ -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"