| 1 |
matsuu |
1.1 |
# Copyright 1999-2012 Gentoo Foundation
|
| 2 |
|
|
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
patrick |
1.2 |
# $Header: /var/cvsroot/gentoo-x86/net-dns/unbound/unbound-1.4.15.ebuild,v 1.1 2012/01/30 15:58:00 matsuu Exp $
|
| 4 |
matsuu |
1.1 |
|
| 5 |
|
|
EAPI="3"
|
| 6 |
|
|
PYTHON_DEPEND="python? 2"
|
| 7 |
|
|
SUPPORT_PYTHON_ABIS="1"
|
| 8 |
patrick |
1.2 |
RESTRICT_PYTHON_ABIS="3.* 2.7-pypy-* *-jython"
|
| 9 |
matsuu |
1.1 |
|
| 10 |
|
|
inherit eutils flag-o-matic python
|
| 11 |
|
|
|
| 12 |
|
|
DESCRIPTION="A validating, recursive and caching DNS resolver"
|
| 13 |
|
|
HOMEPAGE="http://unbound.net/"
|
| 14 |
|
|
SRC_URI="http://unbound.net/downloads/${P}.tar.gz"
|
| 15 |
|
|
|
| 16 |
|
|
LICENSE="BSD"
|
| 17 |
|
|
SLOT="0"
|
| 18 |
|
|
KEYWORDS="~amd64 ~x86 ~x64-macos"
|
| 19 |
|
|
IUSE="debug gost python static-libs test threads"
|
| 20 |
|
|
|
| 21 |
|
|
RDEPEND="dev-libs/expat
|
| 22 |
|
|
dev-libs/libevent
|
| 23 |
|
|
>=dev-libs/openssl-0.9.8
|
| 24 |
|
|
>=net-libs/ldns-1.6.5[ssl,gost?]"
|
| 25 |
|
|
|
| 26 |
|
|
DEPEND="${RDEPEND}
|
| 27 |
|
|
python? ( dev-lang/swig )
|
| 28 |
|
|
test? (
|
| 29 |
|
|
net-dns/ldns-utils[examples]
|
| 30 |
|
|
dev-util/splint
|
| 31 |
|
|
app-text/wdiff
|
| 32 |
|
|
)"
|
| 33 |
|
|
|
| 34 |
|
|
# bug #347415
|
| 35 |
|
|
RDEPEND="${RDEPEND}
|
| 36 |
|
|
net-dns/dnssec-root"
|
| 37 |
|
|
|
| 38 |
|
|
pkg_setup() {
|
| 39 |
|
|
enewgroup unbound
|
| 40 |
|
|
enewuser unbound -1 -1 /etc/unbound unbound
|
| 41 |
|
|
|
| 42 |
|
|
use python && python_pkg_setup
|
| 43 |
|
|
}
|
| 44 |
|
|
|
| 45 |
|
|
src_prepare() {
|
| 46 |
|
|
# To avoid below error messages, set 'trust-anchor-file' to same value in
|
| 47 |
|
|
# 'auto-trust-anchor-file'.
|
| 48 |
|
|
# [23109:0] error: Could not open autotrust file for writing,
|
| 49 |
|
|
# /etc/dnssec/root-anchors.txt: Permission denied
|
| 50 |
|
|
epatch "${FILESDIR}/${PN}-1.4.12-gentoo.patch"
|
| 51 |
|
|
}
|
| 52 |
|
|
|
| 53 |
|
|
src_configure() {
|
| 54 |
|
|
append-ldflags -Wl,-z,noexecstack || die
|
| 55 |
|
|
econf \
|
| 56 |
|
|
--with-pidfile="${EPREFIX}"/var/run/unbound.pid \
|
| 57 |
|
|
--with-ldns="${EPREFIX}"/usr \
|
| 58 |
|
|
--with-libevent="${EPREFIX}"/usr \
|
| 59 |
|
|
--with-rootkey-file="${EPREFIX}"/etc/dnssec/root-anchors.txt \
|
| 60 |
|
|
$(use_enable debug) \
|
| 61 |
|
|
$(use_enable gost) \
|
| 62 |
|
|
$(use_enable static-libs static) \
|
| 63 |
|
|
$(use_with threads pthreads) \
|
| 64 |
|
|
$(use_with python pyunbound) \
|
| 65 |
|
|
$(use_with python pythonmodule) \
|
| 66 |
|
|
--disable-rpath || die
|
| 67 |
|
|
|
| 68 |
|
|
# http://unbound.nlnetlabs.nl/pipermail/unbound-users/2011-April/001801.html
|
| 69 |
|
|
# $(use_enable debug lock-checks) \
|
| 70 |
|
|
# $(use_enable debug alloc-checks) \
|
| 71 |
|
|
# $(use_enable debug alloc-lite) \
|
| 72 |
|
|
# $(use_enable debug alloc-nonregional) \
|
| 73 |
|
|
}
|
| 74 |
|
|
|
| 75 |
|
|
src_install() {
|
| 76 |
|
|
emake DESTDIR="${D}" install || die "emake install failed"
|
| 77 |
|
|
|
| 78 |
|
|
# bug #299016
|
| 79 |
|
|
if use python ; then
|
| 80 |
|
|
find "${ED}" -name '_unbound.{la,a}' -delete || die
|
| 81 |
|
|
fi
|
| 82 |
|
|
if ! use static-libs ; then
|
| 83 |
|
|
find "${ED}" -name "*.la" -type f -delete || die
|
| 84 |
|
|
fi
|
| 85 |
|
|
|
| 86 |
|
|
newinitd "${FILESDIR}/unbound.initd" unbound || die "newinitd failed"
|
| 87 |
|
|
newconfd "${FILESDIR}/unbound.confd" unbound || die "newconfd failed"
|
| 88 |
|
|
|
| 89 |
|
|
dodoc doc/{README,CREDITS,TODO,Changelog,FEATURES} || die "dodoc failed"
|
| 90 |
|
|
|
| 91 |
|
|
# bug #315519
|
| 92 |
|
|
#exeinto /usr/libexec/munin/plugins
|
| 93 |
|
|
#doexe contrib/unbound_munin_ || die "doexe failed"
|
| 94 |
|
|
dodoc contrib/unbound_munin_ || die "dodoc failed"
|
| 95 |
|
|
|
| 96 |
|
|
docinto selinux
|
| 97 |
|
|
dodoc contrib/selinux/* || die "dodoc failed"
|
| 98 |
|
|
|
| 99 |
|
|
exeinto /usr/share/${PN}
|
| 100 |
|
|
doexe contrib/update-anchor.sh || die "doexe failed"
|
| 101 |
|
|
}
|
| 102 |
|
|
|
| 103 |
|
|
pkg_postinst() {
|
| 104 |
|
|
use python && python_mod_optimize unbound.py unboundmodule.py
|
| 105 |
|
|
}
|
| 106 |
|
|
|
| 107 |
|
|
pkg_postrm() {
|
| 108 |
|
|
use python && python_mod_cleanup unbound.py unboundmodule.py
|
| 109 |
|
|
}
|