View | Details | Raw Unified | Return to bug 242125 | Differences between
and this patch

Collapse All | Expand All

(-)Makefile (-22 / +25 lines)
Lines 2-14 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	dnsdist
4
PORTNAME=	dnsdist
5
DISTVERSION=	1.3.3
5
DISTVERSION=	1.4.0
6
PORTREVISION=	12
7
CATEGORIES=	dns net
6
CATEGORIES=	dns net
8
MASTER_SITES=	https://downloads.powerdns.com/releases/ \
7
MASTER_SITES=	https://downloads.powerdns.com/releases/
9
		LOCAL/cpm
10
8
11
MAINTAINER=	cpm@FreeBSD.org
9
MAINTAINER=	tremere@cainites.net
12
COMMENT=	Highly DNS-, DoS- and abuse-aware loadbalancer
10
COMMENT=	Highly DNS-, DoS- and abuse-aware loadbalancer
13
11
14
LICENSE=	GPLv2 UNLICENSE
12
LICENSE=	GPLv2 UNLICENSE
Lines 18-35 Link Here
18
16
19
BUILD_DEPENDS=	${LOCALBASE}/lib/libatomic_ops.a:devel/libatomic_ops
17
BUILD_DEPENDS=	${LOCALBASE}/lib/libatomic_ops.a:devel/libatomic_ops
20
LIB_DEPENDS=	libboost_serialization.so:devel/boost-libs \
18
LIB_DEPENDS=	libboost_serialization.so:devel/boost-libs \
19
		libh2o-evloop.so:www/h2o \
21
		libprotobuf.so:devel/protobuf \
20
		libprotobuf.so:devel/protobuf \
22
		libre2.so:devel/re2 \
21
		libre2.so:devel/re2 \
23
		libsodium.so:security/libsodium
22
		libsodium.so:security/libsodium
24
23
25
GNU_CONFIGURE=	yes
26
USES=		bison compiler:c++14-lang cpe gmake libedit libtool localbase \
24
USES=		bison compiler:c++14-lang cpe gmake libedit libtool localbase \
27
		pkgconfig tar:bz2
25
		pkgconfig tar:bz2
26
USE_RC_SUBR=	dnsdist
27
28
GNU_CONFIGURE=	yes
28
CONFIGURE_ARGS=	--bindir=${PREFIX}/sbin \
29
CONFIGURE_ARGS=	--bindir=${PREFIX}/sbin \
30
		--enable-dns-over-https \
29
		--enable-dns-over-tls \
31
		--enable-dns-over-tls \
30
		--enable-dnscrypt \
32
		--enable-dnscrypt \
31
		--enable-libsodium \
33
		--sysconfdir=${PREFIX}/etc/dnsdist \
32
		--enable-re2
34
		--with-libsodium \
35
		--with-re2
33
36
34
INSTALL_TARGET=	install-strip
37
INSTALL_TARGET=	install-strip
35
38
Lines 36-71 Link Here
36
USERS=		_dnsdist
39
USERS=		_dnsdist
37
GROUPS=		_dnsdist
40
GROUPS=		_dnsdist
38
41
39
USE_RC_SUBR=	dnsdist
42
OPTIONS_DEFINE=		DNSTAP LUAJIT SNMP
40
41
OPTIONS_DEFINE=		FSTRM LUAJIT SNMP
42
OPTIONS_DEFAULT=	GNUTLS OPENSSL
43
OPTIONS_DEFAULT=	GNUTLS OPENSSL
43
OPTIONS_MULTI=		TLS
44
OPTIONS_MULTI=		TLS
44
OPTIONS_MULTI_TLS=	GNUTLS OPENSSL
45
OPTIONS_MULTI_TLS=	GNUTLS OPENSSL
45
46
46
FSTRM_DESC=		dnstap support (see dnstap.info)
47
DNSTAP_DESC=	dnstap support (see dnstap.info)
47
LUAJIT_DESC=		Use LuaJIT instead of Lua
48
LUAJIT_DESC=	Use LuaJIT instead of Lua
48
49
49
FSTRM_LIB_DEPENDS=	libfstrm.so:devel/fstrm
50
DNSTAP_LIB_DEPENDS=		libfstrm.so:devel/fstrm
50
FSTRM_CONFIGURE_ENABLE=	fstrm
51
DNSTAP_CONFIGURE_ENABLE=	fstrm
51
52
52
GNUTLS_LIB_DEPENDS=	libgnutls.so:security/gnutls
53
GNUTLS_LIB_DEPENDS=		libgnutls.so:security/gnutls
53
GNUTLS_CONFIGURE_ENABLE=gnutls
54
GNUTLS_CONFIGURE_ENABLE=	gnutls
54
55
55
LUAJIT_LIB_DEPENDS=	libluajit-5.1.so:lang/luajit
56
LUAJIT_LIB_DEPENDS=	libluajit-5.1.so:lang/luajit-openresty
56
LUAJIT_USES_OFF=	lua
57
LUAJIT_USES_OFF=	lua
58
LUAJIT_CONFIGURE_OFF=	--with-lua=lua-${LUA_VER}
57
LUAJIT_CONFIGURE_ON=	--with-lua=luajit
59
LUAJIT_CONFIGURE_ON=	--with-lua=luajit
58
LUAJIT_CONFIGURE_OFF=	--with-lua=lua-${LUA_VER}
59
60
60
OPENSSL_USES=		ssl
61
OPENSSL_USES=		ssl
61
OPENSSL_CONFIGURE_ENABLE=libssl
62
OPENSSL_CONFIGURE_ON=	LIBSSL_CFLAGS=-I${OPENSSLINC} \
62
OPENSSL_CONFIGURE_ON=	LIBSSL_CFLAGS=-I${OPENSSLINC} LIBSSL_LIBS="-L${OPENSSLLIB} -lssl"
63
			LIBSSL_LIBS="-L${OPENSSLLIB} -lssl"
