diff options
author | Gustavo Felisberto <humpback@gentoo.org> | 2006-01-04 03:38:09 +0000 |
---|---|---|
committer | Gustavo Felisberto <humpback@gentoo.org> | 2006-01-04 03:38:09 +0000 |
commit | 25bfd3ec5de5ef4e2e717c015ef65fb0129f2657 (patch) | |
tree | 3e55eb8dfd28fe320c90367168281c927979c58e /net-misc/tor | |
parent | Add more info to changelog. Fix header. (diff) | |
download | historical-25bfd3ec5de5ef4e2e717c015ef65fb0129f2657.tar.gz historical-25bfd3ec5de5ef4e2e717c015ef65fb0129f2657.tar.bz2 historical-25bfd3ec5de5ef4e2e717c015ef65fb0129f2657.zip |
update to 1.0.16 and chroot support
Package-Manager: portage-2.1_pre3-r1
Diffstat (limited to 'net-misc/tor')
-rw-r--r-- | net-misc/tor/ChangeLog | 12 | ||||
-rw-r--r-- | net-misc/tor/Manifest | 19 | ||||
-rw-r--r-- | net-misc/tor/files/digest-tor-0.1.0.16 | 1 | ||||
-rw-r--r-- | net-misc/tor/files/tor.confd | 8 | ||||
-rw-r--r-- | net-misc/tor/files/tor.initd-r1 | 42 | ||||
-rw-r--r-- | net-misc/tor/files/torrc.sample-0.1.0.16.patch | 31 | ||||
-rw-r--r-- | net-misc/tor/tor-0.1.0.16.ebuild | 130 |
7 files changed, 234 insertions, 9 deletions
diff --git a/net-misc/tor/ChangeLog b/net-misc/tor/ChangeLog index 5466a327f579..4db6efd21653 100644 --- a/net-misc/tor/ChangeLog +++ b/net-misc/tor/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for net-misc/tor -# Copyright 2000-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-misc/tor/ChangeLog,v 1.51 2005/09/11 23:14:16 humpback Exp $ +# Copyright 2000-2006 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/tor/ChangeLog,v 1.52 2006/01/04 03:38:09 humpback Exp $ + +*tor-0.1.0.16 (04 Jan 2006) + + 04 Jan 2006; Gustavo Felisberto <humpback@gentoo.org>; + +files/torrc.sample-0.1.0.16.patch, +files/tor.confd, +files/tor.initd-r1, + +tor-0.1.0.16.ebuild: + Adding tor 1.0.16 to portage. Arch teams please dont mark stable as the new + chroot stuff needs serious testing. *tor-0.1.0.14-r1 (11 Sep 2005) diff --git a/net-misc/tor/Manifest b/net-misc/tor/Manifest index a0642cfea7dd..7f47152891fd 100644 --- a/net-misc/tor/Manifest +++ b/net-misc/tor/Manifest @@ -1,16 +1,21 @@ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 -MD5 68f8bf751a6bddbb1209e520d23c6337 tor-0.1.0.14-r1.ebuild 1271 -MD5 60844b617ce6eb89f0dd3bc2d8e377de ChangeLog 8025 -MD5 b79b08e0f979feb256c93295714b4fc9 metadata.xml 224 +MD5 c2e6bcd8d4b3c128a26cbdb6cf09a28c ChangeLog 8329 MD5 ddb143bc03f010846dd1c1a12c80ec04 files/digest-tor-0.1.0.14-r1 64 -MD5 ef65448a33725bf0e7f4d02d5e0b8fb1 files/torrc.sample-0.1.0.14.patch 1120 +MD5 28685c6cba8b8de0c3c4eb9b63194af9 files/digest-tor-0.1.0.16 64 +MD5 46b3d14e606aace36decc6497dfc0b00 files/tor.confd 321 MD5 3321d3725a619e687d9bb7e2fb97d6c1 files/tor.initd 856 +MD5 bb2e1c6fc3298733ed0880793777533d files/tor.initd-r1 1236 +MD5 ef65448a33725bf0e7f4d02d5e0b8fb1 files/torrc.sample-0.1.0.14.patch 1120 +MD5 ab82c91feb4f7eceb4d1ed496a17f928 files/torrc.sample-0.1.0.16.patch 1134 +MD5 b79b08e0f979feb256c93295714b4fc9 metadata.xml 224 +MD5 68f8bf751a6bddbb1209e520d23c6337 tor-0.1.0.14-r1.ebuild 1271 +MD5 ca58735f71a579ce1e08c7152239511b tor-0.1.0.16.ebuild 4050 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) -iD8DBQFDJLpc8zY1VwezZiERAo6jAJ4oyBXeG0NX49bQ8ei0RCF6B/DD/QCfYBpG -5NNQScTqcCAkQgEh7QPyO0c= -=ALrH +iD8DBQFDu0Nz8zY1VwezZiERAnlaAJ9JYc+2EB0rzy43o+L2ObSlqmouOwCfYXb+ +KAld4vY3n5XR/w7VqXf1yKM= +=qqar -----END PGP SIGNATURE----- diff --git a/net-misc/tor/files/digest-tor-0.1.0.16 b/net-misc/tor/files/digest-tor-0.1.0.16 new file mode 100644 index 000000000000..1d50918eec49 --- /dev/null +++ b/net-misc/tor/files/digest-tor-0.1.0.16 @@ -0,0 +1 @@ +MD5 13631507b8eeee5d6e8fd245dc3eef4f tor-0.1.0.16.tar.gz 633340 diff --git a/net-misc/tor/files/tor.confd b/net-misc/tor/files/tor.confd new file mode 100644 index 000000000000..ae0ce0222502 --- /dev/null +++ b/net-misc/tor/files/tor.confd @@ -0,0 +1,8 @@ +# If you wish to run tor in a chroot, run: +# ebuild /var/db/pkg/net-misc/<tor-version>/<tor-version>.ebuild config +# and un-comment the following line. +# You can specify a different chroot directory but MAKE SURE it's empty. +# CHROOT="/chroot/tor" + +# Location of pid file relative to $CHROOT +# PIDFILE="/var/run/tor.pid" diff --git a/net-misc/tor/files/tor.initd-r1 b/net-misc/tor/files/tor.initd-r1 new file mode 100644 index 000000000000..2bf4d0f265bf --- /dev/null +++ b/net-misc/tor/files/tor.initd-r1 @@ -0,0 +1,42 @@ +#!/sbin/runscript +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/tor/files/tor.initd-r1,v 1.1 2006/01/04 03:38:09 humpback Exp $ + +depend() { + need net +} + +checkconfig() { + # first check that it exists + if [ ! -f ${CHROOT}/etc/tor/torrc ] ; then + eerror "You need to setup ${CHROOT}/etc/tor/torrc first" + eerror "Example is in /etc/tor/torrc.sample" + return 1 + fi +} + +start() { + checkconfig || return 1 + ebegin "Starting ${CHROOT:+chrooted }Tor" + HOME=/var/lib/tor + if [ "x${CHROOT}" == "x" ] ; then + start-stop-daemon --start --quiet --chuid tor --exec /usr/bin/tor -- --runasdaemon 1 + else + start-stop-daemon --start --quiet --chuid tor --chroot ${CHROOT} \ + --exec /usr/bin/tor -- --runasdaemon 1 + fi + + eend $? +} + +stop() { + ebegin "Stopping ${CHROOT:+chrooted }Tor" + checkconfig || return 2 + if [ "x${CHROOT}" == "x" ] ; then + start-stop-daemon --stop --quiet --chuid tor --exec /usr/bin/tor + else + start-stop-daemon --stop --quiet --chuid tor --pidfile ${CHROOT}${PIDFILE} + fi + eend $? +} diff --git a/net-misc/tor/files/torrc.sample-0.1.0.16.patch b/net-misc/tor/files/torrc.sample-0.1.0.16.patch new file mode 100644 index 000000000000..51fcf8c3e580 --- /dev/null +++ b/net-misc/tor/files/torrc.sample-0.1.0.16.patch @@ -0,0 +1,31 @@ +--- src/config/torrc.sample.in.orig 2006-01-04 03:25:18.000000000 +0000 ++++ src/config/torrc.sample.in 2006-01-04 03:26:45.000000000 +0000 +@@ -14,6 +14,12 @@ + # With the default Mac OS X installer, Tor will look in ~/.tor/torrc or + # /Library/Tor/torrc + ++## Default username and group the server will run as ++User tor ++Group tor ++ ++PIDFile /var/run/tor.pid ++ + + ## Replace this with "SocksPort 0" if you plan to run Tor only as a + ## server, and not make any local application connections yourself. +@@ -46,6 +52,7 @@ + #Log notice syslog + ## To send all messages to stderr: + #Log debug stderr ++Log notice file /var/log/tor/tor.log + + ## Uncomment this to start the process in the background... or use + ## --runasdaemon 1 on the command line. +@@ -63,6 +70,7 @@ + ## The directory for keeping all the keys/etc. By default, we store + ## things in $HOME/.tor on Unix, and in Application Data\tor on Windows. + #DataDirectory @LOCALSTATEDIR@/lib/tor ++DataDirectory /var/lib/tor/data + + ## The port on which Tor will listen for local connections from Tor controller + ## applications, as documented in control-spec.txt. NB: this feature is diff --git a/net-misc/tor/tor-0.1.0.16.ebuild b/net-misc/tor/tor-0.1.0.16.ebuild new file mode 100644 index 000000000000..dbbe8e68368d --- /dev/null +++ b/net-misc/tor/tor-0.1.0.16.ebuild @@ -0,0 +1,130 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/tor/tor-0.1.0.16.ebuild,v 1.1 2006/01/04 03:38:09 humpback Exp $ + +inherit eutils flag-o-matic + +DESCRIPTION="The Onion Router - Anonymizing overlay network for TCP" +HOMEPAGE="http://tor.eff.org/" +SRC_URI="http://tor.eff.org/dist/${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +## Arch temas please please dont mark this stable untill you really test the +## chroot stuff +KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86" +IUSE="static" + +DEPEND=">=dev-libs/openssl-0.9.6 + dev-libs/libevent" +RDEPEND="!static? ( + net-proxy/tsocks + >=dev-libs/openssl-0.9.6 + dev-libs/libevent + )" + +src_unpack() { + unpack ${A} + epatch ${FILESDIR}/torrc.sample-0.1.0.16.patch +} + +src_compile() { + use static && append-ldflags -static + use static && append-flags -static + econf || die + emake || die +} + +src_install() { + exeinto /etc/init.d ; newexe ${FILESDIR}/tor.initd-r1 tor + insinto /etc/conf.d ; newins ${FILESDIR}/tor.confd tor + make DESTDIR=${D} install || die + + dodoc README ChangeLog AUTHORS INSTALL \ + doc/{CLIENTS,FAQ,HACKING,TODO} \ + doc/{control-spec.txt,rend-spec.txt,tor-doc.css,tor-doc.html,tor-spec.txt} + + enewgroup tor + enewuser tor -1 -1 /var/lib/tor tor + dodir /var/lib/tor + dodir /var/log/tor + fperms 750 /var/lib/tor /var/log/tor + fowners tor:tor /var/lib/tor /var/log/tor +} + +pkg_postinst() { + einfo "You must create /etc/tor/torrc, you can use the sample that is in that directory" + einfo "To have privoxy and tor working together you must add:" + einfo "forward-socks4a / localhost:9050 ." + einfo "to /etc/privoxy/config" + einfo + einfo "The Tor ebuild now includes chroot support." + einfo "If you like to run tor in chroot AND this is a new install OR" + einfo "your tor doesn't already run in chroot, simply run:" + einfo "\`ebuild /var/db/pkg/${CATEGORY}/${PF}/${PF}.ebuild config\`" + einfo "Before running the above command you might want to change the chroot" + einfo "dir in /etc/conf.d/tor. Otherwise /chroot/tor will be used." +} + +pkg_config() { + CHROOT=`sed -n 's/^[[:blank:]]\?CHROOT="\([^"]\+\)"/\1/p' /etc/conf.d/tor 2>/dev/null` + EXISTS="no" + + if [ -z "${CHROOT}" -a ! -d "/chroot/tor" ]; then + CHROOT="/chroot/tor" + elif [ -d ${CHROOT} ]; then + eerror; eerror "${CHROOT:-/chroot/tor} already exists. Quitting."; eerror; EXISTS="yes" + fi + + if [ ! "$EXISTS" = yes ]; then + USERNAME="tor" + BINARY="/usr/bin/tor" + + einfo + einfo "Setting up the chroot directory..." + mkdir -m 700 -p ${CHROOT} + mkdir -p ${CHROOT}/etc/tor \ + ${CHROOT}/dev ${CHROOT}/var/log/tor ${CHROOT}/var/lib/tor \ + ${CHROOT}/usr/bin ${CHROOT}/var/run ${CHROOT}/lib \ + ${CHROOT}/usr/lib + + einfo "Creating devices..." + mknod -m 0444 ${CHROOT}/dev/random c 1 8 + mknod -m 0444 ${CHROOT}/dev/urandom c 1 9 + mknod -m 0666 ${CHROOT}/dev/null c 1 3 + + einfo "Adding ${USERNAME} to ${CHROOT}/etc/passwd and group..." + grep ^${USERNAME}: /etc/passwd > ${CHROOT}/etc/passwd + grep ^${USERNAME}: /etc/group > ${CHROOT}/etc/group + + einfo "Copying system files..." + cp -p /etc/{nsswitch.conf,host.conf,resolv.conf,hosts,localtime} ${CHROOT}/etc + cp -p /lib/{libc.*,libnsl.*,libnss_*.*,libresolv.*,libgcc_*.*,ld-linux.*} ${CHROOT}/lib + + # Static version has no dynamic dependencies + if useq !static ; then + einfo "Copying dependencies..." + for DEP in $(ldd $BINARY | awk '{print $3}'); do + test -f ${DEP} && cp ${DEP} ${CHROOT}${DEP} + done + fi + + einfo "Copying binaries and config files..." + for i in ${BINARY}; do + cp ${i} ${CHROOT}${i} + done + + cp -R /etc/tor ${CHROOT}/etc/ + cp -Rp /var/lib/tor ${CHROOT}/var/lib/ + + einfo "Setting permissions..." + chown ${USERNAME}:${USERNAME} ${CHROOT} ${CHROOT}/var/lib/tor \ + ${CHROOT}/var/log/tor ${CHROOT}/var/run + chmod 0700 ${CHROOT}/var/lib/tor ${CHROOT}/var/run ${CHROOT}/var/log/tor + chmod 0444 ${CHROOT}/etc/{group,host.conf,hosts,localtime,nsswitch.conf} + chmod 0444 ${CHROOT}/etc/{passwd,resolv.conf} + chmod 0644 ${CHROOT}/etc/tor/* + + einfo "Done." + fi +} |