aboutsummaryrefslogtreecommitdiff
path: root/dns/dnsdist
diff options
context:
space:
mode:
authorMateusz Piotrowski <0mp@FreeBSD.org>2020-02-04 10:38:44 +0000
committerMateusz Piotrowski <0mp@FreeBSD.org>2020-02-04 10:38:44 +0000
commite7e9048f05bcdf07315743df7dc5d58623983dc6 (patch)
tree47f4b5859f4b84a84218fa22e5003ea0fa0cd169 /dns/dnsdist
parent95d1107cce67f6673618fcf44267becdb9a61bae (diff)
downloadports-e7e9048f05bcdf07315743df7dc5d58623983dc6.tar.gz
ports-e7e9048f05bcdf07315743df7dc5d58623983dc6.zip
Notes
Diffstat (limited to 'dns/dnsdist')
-rw-r--r--dns/dnsdist/Makefile48
-rw-r--r--dns/dnsdist/distinfo6
-rw-r--r--dns/dnsdist/files/dnsdist.in78
-rw-r--r--dns/dnsdist/files/patch-dnsdist-lua-vars.cc11
-rw-r--r--dns/dnsdist/pkg-plist2
5 files changed, 101 insertions, 44 deletions
diff --git a/dns/dnsdist/Makefile b/dns/dnsdist/Makefile
index 450f186886cb..1b8ac49b9ffc 100644
--- a/dns/dnsdist/Makefile
+++ b/dns/dnsdist/Makefile
@@ -2,13 +2,11 @@
# $FreeBSD$
PORTNAME= dnsdist
-DISTVERSION= 1.3.3
-PORTREVISION= 13
+DISTVERSION= 1.4.0
CATEGORIES= dns net
-MASTER_SITES= https://downloads.powerdns.com/releases/ \
- LOCAL/cpm
+MASTER_SITES= https://downloads.powerdns.com/releases/
-MAINTAINER= cpm@FreeBSD.org
+MAINTAINER= tremere@cainites.net
COMMENT= Highly DNS-, DoS- and abuse-aware loadbalancer
LICENSE= GPLv2 UNLICENSE
@@ -18,54 +16,58 @@ LICENSE_FILE_UNLICENSE= ${WRKSRC}/ext/incbin/UNLICENSE
BUILD_DEPENDS= ${LOCALBASE}/lib/libatomic_ops.a:devel/libatomic_ops
LIB_DEPENDS= libboost_serialization.so:devel/boost-libs \
+ libh2o-evloop.so:www/h2o \
libprotobuf.so:devel/protobuf \
libre2.so:devel/re2 \
libsodium.so:security/libsodium
-GNU_CONFIGURE= yes
USES= bison compiler:c++14-lang cpe gmake libedit libtool localbase \
pkgconfig tar:bz2
+USE_RC_SUBR= dnsdist
+
+GNU_CONFIGURE= yes
CONFIGURE_ARGS= --bindir=${PREFIX}/sbin \
+ --enable-dns-over-https \
--enable-dns-over-tls \
--enable-dnscrypt \
- --enable-libsodium \
- --enable-re2
+ --sysconfdir=${ETCDIR} \
+ --with-libsodium \
+ --with-re2
INSTALL_TARGET= install-strip
USERS= _dnsdist
GROUPS= _dnsdist
-USE_RC_SUBR= dnsdist
-
-OPTIONS_DEFINE= FSTRM LUAJIT SNMP
+OPTIONS_DEFINE= DNSTAP LUAJIT SNMP
OPTIONS_DEFAULT= GNUTLS OPENSSL
OPTIONS_MULTI= TLS
OPTIONS_MULTI_TLS= GNUTLS OPENSSL
-FSTRM_DESC= dnstap support (see dnstap.info)
-LUAJIT_DESC= Use LuaJIT instead of Lua
+DNSTAP_DESC= dnstap support (see dnstap.info)
+LUAJIT_DESC= Use LuaJIT instead of Lua
-FSTRM_LIB_DEPENDS= libfstrm.so:devel/fstrm
-FSTRM_CONFIGURE_ENABLE= fstrm
+DNSTAP_LIB_DEPENDS= libfstrm.so:devel/fstrm
+DNSTAP_CONFIGURE_ENABLE= fstrm
-GNUTLS_LIB_DEPENDS= libgnutls.so:security/gnutls
-GNUTLS_CONFIGURE_ENABLE=gnutls
+GNUTLS_LIB_DEPENDS= libgnutls.so:security/gnutls
+GNUTLS_CONFIGURE_ENABLE= gnutls
-LUAJIT_LIB_DEPENDS= libluajit-5.1.so:lang/luajit
+LUAJIT_LIB_DEPENDS= libluajit-5.1.so:lang/luajit-openresty
LUAJIT_USES_OFF= lua
-LUAJIT_CONFIGURE_ON= --with-lua=luajit
LUAJIT_CONFIGURE_OFF= --with-lua=lua-${LUA_VER}
+LUAJIT_CONFIGURE_ON= --with-lua=luajit
OPENSSL_USES= ssl
-OPENSSL_CONFIGURE_ENABLE=libssl
-OPENSSL_CONFIGURE_ON= LIBSSL_CFLAGS=-I${OPENSSLINC} LIBSSL_LIBS="-L${OPENSSLLIB} -lssl"
+OPENSSL_CONFIGURE_ON= LIBSSL_CFLAGS=-I${OPENSSLINC} \
+ LIBSSL_LIBS="-L${OPENSSLLIB} -lssl"
+OPENSSL_CONFIGURE_WITH= libssl
SNMP_LIB_DEPENDS= libnetsnmp.so:net-mgmt/net-snmp
SNMP_CONFIGURE_WITH= net-snmp
post-install:
- ${INSTALL_DATA} ${FILESDIR}/dnsdist.conf.sample \
- ${STAGEDIR}${PREFIX}/etc
+ @${MKDIR} ${STAGEDIR}${ETCDIR}
+ ${INSTALL_DATA} ${FILESDIR}/dnsdist.conf.sample ${STAGEDIR}${ETCDIR}
.include <bsd.port.mk>
diff --git a/dns/dnsdist/distinfo b/dns/dnsdist/distinfo
index 8623bf7834f0..c588fdfc745f 100644
--- a/dns/dnsdist/distinfo
+++ b/dns/dnsdist/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1541860683
-SHA256 (dnsdist-1.3.3.tar.bz2) = 9fb24f9032025955169f3c6e9b0a05b6aa9d6441ec47da08d22de1c1aa23e8cf
-SIZE (dnsdist-1.3.3.tar.bz2) = 971253
+TIMESTAMP = 1579127277
+SHA256 (dnsdist-1.4.0.tar.bz2) = a336fa2c3eb381c2464d9d9790014fd6d4505029ed2c1b73ee1dc9115a2f1dc0
+SIZE (dnsdist-1.4.0.tar.bz2) = 1044479
diff --git a/dns/dnsdist/files/dnsdist.in b/dns/dnsdist/files/dnsdist.in
index 5d5d23a023dc..abf03ec8649f 100644
--- a/dns/dnsdist/files/dnsdist.in
+++ b/dns/dnsdist/files/dnsdist.in
@@ -3,12 +3,25 @@
# $FreeBSD$
#
# PROVIDE: dnsdist
-# REQUIRE: NETWORKING DAEMON
+# REQUIRE: DAEMON NETWORKING
# KEYWORD: shutdown
#
# Add the following line to /etc/rc.conf to enable dnsdist:
#
# dnsdist_enable="YES"
+#
+# Multiple profiles are supported with
+#
+# dnsdist_profiles="name1 name2"
+# dnsdist_name1_enable="YES"
+# dnsdist_name1_config="/path/to/config1"
+# dnsdist_name2_enable="YES"
+# dnsdist_name2_config="/path/to/config2"
+#
+# This script does't validate uid/gid per profile (yet)
+# It still uses the default or definition of
+# dnsdist_priv_user and/or dnsdist_priv_group
+#
. /etc/rc.subr
@@ -18,14 +31,67 @@ rcvar=dnsdist_enable
load_rc_config ${name}
+: ${dnsdist_enable:=NO}
+: ${dnsdist_config:=%%ETCDIR%%/dnsdist.conf}
: ${dnsdist_priv_user:=_dnsdist}
: ${dnsdist_priv_group:=_dnsdist}
-: ${dnsdist_enable:=NO}
-
-pidfile=/var/run/${name}.pid
+pidfile="/var/run/${name}.pid"
+required_files=${dnsdist_config}
+actual_command="%%PREFIX%%/sbin/${name} -C ${dnsdist_config} -u ${dnsdist_priv_user} -g ${dnsdist_priv_group} --supervised"
command=/usr/sbin/daemon
-actual_command=/usr/local/sbin/${name}
-command_args="-c -f -r -P ${pidfile} ${actual_command} -u ${dnsdist_priv_user} -g ${dnsdist_priv_group} --supervised"
+command_args="-c -f -r -P ${pidfile} -- ${actual_command}"
+
+if [ -n "$2" ]; then
+ profile="$2"
+ if [ "x${dnsdist_profiles}" != "x" ]; then
+ eval dnsdist_config="\${dnsdist_${profile}_config:-%%ETCDIR%%/dnsdist-${profile}.conf}"
+ if [ "x${dnsdist_config}" = "x" ]; then
+ echo "You must define a configuration file (dnsdist_${profile}_config)" >&2
+ exit 1
+ fi
+ eval dnsdist_enable="\${dnsdist_${profile}_enable:-${dnsdist_enable}}"
+ pidfile="/var/run/${name}-${profile}.pid"
+ required_files="${dnsdist_config}"
+ actual_command="%%PREFIX%%/sbin/${name} -C ${dnsdist_config} -u ${dnsdist_priv_user} -g ${dnsdist_priv_group} --supervised"
+ command_args="-c -f -r -P ${pidfile} -- ${actual_command}"
+ else
+ echo "$0: extra argument ignored" >&2
+ fi
+else
+ if [ "x${dnsdist_profiles}" != "x" -a "x$1" != "x" ]; then
+ for profile in ${dnsdist_profiles}; do
+ eval _enable="\${dnsdist_${profile}_enable}"
+ case "x${_enable:-${dnsdist_enable}}" in
+ x|x[Nn][Oo]|x[Nn][Oo][Nn][Ee])
+ continue
+ ;;
+ x[Yy][Ee][Ss])
+ ;;
+ *)
+ if test -z "$_enable"; then
+ _var=dnsdist_enable
+ else
+ _var=dnsdist_"${profile}"_enable
+ fi
+ echo "Bad value" \
+ "'${_enable:-${dnsdist_enable}}'" \
+ "for ${_var}. " \
+ "Profile ${profile} skipped." >&2
+ continue
+ ;;
+ esac
+ echo "===> dnsdist profile: ${profile}" >&2
+ %%PREFIX%%/etc/rc.d/dnsdist $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/dnsdist/files/patch-dnsdist-lua-vars.cc b/dns/dnsdist/files/patch-dnsdist-lua-vars.cc
deleted file mode 100644
index 935c691f228b..000000000000
--- a/dns/dnsdist/files/patch-dnsdist-lua-vars.cc
+++ /dev/null
@@ -1,11 +0,0 @@
---- dnsdist-lua-vars.cc.orig 2018-10-03 09:48:10 UTC
-+++ dnsdist-lua-vars.cc
-@@ -22,6 +22,8 @@
- #include "dnsdist.hh"
- #include "ednsoptions.hh"
-
-+#undef BADSIG // signal.h SIG_ERR
-+
- void setupLuaVars()
- {
- g_lua.writeVariable("DNSAction", std::unordered_map<string,int>{
diff --git a/dns/dnsdist/pkg-plist b/dns/dnsdist/pkg-plist
index 84caac4a6aaf..404219c4755d 100644
--- a/dns/dnsdist/pkg-plist
+++ b/dns/dnsdist/pkg-plist
@@ -1,3 +1,3 @@
sbin/dnsdist
man/man1/dnsdist.1.gz
-@sample etc/dnsdist.conf.sample
+@sample etc/dnsdist/dnsdist.conf.sample