| 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.30-r2.ebuild,v 1.2 2011/09/14 10:46:56 blueness Exp $
|
| 4 |
|
| 5 |
EAPI=2
|
| 6 |
|
| 7 |
inherit autotools eutils flag-o-matic
|
| 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 |
RDEPEND="${DEPEND}"
|
| 23 |
|
| 24 |
pkg_setup() {
|
| 25 |
enewgroup tor
|
| 26 |
enewuser tor -1 -1 /var/lib/tor tor
|
| 27 |
}
|
| 28 |
|
| 29 |
src_prepare() {
|
| 30 |
epatch "${FILESDIR}"/torrc.sample-0.1.2.6.patch
|
| 31 |
epatch "${FILESDIR}"/${PN}-0.2.1.19-logrotate.patch
|
| 32 |
|
| 33 |
einfo "Regenerating autotools files ..."
|
| 34 |
epatch "${FILESDIR}"/${PN}-0.2.1.30-respect-CFLAGS.patch
|
| 35 |
eautoreconf || die "eautoreconf failed"
|
| 36 |
|
| 37 |
# Normally tor uses a bundled libevent fragment to provide
|
| 38 |
# asynchronous DNS requests. This is generally a bad idea, but at
|
| 39 |
# the moment the official libevent does not have the 0x20 hack, so
|
| 40 |
# anonymity is higher with the bundled variant. Remove patch as
|
| 41 |
# soon as upstream has installed the autoconf option to use
|
| 42 |
# system's libevent. This hasn't happened, so we
|
| 43 |
# have to live with the bundled libevent for this release, as the
|
| 44 |
# current version in tree won't suffice for tor to build
|
| 45 |
# See http://bugs.noreply.org/flyspray/index.php?do=details&id=920
|
| 46 |
# for upstream's report
|
| 47 |
# Let's revisit this when libevent-2* is unmasked
|
| 48 |
# use bundledlibevent || epatch "${FILESDIR}"/${PN}-0.2.1.5-no-internal-libevent.patch
|
| 49 |
}
|
| 50 |
|
| 51 |
src_configure() {
|
| 52 |
# Upstream isn't sure of all the user provided CFLAGS that
|
| 53 |
# will break tor, but does recommend against -fstrict-aliasing.
|
| 54 |
# We'll filter-flags them here as we encounter them.
|
| 55 |
filter-flags -fstrict-aliasing
|
| 56 |
econf $(use_enable debug)
|
| 57 |
}
|
| 58 |
|
| 59 |
src_install() {
|
| 60 |
# allow the tor user more open files to avoid errors, see bug 251171
|
| 61 |
newconfd "${FILESDIR}"/tor.confd tor
|
| 62 |
|
| 63 |
newinitd "${FILESDIR}"/tor.initd-r4 tor
|
| 64 |
emake DESTDIR="${D}" install || die
|
| 65 |
keepdir /var/{lib,log,run}/tor
|
| 66 |
|
| 67 |
dodoc README ChangeLog AUTHORS ReleaseNotes \
|
| 68 |
doc/{HACKING,TODO}
|
| 69 |
|
| 70 |
fperms 750 /var/lib/tor /var/log/tor
|
| 71 |
fperms 755 /var/run/tor
|
| 72 |
fowners tor:tor /var/lib/tor /var/log/tor /var/run/tor
|
| 73 |
|
| 74 |
insinto /etc/tor/
|
| 75 |
doins "${FILESDIR}"/torrc
|
| 76 |
|
| 77 |
insinto /etc/logrotate.d
|
| 78 |
newins contrib/tor.logrotate tor
|
| 79 |
}
|
| 80 |
|
| 81 |
pkg_postinst() {
|
| 82 |
elog
|
| 83 |
elog "We created a configuration file for tor, /etc/tor/torrc, but you can"
|
| 84 |
elog "change it according to your needs. Use the torrc.sample that is in"
|
| 85 |
elog "that directory as a guide. Also, to have privoxy work with tor"
|
| 86 |
elog "just add the following line"
|
| 87 |
elog
|
| 88 |
elog "forward-socks4a / localhost:9050 ."
|
| 89 |
elog
|
| 90 |
elog "to /etc/privoxy/config. Notice the . at the end!"
|
| 91 |
elog
|
| 92 |
}
|