64
OPENSSL_CONFIGURE_WITH=	libssl
63
65
64
SNMP_LIB_DEPENDS=	libnetsnmp.so:net-mgmt/net-snmp
66
SNMP_LIB_DEPENDS=	libnetsnmp.so:net-mgmt/net-snmp
65
SNMP_CONFIGURE_WITH=	net-snmp
67
SNMP_CONFIGURE_WITH=	net-snmp
66
68
67
post-install:
69
post-install:
70
	${MKDIR} ${STAGEDIR}${PREFIX}/etc/dnsdist
68
	${INSTALL_DATA} ${FILESDIR}/dnsdist.conf.sample \
71
	${INSTALL_DATA} ${FILESDIR}/dnsdist.conf.sample \
69
		${STAGEDIR}${PREFIX}/etc
72
		${STAGEDIR}${PREFIX}/etc/dnsdist/
70
73
71
.include <bsd.port.mk>
74
.include <bsd.port.mk>
(-)distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1541860683
1
TIMESTAMP = 1579127277
2
SHA256 (dnsdist-1.3.3.tar.bz2) = 9fb24f9032025955169f3c6e9b0a05b6aa9d6441ec47da08d22de1c1aa23e8cf
2
SHA256 (dnsdist-1.4.0.tar.bz2) = a336fa2c3eb381c2464d9d9790014fd6d4505029ed2c1b73ee1dc9115a2f1dc0
3
SIZE (dnsdist-1.3.3.tar.bz2) = 971253
3
SIZE (dnsdist-1.4.0.tar.bz2) = 1044479
(-)files/dnsdist.in (-6 / +72 lines)
Lines 3-14 Link Here
3
# $FreeBSD$
3
# $FreeBSD$
4
#
4
#
5
# PROVIDE: dnsdist
5
# PROVIDE: dnsdist
6
# REQUIRE: NETWORKING DAEMON
6
# REQUIRE: DAEMON NETWORKING
7
# KEYWORD: shutdown
7
# KEYWORD: shutdown
8
#
8
#
9
# Add the following line to /etc/rc.conf to enable dnsdist:
9
# Add the following line to /etc/rc.conf to enable dnsdist:
10
#
10
#
11
# dnsdist_enable="YES"
11
# dnsdist_enable="YES"
12
#
13
# Multiple profiles are supported with
14
#
15
# dnsdist_profiles="name1 name2"
16
# dnsdist_name1_enable="YES"
17
# dnsdist_name1_config="/path/to/config1"
18
# dnsdist_name2_enable="YES"
19
# dnsdist_name2_config="/path/to/config2"
20
#
21
# This script does't validate uid/gid per profile (yet)
22
# It still uses the default or definition of
23
# dnsdist_priv_user and/or dnsdist_priv_group
24
#
12
25
13
. /etc/rc.subr
26
. /etc/rc.subr
14
27
Lines 18-31 Link Here
18
31
19
load_rc_config ${name}
32
load_rc_config ${name}
20
33
34
: ${dnsdist_enable:=NO}
35
: ${dnsdist_config:=%%ETCDIR%%/dnsdist.conf}
21
: ${dnsdist_priv_user:=_dnsdist}
36
: ${dnsdist_priv_user:=_dnsdist}
22
: ${dnsdist_priv_group:=_dnsdist}
37
: ${dnsdist_priv_group:=_dnsdist}
23
: ${dnsdist_enable:=NO}
24
38
25
pidfile=/var/run/${name}.pid
39
pidfile="/var/run/${name}.pid"
26
40
required_files=${dnsdist_config}
41
actual_command="%%PREFIX%%/sbin/${name} -C ${dnsdist_config} -u ${dnsdist_priv_user} -g ${dnsdist_priv_group} --supervised"
27
command=/usr/sbin/daemon
42
command=/usr/sbin/daemon
28
actual_command=/usr/local/sbin/${name}
43
command_args="-c -f -r -P ${pidfile} -- ${actual_command}"
29
command_args="-c -f -r -P ${pidfile} ${actual_command} -u ${dnsdist_priv_user} -g ${dnsdist_priv_group} --supervised"
30
44
45
if [ -n "$2" ]; then
46
	profile="$2"
