Commit 0c16c95c authored by Mateusz Piotrowski's avatar Mateusz Piotrowski

dns/dnsdist: Update to 1.4.0

- Lint Makefile
- Some configure switches changed from --enable to --with
- Rename FSTRM to DNSTAP
- Add DoH support
- Switch to LuaJIT-Openresty (when LUAJIT is selected instead of LUA)
- Remove unnecessary patch (files/patch-dnsdist-lua-vars.cc)
- Major improvement in the rc script: allowing multiple daemons
- Start using -C and %%ETCDIR%% causing the default path for dnsdist.conf
  changes to usually /usr/local/etc/dnsdist/ in which you can store single
  or multiple config files, includes, key-files for DNSCrypt, key/certs for
  DoH, etc.

Also, change maintainer to Ralf van der Enden.

Changelog:
https://dnsdist.org/changelog.html

PR:		242125
Submitted by:	Jørn Åne de Jong, Ralf van der Enden, Leo Vandewoestijne
Reviewed by:	[email protected], Sascha Biberhofer, Yann Kerherve
Approved by:	maintainer


git-svn-id: svn+ssh://svn.freebsd.org/ports/[email protected] 35697150-7ecd-e111-bb59-0022644237b5
parent 6b713237
......@@ -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= [email protected]
MAINTAINER= [email protected]
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>
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
......@@ -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"
--- 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>{
sbin/dnsdist
man/man1/dnsdist.1.gz
@sample etc/dnsdist.conf.sample
@sample etc/dnsdist/dnsdist.conf.sample
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment