| 1 |
# Copyright 1999-2011 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/net-misc/tor/tor-0.2.2.27_beta.ebuild,v 1.1 2011/05/30 23:25:44 blueness Exp $
|
| 4 |
|
| 5 |
EAPI=3
|
| 6 |
|
| 7 |
inherit autotools eutils flag-o-matic versionator
|
| 8 |
|
| 9 |
MY_PV="$(replace_version_separator 4 -)"
|
| 10 |
MY_PF="${PN}-${MY_PV}"
|
| 11 |
DESCRIPTION="Anonymizing overlay network for TCP"
|
| 12 |
HOMEPAGE="http://www.torproject.org/"
|
| 13 |
SRC_URI="http://www.torproject.org/dist/${MY_PF}.tar.gz"
|
| 14 |
S="${WORKDIR}/${MY_PF}"
|
| 15 |
|
| 16 |
LICENSE="BSD"
|
| 17 |
SLOT="0"
|
| 18 |
KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"
|
| 19 |
IUSE=""
|
| 20 |
|
| 21 |
DEPEND="dev-libs/openssl
|
| 22 |
>=dev-libs/libevent-2.0"
|
| 23 |
# The tordns patch for tsocks avoids some leakage of information thus raising anonymity
|
| 24 |
RDEPEND="${DEPEND}
|
| 25 |
net-proxy/tsocks[tordns]"
|
| 26 |
|
| 27 |
pkg_setup() {
|
| 28 |
enewgroup tor
|
| 29 |
enewuser tor -1 -1 /var/lib/tor tor
|
| 30 |
}
|
| 31 |
|
| 32 |
src_prepare() {
|
| 33 |
epatch "${FILESDIR}"/torrc.sample-0.1.2.6.patch
|
| 34 |
epatch "${FILESDIR}"/${PN}-0.2.1.19-logrotate.patch
|
| 35 |
|
| 36 |
einfo "Regenerating autotools files ..."
|
| 37 |
epatch "${FILESDIR}"/${PN}-0.2.2.24_alpha-respect-CFLAGS.patch
|
| 38 |
eautoreconf || die "eautoreconf failed"
|
| 39 |
}
|
| 40 |
|
| 41 |
src_configure() {
|
| 42 |
# Upstream isn't sure of all the user provided CFLAGS that
|
| 43 |
# will break tor, but does recommend against -fstrict-aliasing.
|
| 44 |
# We'll filter-flags them here as we encounter them.
|
| 45 |
filter-flags -fstrict-aliasing
|
| 46 |
econf --docdir=/usr/share/doc/${PF}
|
| 47 |
}
|
| 48 |
|
| 49 |
src_install() {
|
| 50 |
newinitd "${FILESDIR}"/tor.initd-r4 tor
|
| 51 |
emake DESTDIR="${D}" install || die
|
| 52 |
keepdir /var/{lib,log,run}/tor
|
| 53 |
|
| 54 |
dodoc README ChangeLog ReleaseNotes \
|
| 55 |
doc/{HACKING,TODO} \
|
| 56 |
doc/spec/README
|
| 57 |
|
| 58 |
fperms 750 /var/lib/tor /var/log/tor
|
| 59 |
fperms 755 /var/run/tor
|
| 60 |
fowners tor:tor /var/lib/tor /var/log/tor /var/run/tor
|
| 61 |
|
| 62 |
insinto /etc/tor/
|
| 63 |
doins "${FILESDIR}"/torrc
|
| 64 |
|
| 65 |
insinto /etc/logrotate.d
|
| 66 |
newins contrib/tor.logrotate tor
|
| 67 |
|
| 68 |
# allow the tor user more open files to avoid errors, see bug 251171
|
| 69 |
insinto /etc/security/limits.d/
|
| 70 |
doins "${FILESDIR}"/tor.conf
|
| 71 |
}
|
| 72 |
|
| 73 |
pkg_postinst() {
|
| 74 |
elog
|
| 75 |
elog "We created a configuration file for tor, /etc/tor/torrc, but you can"
|
| 76 |
elog "change it according to your needs. Use the torrc.sample that is in"
|
| 77 |
elog "that directory as a guide. Also, to have privoxy work with tor"
|
| 78 |
elog "just add the following line"
|
| 79 |
elog
|
| 80 |
elog "forward-socks4a / localhost:9050 ."
|
| 81 |
elog
|
| 82 |
elog "to /etc/privoxy/config. Notice the . at the end!"
|
| 83 |
elog
|
| 84 |
}
|