net-dns/unbound: bump EAPI to EAPI=7
authorThomas Deutschmann <whissi@gentoo.org>
Fri, 14 Sep 2018 15:17:39 +0000 (17:17 +0200)
committerThomas Deutschmann <whissi@gentoo.org>
Fri, 14 Sep 2018 22:03:37 +0000 (00:03 +0200)
Package-Manager: Portage-2.3.49, Repoman-2.3.10

net-dns/unbound/files/unbound-1.5.7-trust-anchor-file.patch
net-dns/unbound/unbound-1.7.3-r1.ebuild [moved from net-dns/unbound/unbound-1.7.3.ebuild with 76% similarity]
net-dns/unbound/unbound-1.8.0-r1.ebuild [moved from net-dns/unbound/unbound-1.8.0.ebuild with 77% similarity]

index c4c0ffa3d6d1dfec54ec9720d0b36e3e49412c04..85879db3cf286790b56369d3fdd59bf382ceaf69 100644 (file)
@@ -1,3 +1,9 @@
+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
similarity index 76%
rename from net-dns/unbound/unbound-1.7.3.ebuild
rename to net-dns/unbound/unbound-1.7.3-r1.ebuild
index 9edf230ed88dffbe36bb515bc0429c7338593b26..6e815d9ab60a90cf57bfe38721e9b0eaf765191d 100644 (file)
@@ -1,10 +1,10 @@
 # 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"
@@ -36,6 +36,8 @@ CDEPEND=">=dev-libs/expat-2.1.0-r3[${MULTILIB_USEDEP}]
        )
        python? ( ${PYTHON_DEPS} )"
 
+BDEPEND="virtual/pkgconfig"
+
 DEPEND="${CDEPEND}
        python? ( dev-lang/swig )
        test? (
@@ -43,16 +45,20 @@ DEPEND="${CDEPEND}
                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() {
@@ -68,11 +74,9 @@ 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
@@ -97,11 +101,11 @@ multilib_src_configure() {
                $(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) \
@@ -111,7 +115,6 @@ multilib_src_configure() {
 }
 
 multilib_src_install_all() {
-       prune_libtool_files --modules
        use python && python_optimize
 
        newinitd "${FILESDIR}"/unbound.initd unbound
@@ -136,20 +139,29 @@ multilib_src_install_all() {
        # 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 ""
similarity index 77%
rename from net-dns/unbound/unbound-1.8.0.ebuild
rename to net-dns/unbound/unbound-1.8.0-r1.ebuild
index 3f81f97d29d433de87602118106e0d3c7fcf2f3e..ff0faa9ad65af4c4baf92c7679bf08c913aea33a 100644 (file)
@@ -1,10 +1,10 @@
 # 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"
@@ -36,6 +36,8 @@ CDEPEND=">=dev-libs/expat-2.1.0-r3[${MULTILIB_USEDEP}]
        )
        python? ( ${PYTHON_DEPS} )"
 
+BDEPEND="virtual/pkgconfig"
+
 DEPEND="${CDEPEND}
        python? ( dev-lang/swig )
        test? (
@@ -43,16 +45,20 @@ DEPEND="${CDEPEND}
                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() {
@@ -68,11 +74,9 @@ 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
@@ -102,11 +106,11 @@ multilib_src_configure() {
                --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) \
@@ -116,7 +120,6 @@ multilib_src_configure() {
 }
 
 multilib_src_install_all() {
-       prune_libtool_files --modules
        use python && python_optimize
 
        newinitd "${FILESDIR}"/unbound.initd unbound
@@ -141,20 +144,29 @@ multilib_src_install_all() {
        # 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 ""