2006-11-21 12:03:23 +01:00
|
|
|
# Description: Tor is a anonymous network and proxy.
|
2009-01-23 21:20:49 +01:00
|
|
|
# URL: http://www.torproject.org/
|
2014-11-10 13:28:07 +01:00
|
|
|
# Maintainer: Danny Rawlins, crux at romster dot me
|
|
|
|
# Packager: Danny Rawlins, crux at romster dot me
|
2008-03-04 16:56:11 +01:00
|
|
|
# Depends on: libevent openssl zlib
|
2006-11-21 12:03:23 +01:00
|
|
|
|
|
|
|
name=tor
|
2017-10-15 03:17:45 +02:00
|
|
|
version=0.3.1.7
|
2008-07-09 08:23:53 +02:00
|
|
|
release=1
|
2011-06-30 12:14:43 +02:00
|
|
|
source=(https://www.torproject.org/dist/tor-$version.tar.gz
|
2008-07-17 18:48:43 +02:00
|
|
|
tor.rc tor-config.patch)
|
2006-11-21 12:03:23 +01:00
|
|
|
|
|
|
|
build() {
|
2008-07-17 18:48:43 +02:00
|
|
|
cd $name-$version
|
|
|
|
patch -p 1 -i $SRC/tor-config.patch
|
2006-11-21 12:03:23 +01:00
|
|
|
|
2008-07-18 09:28:07 +02:00
|
|
|
# fix for find: The relative path `~/bin' is included in the PATH
|
|
|
|
# environment variable, which is insecure in combination with the
|
|
|
|
# -execdir action of find. Please remove that entry from $PATH
|
2017-10-15 03:17:45 +02:00
|
|
|
PATH=$(echo ${PATH} | awk -v RS=: -v ORS=: '/~/ {next} {print}' | sed 's/:*$//')
|
2008-07-18 09:28:07 +02:00
|
|
|
|
2006-11-21 12:03:23 +01:00
|
|
|
./configure \
|
|
|
|
--prefix=/usr \
|
2008-07-17 18:48:43 +02:00
|
|
|
--sysconfdir=/etc
|
2006-11-21 12:03:23 +01:00
|
|
|
|
2007-05-25 23:05:59 +02:00
|
|
|
make
|
|
|
|
make DESTDIR=$PKG install
|
2006-11-21 12:03:23 +01:00
|
|
|
|
2008-07-17 18:48:43 +02:00
|
|
|
# data
|
|
|
|
install -d $PKG/usr/var/lib/tor
|
|
|
|
chown tor:tor $PKG/usr/var/lib/tor
|
2008-07-18 11:49:00 +02:00
|
|
|
touch \
|
|
|
|
$PKG/usr/var/lib/tor/cached-certs \
|
|
|
|
$PKG/usr/var/lib/tor/cached-consensus \
|
|
|
|
$PKG/usr/var/lib/tor/cached-descriptors \
|
|
|
|
$PKG/usr/var/lib/tor/cached-descriptors.new \
|
|
|
|
$PKG/usr/var/lib/tor/cached-routers.new \
|
|
|
|
$PKG/usr/var/lib/tor/state
|
|
|
|
find $PKG/usr/var/lib/tor/ -type f -execdir chown tor:tor {} \; -execdir chmod 0600 {} \;
|
2006-11-21 12:03:23 +01:00
|
|
|
|
2008-07-17 18:48:43 +02:00
|
|
|
# configuration
|
|
|
|
mv $PKG/etc/tor/torrc.sample $PKG/etc/tor/torrc
|
|
|
|
find $PKG/etc/tor/ -type f -exec chown root:tor {} \; -execdir chmod 0640 {} \;
|
|
|
|
|
|
|
|
# programs
|
2008-07-18 13:31:03 +02:00
|
|
|
find $PKG/usr/bin -type f -execdir chown root:tor {} \; -execdir chmod 0750 {} \;
|
2008-07-17 18:48:43 +02:00
|
|
|
|
|
|
|
# logs
|
|
|
|
install -d $PKG/var/log/tor
|
|
|
|
chown tor:tor $PKG/var/log/tor
|
2006-11-21 12:03:23 +01:00
|
|
|
touch $PKG/var/log/tor/notices.log
|
2008-07-17 18:48:43 +02:00
|
|
|
find $PKG/var/log/tor/ -type f -exec chown tor:tor {} \; -execdir chmod 0640 {} \;
|
|
|
|
|
|
|
|
# service
|
2008-07-18 13:31:03 +02:00
|
|
|
install -m 0750 -D $SRC/tor.rc $PKG/etc/rc.d/tor
|
2011-09-17 03:21:03 +02:00
|
|
|
|
|
|
|
# docs
|
|
|
|
rm -r $PKG/usr/share/doc
|
2006-11-21 12:03:23 +01:00
|
|
|
}
|