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.1.28.ebuild,v 1.6 2011/01/07 23:41:06 ranger Exp $ |
4 |
|
5 |
EAPI=2 |
6 |
|
7 |
inherit eutils |
8 |
|
9 |
DESCRIPTION="Anonymizing overlay network for TCP" |
10 |
HOMEPAGE="http://www.torproject.org/" |
11 |
MY_PV=${PV/_/-} |
12 |
SRC_URI="http://www.torproject.org/dist/${PN}-${MY_PV}.tar.gz" |
13 |
S="${WORKDIR}/${PN}-${MY_PV}" |
14 |
|
15 |
LICENSE="BSD" |
16 |
SLOT="0" |
17 |
KEYWORDS="amd64 arm ppc ppc64 sparc x86 ~x86-fbsd" |
18 |
IUSE="debug" |
19 |
|
20 |
DEPEND="dev-libs/openssl |
21 |
>=dev-libs/libevent-1.2" |
22 |
# The tordns patch for tsocks avoids some leakage of information thus raising anonymity |
23 |
RDEPEND="${DEPEND} |
24 |
net-proxy/tsocks[tordns]" |
25 |
|
26 |
pkg_setup() { |
27 |
enewgroup tor |
28 |
enewuser tor -1 -1 /var/lib/tor tor |
29 |
} |
30 |
|
31 |
src_prepare() { |
32 |
epatch "${FILESDIR}"/torrc.sample-0.1.2.6.patch |
33 |
epatch "${FILESDIR}"/${PN}-0.2.1.19-logrotate.patch |
34 |
# Normally tor uses a bundled libevent fragment to provide |
35 |
# asynchronous DNS requests. This is generally a bad idea, but at |
36 |
# the moment the official libevent does not have the 0x20 hack, so |
37 |
# anonymity is higher with the bundled variant. Remove patch as |
38 |
# soon as upstream has installed the autoconf option to use |
39 |
# system's libevent. This hasn't happened, so we |
40 |
# have to live with the bundled libevent for this release, as the |
41 |
# current version in tree won't suffice for tor to build |
42 |
# See http://bugs.noreply.org/flyspray/index.php?do=details&id=920 |
43 |
# for upstream's report |
44 |
# Let's revisit this when libevent-2* is unmasked |
45 |
# use bundledlibevent || epatch "${FILESDIR}"/${PN}-0.2.1.5-no-internal-libevent.patch |
46 |
} |
47 |
|
48 |
src_configure() { |
49 |
econf $(use_enable debug) |
50 |
} |
51 |
|
52 |
src_install() { |
53 |
newinitd "${FILESDIR}"/tor.initd-r4 tor |
54 |
emake DESTDIR="${D}" install || die |
55 |
keepdir /var/{lib,log,run}/tor |
56 |
|
57 |
dodoc README ChangeLog AUTHORS ReleaseNotes \ |
58 |
doc/{HACKING,TODO} \ |
59 |
doc/spec/*.txt |
60 |
|
61 |
fperms 750 /var/lib/tor /var/log/tor |
62 |
fperms 755 /var/run/tor |
63 |
fowners tor:tor /var/lib/tor /var/log/tor /var/run/tor |
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 "You must create /etc/tor/torrc, you can use the sample that is in that directory" |
75 |
elog "To have privoxy and tor working together you must add:" |
76 |
elog "forward-socks4a / localhost:9050 ." |
77 |
elog "(notice the . at the end of the line)" |
78 |
elog "to /etc/privoxy/config" |
79 |
} |