aboutsummaryrefslogtreecommitdiff
path: root/dns/unbound
diff options
context:
space:
mode:
authorSteve Wills <swills@FreeBSD.org>2019-09-02 16:31:02 +0000
committerSteve Wills <swills@FreeBSD.org>2019-09-02 16:31:02 +0000
commit839e465ee8b45f73e4b487f191fafe69dc7506ce (patch)
treea17c27bc004a42baeb42753e10bbf2febcb743f4 /dns/unbound
parent3166ea0efc3482ab35348e15684c733e650061ab (diff)
downloadports-839e465ee8b45f73e4b487f191fafe69dc7506ce.tar.gz
ports-839e465ee8b45f73e4b487f191fafe69dc7506ce.zip
dns/unbound: update to 1.9.3
Whil here, improve rc script PR: 240163 Submitted by: Jaap Akkerhuis <jaap@NLnetLabs.nl> (maintainer)
Notes
Notes: svn path=/head/; revision=510824
Diffstat (limited to 'dns/unbound')
-rw-r--r--dns/unbound/Makefile3
-rw-r--r--dns/unbound/distinfo6
-rw-r--r--dns/unbound/files/unbound.in136
-rw-r--r--dns/unbound/pkg-plist2
4 files changed, 124 insertions, 23 deletions
diff --git a/dns/unbound/Makefile b/dns/unbound/Makefile
index 749422237ccc..d4545f1f0c70 100644
--- a/dns/unbound/Makefile
+++ b/dns/unbound/Makefile
@@ -2,8 +2,7 @@
# $FreeBSD$
PORTNAME= unbound
-PORTVERSION= 1.9.2
-PORTREVISION= 1
+PORTVERSION= 1.9.3
CATEGORIES= dns
MASTER_SITES= https://www.nlnetlabs.nl/downloads/unbound/ \
https://distfiles.crux.guru/
diff --git a/dns/unbound/distinfo b/dns/unbound/distinfo
index 56e104a3bc0b..03537b8a4487 100644
--- a/dns/unbound/distinfo
+++ b/dns/unbound/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1560919473
-SHA256 (unbound-1.9.2.tar.gz) = 6f7acec5cf451277fcda31729886ae7dd62537c4f506855603e3aa153fcb6b95
-SIZE (unbound-1.9.2.tar.gz) = 5676395
+TIMESTAMP = 1566901338
+SHA256 (unbound-1.9.3.tar.gz) = 1b55dd9170e4bfb327fb644de7bbf7f0541701149dff3adf1b63ffa785f16dfa
+SIZE (unbound-1.9.3.tar.gz) = 5686017
diff --git a/dns/unbound/files/unbound.in b/dns/unbound/files/unbound.in
index 00227bd9434a..42b1d5b3bdb6 100644
--- a/dns/unbound/files/unbound.in
+++ b/dns/unbound/files/unbound.in
@@ -2,41 +2,64 @@
#
# $FreeBSD$
#
-# unbound freebsd startup rc.d script, modified from the named script.
+# unbound freebsd startup rc.d script
# uses the default unbound installation path and pidfile location.
-# copy this to /etc/rc.d/unbound
+# copy this to %%PREFIX%%/etc/rc.d/unbound
# and put unbound_enable="YES" into rc.conf
#
# unbound_anchorflags can be used to allow you to pass a custom flags to
# unbound-anchor. Examples include a custom resolv.conf (-f) or a custom
# root.hints (-r). Useful for when /etc/resolv.conf only contains 127.0.0.1
-
+#
# PROVIDE: unbound
# REQUIRE: SERVERS cleanvar
# KEYWORD: shutdown
+#
+# Add the following line to /etc/rc.conf to enable unbound:
+#
+# unbound_enable="YES"
+#
+# You could set alternative config with
+# unbound_config="/path/to/config"
+#
+#
+# Multiple profiles are supported with
+#
+# unbound_profiles="name1 name2"
+# unbound_name1_enable="YES"
+# unbound_name1_config="/path/to/config1"
+# unbound_name2_enable="YES"
+# unbound_name2_config="/path/to/config2"
+#
+# A fib can be set for each profile as in
+# unbound_name1_fib=1
+#
. /etc/rc.subr
-name="unbound"
+name=unbound
rcvar=unbound_enable
-command="%%PREFIX%%/sbin/unbound"
-extra_commands="reload"
-start_precmd="start_precmd"
-
-load_rc_config $name
-
-pidfile=`%%PREFIX%%/sbin/unbound-checkconf -o pidfile ${unbound_conf}`
-unbound_enable=${unbound_enable:-"NO"}
-unbound_anchorflags=${unbound_anchorflags:-""}
-unbound_conf=${unbound_conf:-"%%ETCDIR%%/unbound.conf"}
-unbound_flags=${unbound_flags:-" -c ${unbound_conf}"}
+# setfib
+unbound_startfib() {
+ ${SYSCTL} net.fibs >/dev/null 2>&1 || return 0
-reload_precmd="%%PREFIX%%/sbin/unbound-checkconf ${unbound_conf} >/dev/null"
+ unbound_fib=${unbound_fib:-"NONE"}
+ case "$unbound_fib" in
+ [Nn][Oo][Nn][Ee])
+ ;;
+ *)
+ echo "Using fib #: " $unbound_fib .
+ command="setfib -F ${unbound_fib} ${command}"
+ ;;
+ esac
+}
start_precmd()
{
- echo -n "Obtaining a trust anchor:"
+ unbound_startfib
+
+ echo -n "Obtaining a trust anchor.."
if [ "${unbound_anchorflags}T" = "T" ]; then
su -m unbound -c %%PREFIX%%/sbin/unbound-anchor
else
@@ -47,4 +70,83 @@ start_precmd()
return $?
}
+# read settings, set default values
+load_rc_config "${name}"
+: ${unbound_enable:="NO"}
+: ${unbound_config:=%%PREFIX%%/etc/unbound/unbound.conf}
+
+# Set PID file
+pidfile=$(%%PREFIX%%/sbin/unbound-checkconf -o pidfile %%PREFIX%%/etc/unbound/unbound.conf)
+
+required_files=${unbound_config}
+command="%%PREFIX%%/sbin/${name}"
+command_args="-c ${unbound_config}"
+unbound_anchorflags=${unbound_anchorflags:-""}
+extra_commands="reload"
+start_precmd="start_precmd"
+reload_precmd="%%PREFIX%%/sbin/unbound-checkconf ${unbound_conf} >/dev/null"
+
+load_rc_config "${name}"
+
+if [ -n "$2" ]; then
+ profile="$2"
+ if [ "x${unbound_profiles}" != "x" ]; then
+ eval unbound_config="\${unbound_${profile}_config:-%%PREFIX%%/etc/unbound/unbound-${profile}.conf}"
+ eval unbound_fib="\${unbound_${profile}_fib:-${unbound_fib}}"
+ if [ "x${unbound_config}" = "x" ]; then
+ echo "You must define a configuration file (unbound_${profile}_config)"
+ exit 1
+ fi
+
+ # Replace default value with profile-based (defined in the config file)
+ _cfgpidfile=$(%%PREFIX%%/sbin/unbound-checkconf -o pidfile ${unbound_config})
+ _defaultpidfile=$(%%PREFIX%%/sbin/unbound-checkconf -o pidfile /dev/null)
+
+ if [ "x${_cfgpidfile}" = "x" -o "x${_cfgpidfile}" = "x${_defaultpidfile}" ] ; then
+ pidfile=${_defaultpidfile}
+ else
+ pidfile=${_cfgpidfile}
+ fi
+ required_files="${unbound_config}"
+ eval unbound_enable="\${unbound_${profile}_enable:-${unbound_enable}}"
+ command_args="-c ${unbound_config}"
+ else
+ echo "$0: extra argument ignored"
+ fi
+else
+ if [ "x${unbound_profiles}" != "x" -a "x$1" != "x" ]; then
+ for profile in ${unbound_profiles}; do
+ eval _enable="\${unbound_${profile}_enable}"
+ case "x${_enable:-${unbound_enable}}" in
+ x|x[Nn][Oo]|x[Nn][Oo][Nn][Ee])
+ continue
+ ;;
+ x[Yy][Ee][Ss])
+ ;;
+ *)
+ if test -z "$_enable"; then
+ _var=unbound_enable
+ else
+ _var=unbound_"${profile}"_enable
+ fi
+ echo "Bad value" \
+ "'${_enable:-${unbound_enable}}'" \
+ "for ${_var}. " \
+ "Profile ${profile} skipped."
+ continue
+ ;;
+ esac
+ echo "===> unbound profile: ${profile}"
+ %%PREFIX%%/etc/rc.d/unbound $1 ${profile}
+ retcode="$?"
+ if [ "0${retcode}" -ne 0 ]; then
+ failed="${profile} (${retcode}) ${failed:-}"
+ else
+ success="${profile} ${success:-}"
+ fi
+ done
+ exit 0
+ fi
+fi
+
run_rc_command "$1"
diff --git a/dns/unbound/pkg-plist b/dns/unbound/pkg-plist
index 4cfc4de8a2ba..ff2c7b6787f1 100644
--- a/dns/unbound/pkg-plist
+++ b/dns/unbound/pkg-plist
@@ -5,7 +5,7 @@ libdata/pkgconfig/libunbound.pc
lib/libunbound.a
lib/libunbound.so
lib/libunbound.so.8
-lib/libunbound.so.8.1.2
+lib/libunbound.so.8.1.3
%%PYTHON%%%%PYTHON_SITELIBDIR%%/_unbound.so
%%PYTHON%%%%PYTHON_SITELIBDIR%%/unbound.py
%%PYTHON%%%%PYTHON_SITELIBDIR%%/unboundmodule.py