]> Pileus Git - ~andy/sunrise/blob - net-dns/unbound/unbound-1.0.2.ebuild
a59f72e99d8f55c255d30023d924d5783b6875f3
[~andy/sunrise] / net-dns / unbound / unbound-1.0.2.ebuild
1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 inherit eutils
6
7 DESCRIPTION="Unbound is a validating, recursive and caching DNS resolver."
8 HOMEPAGE="http://unbound.net"
9 SRC_URI="http://unbound.net/downloads/${P}.tar.gz"
10
11 LICENSE="BSD"
12 SLOT="0"
13 KEYWORDS="~amd64 ~x86"
14 IUSE="debug libevent static threads"
15
16 RDEPEND="dev-libs/openssl
17                 net-libs/ldns
18                 libevent? ( dev-libs/libevent )"
19 DEPEND="${RDEPEND}"
20
21 pkg_setup() {
22         enewgroup unbound
23         enewuser unbound -1 -1 -1 unbound
24 }
25
26 src_compile() {
27         econf \
28                 --with-conf-file=/etc/unbound/unbound.conf \
29                 --with-pidfile=/var/run/unbound.pid \
30                 --with-run-dir=/etc/unbound \
31                 --with-username=unbound \
32                 $(use_enable debug) \
33                 $(use_enable debug lock-checks) \
34                 $(use_enable debug alloc-checks) \
35                 $(use_enable static static-exe) \
36                 $(use_with libevent) \
37                 $(use_with threads pthreads)
38
39         emake || die "emake failed"
40 }
41
42 src_install() {
43         emake DESTDIR="${D}" install || die "emake install failed"
44         newinitd "${FILESDIR}/unbound.initd" unbound || die "newinitd failed"
45         newconfd "${FILESDIR}/unbound.confd" unbound || die "newconfd failed"
46
47         dodoc doc/README doc/CREDITS doc/TODO doc/Changelog doc/FEATURES || die "dodoc failed"
48         dodoc "${FILESDIR}/chroot_howto.txt" || die "dodoc failed"
49
50         # adapt config file to disable the chroot
51         sed -i '/^\t# chroot:/a\\tchroot: ""' "$D/etc/unbound/unbound.conf" || die "sed failed"
52 }
53
54 pkg_postinst() {
55         elog "The gentoo configuration does not enable a chroot environment,"
56         elog "this differs from the default upstream configuration."
57         elog "To use a chroot enviroment, please read:"
58         elog "/usr/share/doc/${PF}/chroot_howto.txt.bz2"
59 }