+To avoid below error messages like
+
+ [23109:0] error: Could not open autotrust file for writing, /etc/dnssec/root-anchors.txt: Permission denied
+
+set 'trust-anchor-file' to same value in 'auto-trust-anchor-file'.
+
diff -ur unbound-1.5.7.orig/doc/example.conf.in unbound-1.5.7/doc/example.conf.in
--- unbound-1.5.7.orig/doc/example.conf.in 2015-12-10 08:59:18.000000000 +0100
+++ unbound-1.5.7/doc/example.conf.in 2016-01-05 04:08:01.666760015 +0100
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-EAPI=5
+EAPI="7"
PYTHON_COMPAT=( python2_7 )
-inherit eutils flag-o-matic multilib-minimal python-single-r1 systemd user
+inherit autotools flag-o-matic multilib-minimal python-single-r1 systemd user
MY_P=${PN}-${PV/_/}
DESCRIPTION="A validating, recursive and caching DNS resolver"
)
python? ( ${PYTHON_DEPS} )"
+BDEPEND="virtual/pkgconfig"
+
DEPEND="${CDEPEND}
python? ( dev-lang/swig )
test? (
dev-util/splint
app-text/wdiff
)
- systemd? ( sys-apps/systemd )
- virtual/pkgconfig"
+ systemd? ( sys-apps/systemd )"
RDEPEND="${CDEPEND}
+ net-dns/dnssec-root
selinux? ( sec-policy/selinux-bind )"
# bug #347415
RDEPEND="${RDEPEND}
net-dns/dnssec-root"
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.5.7-trust-anchor-file.patch
+)
+
S=${WORKDIR}/${MY_P}
pkg_setup() {
}
src_prepare() {
- # To avoid below error messages, set 'trust-anchor-file' to same value in
- # 'auto-trust-anchor-file'.
- # [23109:0] error: Could not open autotrust file for writing,
- # /etc/dnssec/root-anchors.txt: Permission denied
- epatch "${FILESDIR}"/${PN}-1.5.7-trust-anchor-file.patch
+ default
+
+ eautoreconf
# required for the python part
multilib_copy_sources
$(use_with threads pthreads) \
--disable-flto \
--disable-rpath \
- --with-libevent="${EPREFIX}"/usr \
- --with-pidfile="${EPREFIX}"/var/run/unbound.pid \
- --with-rootkey-file="${EPREFIX}"/etc/dnssec/root-anchors.txt \
- --with-ssl="${EPREFIX}"/usr \
- --with-libexpat="${EPREFIX}"/usr
+ --with-libevent="${EPREFIX%/}"/usr \
+ --with-pidfile="${EPREFIX%/}"/var/run/unbound.pid \
+ --with-rootkey-file="${EPREFIX%/}"/etc/dnssec/root-anchors.txt \
+ --with-ssl="${EPREFIX%/}"/usr \
+ --with-libexpat="${EPREFIX%/}"/usr
# http://unbound.nlnetlabs.nl/pipermail/unbound-users/2011-April/001801.html
# $(use_enable debug lock-checks) \
}
multilib_src_install_all() {
- prune_libtool_files --modules
use python && python_optimize
newinitd "${FILESDIR}"/unbound.initd unbound
# create space for auto-trust-anchor-file...
keepdir /etc/unbound/var
# ... and point example config to it
- sed -i '/# auto-trust-anchor-file:/s,/etc/dnssec/root-anchors.txt,/etc/unbound/var/root-anchors.txt,' "${ED}/etc/unbound/unbound.conf"
+ sed -i \
+ -e '/# auto-trust-anchor-file:/s,/etc/dnssec/root-anchors.txt,/etc/unbound/var/root-anchors.txt,' \
+ "${ED%/}/etc/unbound/unbound.conf" || \
+ die
+
+ find "${ED}" -name '*.la' -delete || die
+ if ! use static-libs ; then
+ find "${ED}" -name "*.a" -delete || die
+ fi
}
pkg_postinst() {
# make var/ writable by unbound
- if [[ -d "${ROOT}/etc/unbound/var" ]]; then
- chown --no-dereference --from=root unbound: "${ROOT}/etc/unbound/var"
+ if [[ -d "${EROOT%/}/etc/unbound/var" ]]; then
+ chown --no-dereference --from=root unbound: "${EROOT%/}/etc/unbound/var"
fi
+
einfo ""
einfo "If you want unbound to automatically update the root-anchor file for DNSSEC validation"
- einfo "set 'auto-trust-anchor-file: /etc/unbound/var/root-anchors.txt' in /etc/unbound/unbound.conf"
+ einfo "set 'auto-trust-anchor-file: ${EROOT%/}/etc/unbound/var/root-anchors.txt' in ${EROOT%/}/etc/unbound/unbound.conf"
einfo "and run"
einfo ""
- einfo " su -s /bin/sh -c '/usr/sbin/unbound-anchor -a /etc/unbound/var/root-anchors.txt' unbound"
+ einfo " su -s /bin/sh -c '${EROOT%/}/usr/sbin/unbound-anchor -a ${EROOT%/}/etc/unbound/var/root-anchors.txt' unbound"
einfo ""
einfo "as root to create it initially before starting unbound for the first time after enabling this."
einfo ""
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-EAPI=5
+EAPI="7"
PYTHON_COMPAT=( python2_7 )
-inherit eutils flag-o-matic multilib-minimal python-single-r1 systemd user
+inherit autotools flag-o-matic multilib-minimal python-single-r1 systemd user
MY_P=${PN}-${PV/_/}
DESCRIPTION="A validating, recursive and caching DNS resolver"
)
python? ( ${PYTHON_DEPS} )"
+BDEPEND="virtual/pkgconfig"
+
DEPEND="${CDEPEND}
python? ( dev-lang/swig )
test? (
dev-util/splint
app-text/wdiff
)
- systemd? ( sys-apps/systemd )
- virtual/pkgconfig"
+ systemd? ( sys-apps/systemd )"
RDEPEND="${CDEPEND}
+ net-dns/dnssec-root
selinux? ( sec-policy/selinux-bind )"
# bug #347415
RDEPEND="${RDEPEND}
net-dns/dnssec-root"
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.5.7-trust-anchor-file.patch
+)
+
S=${WORKDIR}/${MY_P}
pkg_setup() {
}
src_prepare() {
- # To avoid below error messages, set 'trust-anchor-file' to same value in
- # 'auto-trust-anchor-file'.
- # [23109:0] error: Could not open autotrust file for writing,
- # /etc/dnssec/root-anchors.txt: Permission denied
- epatch "${FILESDIR}"/${PN}-1.5.7-trust-anchor-file.patch
+ default
+
+ eautoreconf
# required for the python part
multilib_copy_sources
--enable-subnet \
--enable-tfo-client \
--enable-tfo-server \
- --with-libevent="${EPREFIX}"/usr \
- --with-pidfile="${EPREFIX}"/var/run/unbound.pid \
- --with-rootkey-file="${EPREFIX}"/etc/dnssec/root-anchors.txt \
- --with-ssl="${EPREFIX}"/usr \
- --with-libexpat="${EPREFIX}"/usr
+ --with-libevent="${EPREFIX%/}"/usr \
+ --with-pidfile="${EPREFIX%/}"/var/run/unbound.pid \
+ --with-rootkey-file="${EPREFIX%/}"/etc/dnssec/root-anchors.txt \
+ --with-ssl="${EPREFIX%/}"/usr \
+ --with-libexpat="${EPREFIX%/}"/usr
# http://unbound.nlnetlabs.nl/pipermail/unbound-users/2011-April/001801.html
# $(use_enable debug lock-checks) \
}
multilib_src_install_all() {
- prune_libtool_files --modules
use python && python_optimize
newinitd "${FILESDIR}"/unbound.initd unbound
# create space for auto-trust-anchor-file...
keepdir /etc/unbound/var
# ... and point example config to it
- sed -i '/# auto-trust-anchor-file:/s,/etc/dnssec/root-anchors.txt,/etc/unbound/var/root-anchors.txt,' "${ED}/etc/unbound/unbound.conf"
+ sed -i \
+ -e '/# auto-trust-anchor-file:/s,/etc/dnssec/root-anchors.txt,/etc/unbound/var/root-anchors.txt,' \
+ "${ED%/}/etc/unbound/unbound.conf" || \
+ die
+
+ find "${ED}" -name '*.la' -delete || die
+ if ! use static-libs ; then
+ find "${ED}" -name "*.a" -delete || die
+ fi
}
pkg_postinst() {
# make var/ writable by unbound
- if [[ -d "${ROOT}/etc/unbound/var" ]]; then
- chown --no-dereference --from=root unbound: "${ROOT}/etc/unbound/var"
+ if [[ -d "${EROOT%/}/etc/unbound/var" ]]; then
+ chown --no-dereference --from=root unbound: "${EROOT%/}/etc/unbound/var"
fi
+
einfo ""
einfo "If you want unbound to automatically update the root-anchor file for DNSSEC validation"
- einfo "set 'auto-trust-anchor-file: /etc/unbound/var/root-anchors.txt' in /etc/unbound/unbound.conf"
+ einfo "set 'auto-trust-anchor-file: ${EROOT%/}/etc/unbound/var/root-anchors.txt' in ${EROOT%/}/etc/unbound/unbound.conf"
einfo "and run"
einfo ""
- einfo " su -s /bin/sh -c '/usr/sbin/unbound-anchor -a /etc/unbound/var/root-anchors.txt' unbound"
+ einfo " su -s /bin/sh -c '${EROOT%/}/usr/sbin/unbound-anchor -a ${EROOT%/}/etc/unbound/var/root-anchors.txt' unbound"
einfo ""
einfo "as root to create it initially before starting unbound for the first time after enabling this."
einfo ""