aboutsummaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-support/unbound
diff options
context:
space:
mode:
Diffstat (limited to 'meta-networking/recipes-support/unbound')
-rw-r--r--meta-networking/recipes-support/unbound/unbound/0001-contrib-add-yocto-compatible-init-script.patch78
-rw-r--r--meta-networking/recipes-support/unbound/unbound/run-ptest17
-rw-r--r--meta-networking/recipes-support/unbound/unbound_1.13.2.bb44
-rw-r--r--meta-networking/recipes-support/unbound/unbound_1.21.0.bb65
4 files changed, 82 insertions, 122 deletions
diff --git a/meta-networking/recipes-support/unbound/unbound/0001-contrib-add-yocto-compatible-init-script.patch b/meta-networking/recipes-support/unbound/unbound/0001-contrib-add-yocto-compatible-init-script.patch
deleted file mode 100644
index 7168a352f7..0000000000
--- a/meta-networking/recipes-support/unbound/unbound/0001-contrib-add-yocto-compatible-init-script.patch
+++ /dev/null
@@ -1,78 +0,0 @@
-From 26614b6578056ec30b95013592e308bf24d924c2 Mon Sep 17 00:00:00 2001
-From: Beniamin Sandu <beniaminsandu@gmail.com>
-Date: Fri, 20 Nov 2020 23:00:20 +0200
-Subject: [PATCH] contrib: add yocto compatible init script
-
-Signed-off-by: Beniamin Sandu <beniaminsandu@gmail.com>
----
- contrib/unbound.init | 20 ++++++++++----------
- 1 file changed, 10 insertions(+), 10 deletions(-)
-
-diff --git a/contrib/unbound.init b/contrib/unbound.init
-index c5bb52bb..4eba752b 100644
---- a/contrib/unbound.init
-+++ b/contrib/unbound.init
-@@ -19,11 +19,11 @@
- ### END INIT INFO
-
- # Source function library.
--. /etc/rc.d/init.d/functions
-+. /etc/init.d/functions
-
- exec="/usr/sbin/unbound"
- prog="unbound"
--config="/var/unbound/unbound.conf"
-+config="/etc/unbound/unbound.conf"
- pidfile="/var/unbound/unbound.pid"
- rootdir="/var/unbound"
-
-@@ -54,14 +54,14 @@ start() {
- [ -e ${rootdir}/dev/log ] || touch ${rootdir}/dev/log
- mount --bind -n /dev/log ${rootdir}/dev/log >/dev/null 2>&1;
- fi;
-- if ! egrep -q '^/[^[:space:]]+[[:space:]]+'${rootdir}'/dev/urandom' /proc/mounts; then
-+ if ! egrep -q '^/[^[:space:]]+[[:space:]]+'${rootdir}'/dev/random' /proc/mounts; then
- [ -d ${rootdir}/dev ] || mkdir -p ${rootdir}/dev ;
-- [ -e ${rootdir}/dev/urandom ] || touch ${rootdir}/dev/urandom
-- mount --bind -n /dev/urandom ${rootdir}/dev/urandom >/dev/null 2>&1;
-+ [ -e ${rootdir}/dev/random ] || touch ${rootdir}/dev/random
-+ mount --bind -n /dev/random ${rootdir}/dev/random >/dev/null 2>&1;
- fi;
-
- # if not running, start it up here
-- daemon $exec
-+ daemonize $exec
- retval=$?
- echo
- [ $retval -eq 0 ] && touch $lockfile
-@@ -71,15 +71,15 @@ start() {
- stop() {
- echo -n $"Stopping $prog: "
- # stop it here, often "killproc $prog"
-- killproc -p $pidfile $prog
-+ killproc $prog
- retval=$?
- echo
- [ $retval -eq 0 ] && rm -f $lockfile
- if egrep -q '^/[^[:space:]]+[[:space:]]+'${rootdir}'/dev/log' /proc/mounts; then
- umount ${rootdir}/dev/log >/dev/null 2>&1
- fi;
-- if egrep -q '^/[^[:space:]]+[[:space:]]+'${rootdir}'/dev/urandom' /proc/mounts; then
-- umount ${rootdir}/dev/urandom >/dev/null 2>&1
-+ if egrep -q '^/[^[:space:]]+[[:space:]]+'${rootdir}'/dev/random' /proc/mounts; then
-+ umount ${rootdir}/dev/random >/dev/null 2>&1
- fi;
- return $retval
- }
-@@ -99,7 +99,7 @@ force_reload() {
-
- rh_status() {
- # run checks to determine if the service is running or use generic status
-- status -p $pidfile $prog
-+ status $prog
- }
-
- rh_status_q() {
---
-2.25.1
-
diff --git a/meta-networking/recipes-support/unbound/unbound/run-ptest b/meta-networking/recipes-support/unbound/unbound/run-ptest
new file mode 100644
index 0000000000..433a687c65
--- /dev/null
+++ b/meta-networking/recipes-support/unbound/unbound/run-ptest
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+cd tests || exit 1
+retVal=0
+./unittest
+./testbound -s
+for x in ./testdata/*.rpl; do
+ output="$(./testbound -p $x -o -vvvvv 2>&1)"
+ if test $? -eq 0; then
+ echo "$x :Pass"
+ else
+ echo "$output"
+ echo "$x :Fail"
+ retVal=1
+ fi
+done
+exit $retVal
diff --git a/meta-networking/recipes-support/unbound/unbound_1.13.2.bb b/meta-networking/recipes-support/unbound/unbound_1.13.2.bb
deleted file mode 100644
index 61a75d71f4..0000000000
--- a/meta-networking/recipes-support/unbound/unbound_1.13.2.bb
+++ /dev/null
@@ -1,44 +0,0 @@
-SUMMARY = "Unbound is a validating, recursive, and caching DNS resolver"
-DESCRIPTION = "Unbound's design is a set of modular components which incorporate \
- features including enhanced security (DNSSEC) validation, Internet Protocol \
- Version 6 (IPv6), and a client resolver library API as an integral part of the \
- architecture"
-
-HOMEPAGE = "https://www.unbound.net/"
-SECTION = "net"
-LICENSE = "BSD-3-Clause"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=5308494bc0590c0cb036afd781d78f06"
-
-SRC_URI = "git://github.com/NLnetLabs/unbound.git;protocol=http;branch=master;protocol=https \
- file://0001-contrib-add-yocto-compatible-init-script.patch \
-"
-SRCREV = "8e538dcaa8df2d0fab8ff3dcf94ac1f972450b66"
-
-inherit autotools pkgconfig systemd update-rc.d
-
-DEPENDS = "openssl libevent libtool-native bison-native expat"
-RDEPENDS:${PN} = "bash openssl-bin daemonize"
-
-S = "${WORKDIR}/git"
-
-EXTRA_OECONF = "--with-libexpat=${STAGING_EXECPREFIXDIR} \
- --with-ssl=${STAGING_EXECPREFIXDIR}"
-
-
-PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'largefile systemd', d)}"
-PACKAGECONFIG[dnscrypt] = "--enable-dnscrypt, --disable-dnscrypt, libsodium"
-PACKAGECONFIG[largefile] = "--enable-largefile,--disable-largefile,,"
-PACKAGECONFIG[systemd] = "--enable-systemd,--disable-systemd,systemd"
-
-do_install:append() {
- install -d ${D}${systemd_unitdir}/system
- install -m 0644 ${B}/contrib/unbound.service ${D}${systemd_unitdir}/system
-
- install -d ${D}${sysconfdir}/init.d
- install -m 0755 ${S}/contrib/unbound.init ${D}${sysconfdir}/init.d/unbound
-}
-
-SYSTEMD_SERVICE:${PN} = "${BPN}.service"
-
-INITSCRIPT_NAME = "unbound"
-INITSCRIPT_PARAMS = "defaults"
diff --git a/meta-networking/recipes-support/unbound/unbound_1.21.0.bb b/meta-networking/recipes-support/unbound/unbound_1.21.0.bb
new file mode 100644
index 0000000000..8c042dc5f4
--- /dev/null
+++ b/meta-networking/recipes-support/unbound/unbound_1.21.0.bb
@@ -0,0 +1,65 @@
+SUMMARY = "Unbound is a validating, recursive, and caching DNS resolver"
+DESCRIPTION = "Unbound's design is a set of modular components which incorporate \
+ features including enhanced security (DNSSEC) validation, Internet Protocol \
+ Version 6 (IPv6), and a client resolver library API as an integral part of the \
+ architecture"
+
+HOMEPAGE = "https://www.unbound.net/"
+SECTION = "net"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=5308494bc0590c0cb036afd781d78f06"
+
+SRC_URI = "git://github.com/NLnetLabs/unbound.git;protocol=https;branch=master \
+ file://run-ptest \
+ "
+SRCREV = "79e4c578518886a32475cfbb0de383ff3a905033"
+
+inherit autotools pkgconfig systemd update-rc.d ptest
+
+DEPENDS = "openssl libtool-native bison-native expat"
+RDEPENDS:${PN} = "bash openssl-bin daemonize"
+
+S = "${WORKDIR}/git"
+
+EXTRA_OECONF = "--with-libexpat=${STAGING_EXECPREFIXDIR} \
+ --with-ssl=${STAGING_EXECPREFIXDIR} \
+ --enable-largefile"
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
+PACKAGECONFIG[dnscrypt] = "--enable-dnscrypt, --disable-dnscrypt, libsodium"
+PACKAGECONFIG[systemd] = "--enable-systemd,--disable-systemd,systemd"
+PACKAGECONFIG[libevent] = "--with-libevent=${STAGING_EXECPREFIXDIR},,libevent"
+
+do_configure:append() {
+ sed -i -e 's#${RECIPE_SYSROOT}##g' ${B}/config.h
+}
+
+do_compile:append() {
+ oe_runmake tests
+}
+
+do_install:append() {
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${B}/contrib/unbound.service ${D}${systemd_unitdir}/system
+
+ install -d ${D}${sysconfdir}/init.d
+ install -m 0755 ${S}/contrib/unbound.init_yocto ${D}${sysconfdir}/init.d/unbound
+}
+
+do_install_ptest() {
+ install -d ${D}${PTEST_PATH}/tests
+ install -d ${D}${PTEST_PATH}/tests/testdata
+
+ install -m 0544 ${B}/unittest ${D}${PTEST_PATH}/tests/
+ install -m 0544 ${B}/testbound ${D}${PTEST_PATH}/tests/
+ install -m 0664 ${S}/testdata/test_signatures* ${D}${PTEST_PATH}/tests/
+ install -m 0664 ${S}/testdata/test_sigs* ${D}${PTEST_PATH}/tests/
+ install -m 0664 ${S}/testdata/test_ds* ${D}${PTEST_PATH}/tests/
+ install -m 0664 ${S}/testdata/test_nsec3_hash* ${D}${PTEST_PATH}/tests/
+ install -m 0644 ${S}/testdata/*.rpl ${D}/${PTEST_PATH}/tests/testdata/
+}
+
+SYSTEMD_SERVICE:${PN} = "${BPN}.service"
+
+INITSCRIPT_NAME = "unbound"
+INITSCRIPT_PARAMS = "defaults"