47
	if [ "x${dnsdist_profiles}" != "x" ]; then
48
		eval dnsdist_config="\${dnsdist_${profile}_config:-%%ETCDIR%%/dnsdist-${profile}.conf}"
49
		if [ "x${dnsdist_config}" = "x" ]; then
50
			echo "You must define a configuration file (dnsdist_${profile}_config)"
51
			exit 1
52
		fi
53
		eval dnsdist_enable="\${dnsdist_${profile}_enable:-${dnsdist_enable}}"
54
		pidfile="/var/run/${name}-${profile}.pid"
55
		required_files="${dnsdist_config}"
56
		actual_command="%%PREFIX%%/sbin/${name} -C ${dnsdist_config} -u ${dnsdist_priv_user} -g ${dnsdist_priv_group} --supervised"
57
		command_args="-c -f -r -P ${pidfile} -- ${actual_command}"
58
	else
59
		echo "$0: extra argument ignored"
60
	fi
61
else
62
	if [ "x${dnsdist_profiles}" != "x" -a "x$1" != "x" ]; then
63
		for profile in ${dnsdist_profiles}; do
64
			eval _enable="\${dnsdist_${profile}_enable}"
65
			case "x${_enable:-${dnsdist_enable}}" in
66
			x|x[Nn][Oo]|x[Nn][Oo][Nn][Ee])
67
				continue
68
				;;
69
			x[Yy][Ee][Ss])
70
				;;
71
			*)
72
				if test -z "$_enable"; then
73
					_var=dnsdist_enable
74
				else
75
					_var=dnsdist_"${profile}"_enable
76
				fi
77
				echo "Bad value" \
78
					"'${_enable:-${dnsdist_enable}}'" \
79
					"for ${_var}. " \
80
					"Profile ${profile} skipped."
81
				continue
82
				;;
83
			esac
84
			echo "===> dnsdist profile: ${profile}"
85
			%%PREFIX%%/etc/rc.d/dnsdist $1 ${profile}
86
			retcode="$?"
87
			if [ "0${retcode}" -ne 0 ]; then
88
				failed="${profile} (${retcode}) ${failed:-}"
89
			else
90
				success="${profile} ${success:-}"
91
		fi
92
		done
93
		exit 0
94
	fi
95
fi
96
31
run_rc_command "$1"
97
run_rc_command "$1"
(-)files/patch-dnsdist-lua-vars.cc (-11 lines)
Lines 1-11 Link Here
1
--- dnsdist-lua-vars.cc.orig	2018-10-03 09:48:10 UTC
2
+++ dnsdist-lua-vars.cc
3
@@ -22,6 +22,8 @@
4
 #include "dnsdist.hh"
5
 #include "ednsoptions.hh"
6
 
7
+#undef BADSIG // signal.h SIG_ERR
8
+
9
 void setupLuaVars()
10
 {
11
   g_lua.writeVariable("DNSAction", std::unordered_map<string,int>{
(-)pkg-plist (-1 / +1 lines)
Lines 1-3 Link Here
1
sbin/dnsdist
1
sbin/dnsdist
2
man/man1/dnsdist.1.gz
2
man/man1/dnsdist.1.gz
3
@sample etc/dnsdist.conf.sample
3
@sample etc/dnsdist/dnsdist.conf.sample

Return to bug 242125