| 1 |
blueness |
1.1 |
# Copyright 1999-2012 Gentoo Foundation |
| 2 |
|
|
# Distributed under the terms of the GNU General Public License v2 |
| 3 |
blueness |
1.3 |
# $Header: /var/cvsroot/gentoo-x86/net-misc/tor/tor-0.2.2.39.ebuild,v 1.2 2012/09/15 01:57:49 blueness Exp $ |
| 4 |
blueness |
1.1 |
|
| 5 |
|
|
EAPI="4" |
| 6 |
|
|
|
| 7 |
|
|
inherit autotools eutils flag-o-matic |
| 8 |
|
|
|
| 9 |
|
|
DESCRIPTION="Anonymizing overlay network for TCP" |
| 10 |
|
|
HOMEPAGE="http://www.torproject.org/" |
| 11 |
|
|
SRC_URI="https://archive.torproject.org/tor-package-archive/${PN}-${PV}.tar.gz" |
| 12 |
|
|
|
| 13 |
|
|
LICENSE="BSD GPL-2" |
| 14 |
|
|
SLOT="0" |
| 15 |
blueness |
1.3 |
KEYWORDS="~amd64 arm ~mips ppc ppc64 ~sparc ~x86 ~x86-fbsd" |
| 16 |
blueness |
1.1 |
IUSE="tor-hardening +transparent-proxy threads selinux" |
| 17 |
|
|
|
| 18 |
|
|
DEPEND="dev-libs/openssl |
| 19 |
|
|
>=dev-libs/libevent-2.0 |
| 20 |
|
|
selinux? ( sec-policy/selinux-tor )" |
| 21 |
|
|
RDEPEND="${DEPEND}" |
| 22 |
|
|
|
| 23 |
|
|
pkg_setup() { |
| 24 |
|
|
enewgroup tor |
| 25 |
|
|
enewuser tor -1 -1 /var/lib/tor tor |
| 26 |
|
|
} |
| 27 |
|
|
|
| 28 |
|
|
src_prepare() { |
| 29 |
|
|
epatch "${FILESDIR}"/torrc.sample.patch |
| 30 |
|
|
|
| 31 |
|
|
einfo "Regenerating autotools files ..." |
| 32 |
|
|
epatch "${FILESDIR}"/${PN}-0.2.2.24_alpha-respect-CFLAGS.patch |
| 33 |
|
|
eautoreconf |
| 34 |
|
|
} |
| 35 |
|
|
|
| 36 |
|
|
src_configure() { |
| 37 |
|
|
# Upstream isn't sure of all the user provided CFLAGS that |
| 38 |
|
|
# will break tor, but does recommend against -fstrict-aliasing. |
| 39 |
|
|
# We'll filter-flags them here as we encounter them. |
| 40 |
|
|
filter-flags -fstrict-aliasing |
| 41 |
|
|
econf \ |
| 42 |
|
|
--enable-asciidoc \ |
| 43 |
|
|
--docdir=/usr/share/doc/${PF} \ |
| 44 |
|
|
$(use_enable tor-hardening gcc-hardening) \ |
| 45 |
|
|
$(use_enable tor-hardening linker-hardening)\ |
| 46 |
|
|
$(use_enable transparent-proxy transparent) \ |
| 47 |
|
|
$(use_enable threads) |
| 48 |
|
|
} |
| 49 |
|
|
|
| 50 |
|
|
src_install() { |
| 51 |
|
|
newconfd "${FILESDIR}"/tor.confd tor |
| 52 |
|
|
newinitd "${FILESDIR}"/tor.initd-r6 tor |
| 53 |
|
|
emake DESTDIR="${D}" install |
| 54 |
|
|
keepdir /var/lib/tor |
| 55 |
|
|
|
| 56 |
|
|
dodoc README ChangeLog ReleaseNotes \ |
| 57 |
|
|
doc/{HACKING,TODO} \ |
| 58 |
|
|
doc/spec/README |
| 59 |
|
|
|
| 60 |
|
|
fperms 750 /var/lib/tor |
| 61 |
|
|
fowners tor:tor /var/lib/tor |
| 62 |
|
|
|
| 63 |
|
|
insinto /etc/tor/ |
| 64 |
|
|
newins "${FILESDIR}"/torrc-r1 torrc |
| 65 |
|
|
} |
| 66 |
|
|
|
| 67 |
|
|
pkg_postinst() { |
| 68 |
|
|
elog |
| 69 |
|
|
elog "We created a configuration file for tor, /etc/tor/torrc, but you can" |
| 70 |
|
|
elog "change it according to your needs. Use the torrc.sample that is in" |
| 71 |
|
|
elog "that directory as a guide. Also, to have privoxy work with tor" |
| 72 |
|
|
elog "just add the following line" |
| 73 |
|
|
elog |
| 74 |
|
|
elog "forward-socks4a / localhost:9050 ." |
| 75 |
|
|
elog |
| 76 |
|
|
elog "to /etc/privoxy/config. Notice the . at the end!" |
| 77 |
|
|
elog |
| 78 |
|
|
} |