summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKurt Jaeger <pi@FreeBSD.org>2020-07-11 20:57:41 +0000
committerKurt Jaeger <pi@FreeBSD.org>2020-07-11 20:57:41 +0000
commit542f7ceaf52d496aa6d5c52f614feeac4ec5dc3c (patch)
tree2b00b6c92e62824f22774c6eba695fa07867835a
parent6f10b9e8b32b7ee9e28585486b925e4536fdc78d (diff)
downloadfreebsd-ports-542f7ceaf52d496aa6d5c52f614feeac4ec5dc3c.zip
dns/knot-resolver: update 5.1.1 -> 5.1.2
PR: 247699 Submitted by: Leo Vandewoestijne <freebsd@dns.company> (maintainer) andrew@tao11.riddles.org.uk Relnotes: https://www.knot-resolver.cz/2020-07-01-knot-resolver-5.1.2.html
-rw-r--r--dns/knot-resolver/Makefile137
-rw-r--r--dns/knot-resolver/distinfo6
-rw-r--r--dns/knot-resolver/files/krescachegc.in35
-rw-r--r--dns/knot-resolver/files/kresd.in37
-rw-r--r--dns/knot-resolver/files/patch-etc_meson.build14
-rw-r--r--dns/knot-resolver/files/patch-meson.build11
-rw-r--r--dns/knot-resolver/files/pkg-message.in5
-rw-r--r--dns/knot-resolver/pkg-descr10
-rw-r--r--dns/knot-resolver/pkg-plist12
9 files changed, 193 insertions, 74 deletions
diff --git a/dns/knot-resolver/Makefile b/dns/knot-resolver/Makefile
index af56050982fa..d98d431a4892 100644
--- a/dns/knot-resolver/Makefile
+++ b/dns/knot-resolver/Makefile
@@ -2,7 +2,7 @@
# $FreeBSD$
PORTNAME= knot-resolver
-DISTVERSION= 5.1.1
+DISTVERSION= 5.1.2
CATEGORIES= dns
MASTER_SITES= https://secure.nic.cz/files/knot-resolver/ \
https://dns.company/downloads/knot-resolver/
@@ -14,23 +14,26 @@ LICENSE= GPLv3+
LICENSE_FILE= ${WRKSRC}/COPYING
BUILD_DEPENDS= bash:shells/bash \
- cmocka>=1.1.1:sysutils/cmocka \
flake8:devel/py-flake8@${PY_FLAVOR} \
- luacheck:devel/lua-luacheck
-
-LIB_DEPENDS= libgnutls.so:security/gnutls \
- libknot.so:dns/knot2-lib \
+ lua51-cqueues>=20200603_1:devel/lua-cqueues@lua51 \
+ luacheck:devel/lua-luacheck \
+ cmake:devel/cmake
+LIB_DEPENDS= libknot.so:dns/knot2-lib \
+ libdnssec.so:dns/knot2-lib \
+ libzscanner.so:dns/knot2-lib \
+ libgnutls.so:security/gnutls \
liblmdb.so:databases/lmdb \
libluajit-5.1.so:lang/luajit-openresty \
libuv.so:devel/libuv
+RUN_DEPENDS= lua51-cqueues>=20200603_1:devel/lua-cqueues@lua51
+
+USES= compiler:c11 compiler:c++11-lang libedit libtool \
+ meson ncurses ninja pkgconfig python:3.5+,build \
+ shebangfix tar:xz
-USES= compiler:c11 compiler:c++11-lang libedit libtool meson \
- ncurses ninja pkgconfig python shebangfix tar:xz
USE_CXXSTD= c++11
-USE_LDCONFIG= yes
-LDFLAGS+= -L${LOCALBASE}/lib
-SUB_FILES= pkg-message
+USE_RC_SUBR= krescachegc kresd
SHEBANG_FILES= scripts/bench.sh \
scripts/build-in-obs.sh \
@@ -50,64 +53,83 @@ SHEBANG_FILES= scripts/bench.sh \
scripts/test-integration-prepare.sh \
scripts/update-root-hints.sh
-CONFLICTS= knot-1.* knot1-[0-6].*
-
MESON_ARGS= --buildtype=release \
--default-library=static \
+ --libdir=${PREFIX}/lib \
+ --pkg-config-path=${PREFIX}/libdata/pkgconfig \
--prefix=${LOCALBASE} \
-Duser=${USERS} \
-Dgroup=${GROUPS} \
-Dinstall_kresd_conf=enabled \
-Dclient=enabled \
-Dutils=enabled \
- -Dinstall_root_keys=enabled \
-Dkeyfile_default=${ETCDIR}/root.keys \
- -Dmanaged_ta=enabled \
- -Droot_hints=${ETCDIR}/root.hints \
- -Dunit_tests=enabled
-
-# --libdir=${PREFIX}/lib
-# --pkg-config-path=${PREFIX}/libdata/pkgconfig
-# lmdb_CFLAGS=-I${PREFIX}/include lmdb_LIBS=-llmdb
-# -Dlmdb_CFLAGS=-I${PREFIX}/include \ # doesn't help
-# -Dlmdb_LIBS=-llmdb # doesn't help
-# -Dconfig_tests=enabled \ # complains about missing cqueues lua package
-# -Dextra_tests=enabled \ # also requires -Dsendmmsg=disabled
-
-OPTIONS_DEFINE= DOCS DNSTAP DOXYGEN TRUSTANCHOR
-OPTIONS_DEFAULT= DOCS DNSTAP DOXYGEN
-
-# docs/meson.build wants python2 or python3 - not -for example- python3.7
-# So this currently is partially broken:
-#DOCS_MESON_ON= -Ddoc=enabled
-
-DNSTAP_DESC= dnstap support
-DNSTAP_LIB_DEPENDS= libprotobuf.so:devel/protobuf \
- libprotobuf-c.so:devel/protobuf-c \
- libfstrm.so:devel/fstrm
-DNSTAP_PLIST_FILES= lib/knot-resolver/kres_modules/dnstap.so
-DNSTAP_MESON_ON= -Ddnstap=enabled
-DNSTAP_MESON_OFF= -Ddnstap=disabled
-
-DOXYGEN_IMPLIES= DOCS
-DOXYGEN_BUILD_DEPENDS= doxygen:devel/doxygen \
- ${PY_SPHINX} \
- ${PYTHON_PKGNAMEPREFIX}sphinx_rtd_theme>0:textproc/py-sphinx_rtd_theme@${PY_FLAVOR}
-
-TRUSTANCHOR_DESC= Trust anchor bootstrapping and stats
-TRUSTANCHOR_USES= lua
-TRUSTANCHOR_BUILD_DEPENDS= ${LUA_PKGNAMEPREFIX}luasocket>=0:net/luasocket@${LUA_FLAVOR} \
- ${LUA_PKGNAMEPREFIX}luasec>=0:security/luasec@${LUA_FLAVOR}
-
-.include <bsd.port.options.mk>
+ -Droot_hints=${ETCDIR}/root.hints
+
+LDFLAGS+= -L${LOCALBASE}/lib
+
+CONFLICTS= knot-1.* knot1-[0-6].*
+
+SUB_FILES= pkg-message
+
+SUB_LIST= USERS=${USERS} \
+ GROUPS=${GROUPS} \
+ RUNDIR=${RUNDIR}
USERS= kresd
-GROUPS= ${USERS}
+GROUPS= kresd
+RUNDIR= /var/run/kresd
+
+PLIST_SUB= USERS=${USERS} \
+ GROUPS=${GROUPS} \
+ RUNDIR=${RUNDIR}
+
+OPTIONS_DEFINE= DOCS EXAMPLES DNSTAP ROOTKEYS TRUSTANCHOR TEST TESTUNIT TESTCONF TESTEXTRA
+OPTIONS_DEFAULT= DOCS EXAMPLES ROOTKEYS TRUSTANCHOR TEST TESTUNIT TESTCONF
+
+DNSTAP_DESC= dnstap support
+ROOTKEYS_DESC= install root.keys
+TESTCONF_DESC= Do config tests
+TESTEXTRA_DESC= Do extra tests
+TESTUNIT_DESC= Do unit tests
+TEST_DESC= Do tests
+TRUSTANCHOR_DESC= Trust anchor bootstrapping, management and stats
+
+DNSTAP_LIB_DEPENDS= libprotobuf.so:devel/protobuf \
+ libprotobuf-c.so:devel/protobuf-c \
+ libfstrm.so:devel/fstrm
+DNSTAP_MESON_ON= -Ddnstap=enabled
+DNSTAP_MESON_OFF= -Ddnstap=disabled
+DNSTAP_PLIST_FILES= lib/knot-resolver/kres_modules/dnstap.so
+
+ROOTKEYS_MESON_ON= -Dinstall_root_keys=enabled
+ROOTKEYS_MESON_OFF= -Dinstall_root_keys=disabled
+ROOTKEYS_PLIST_FILES= ${ETCDIR}/root.keys
+
+TESTCONF_MESON_ON= -Dconfig_tests=enabled
+TESTCONF_MESON_OFF= -Dconfig_tests=disabled
+
+TESTEXTRA_BROKEN= CMake Error: The source directory misses CMakeLists.txt
+TESTEXTRA_BUILD_DEPENDS=git:devel/git
+TESTEXTRA_USES= cmake python:3
+TESTEXTRA_MESON_ON= -Dextra_tests=enabled \
+ -Dsendmmsg=disabled
+TESTEXTRA_MESON_OFF= -Dextra_tests=disabled
+
+TESTUNIT_BUILD_DEPENDS= cmocka>=1.1.1:sysutils/cmocka
+TESTUNIT_MESON_ON= -Dunit_tests=enabled
+TESTUNIT_MESON_OFF= -Dunit_tests=disabled
+
+TRUSTANCHOR_MESON_ON= -Dmanaged_ta=enabled
+TRUSTANCHOR_MESON_OFF= -Dmanaged_ta=disabled
PORTDOCS= AUTHORS COPYING CodingStyle NEWS README.md
+PORTEXAMPLES= config.cluster config.docker config.internal config.isp \
+ config.personal config.privacy config.splitview
-STRIP_TARGETS= sbin/kresd \
+STRIP_TARGETS= sbin/kres-cache-gc \
sbin/kresc \
+ sbin/kresd \
lib/knot-resolver/ahocorasick.so \
lib/knot-resolver/kres_modules/bogus_log.so \
lib/knot-resolver/kres_modules/dnstap.so \
@@ -117,14 +139,17 @@ STRIP_TARGETS= sbin/kresd \
lib/knot-resolver/kres_modules/refuse_nord.so \
lib/knot-resolver/kres_modules/stats.so
+pre-install:
+ ${MKDIR} ${STAGEDIR}${DOCSDIR}
+ ${MKDIR} ${STAGEDIR}${RUNDIR}
+
pre-install-TEST-on: do-test
post-install:
- @${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${PORTDOCS:S,^,${WRKSRC}/,} ${STAGEDIR}${DOCSDIR}/
.for STRIP_TGT in ${STRIP_TARGETS}
if [ -f ${STAGEDIR}${PREFIX}/${STRIP_TGT} ]; then \
- ${STRIP_CMD} ${STAGEDIR}${PREFIX}/${STRIP_TGT}; \
+ ${STRIP_CMD} ${STAGEDIR}${PREFIX}/${STRIP_TGT}; \
fi
.endfor
diff --git a/dns/knot-resolver/distinfo b/dns/knot-resolver/distinfo
index a1114acc37d3..5ed793ee8a69 100644
--- a/dns/knot-resolver/distinfo
+++ b/dns/knot-resolver/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1589914626
-SHA256 (knot-resolver-5.1.1.tar.xz) = f72214046df8aae2b1a5c6d1ad0bc8b166aa060df5b008f6e88b4f6ba79cbf4e
-SIZE (knot-resolver-5.1.1.tar.xz) = 1744544
+TIMESTAMP = 1593645886
+SHA256 (knot-resolver-5.1.2.tar.xz) = caa4f941caf39080184554fb1310f383eba4b30d9c4c2215670d6b0a2de8f836
+SIZE (knot-resolver-5.1.2.tar.xz) = 1749236
diff --git a/dns/knot-resolver/files/krescachegc.in b/dns/knot-resolver/files/krescachegc.in
new file mode 100644
index 000000000000..435303b24203
--- /dev/null
+++ b/dns/knot-resolver/files/krescachegc.in
@@ -0,0 +1,35 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# PROVIDE: krescachegc
+# REQUIRE: SERVERS cleanvar
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf to enable knot-resolver:
+#
+# krescachegc_enable="YES": Set to YES to enable krescachegc.
+# Set to NO by default.
+# krescachegc_millis="1000": Set to garbage collect interval in milliseconds
+# Set to 1000 by default.
+#
+
+. /etc/rc.subr
+
+name=krescachegc
+rcvar=krescachegc_enable
+
+load_rc_config ${name}
+
+# set defaults
+
+krescachegc_enable=${krescachegc_enable:-"NO"}
+krescachegc_millis=${krescachegc_millis:-"1000"}
+
+pidfile="%%RUNDIR%%/${name}.pid"
+procname="%%PREFIX%%/sbin/kres-cache-gc"
+
+command=/usr/sbin/daemon
+command_args="-c -f -r -P ${pidfile} -u %%USERS%% -- ${procname} -c %%RUNDIR%% -d ${krescachegc_millis}"
+
+run_rc_command "$1"
diff --git a/dns/knot-resolver/files/kresd.in b/dns/knot-resolver/files/kresd.in
new file mode 100644
index 000000000000..a9564262a366
--- /dev/null
+++ b/dns/knot-resolver/files/kresd.in
@@ -0,0 +1,37 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# PROVIDE: kresd
+# REQUIRE: NETWORKING
+# BEFORE: SERVERS
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf to enable knot-resolver:
+#
+# kresd_enable="YES": Set to YES to enable kresd.
+# Set to NO by default.
+# kresd_config="": Set to %%ETCDIR%%/kresd.conf
+# by default.
+#
+
+. /etc/rc.subr
+
+name=kresd
+rcvar=kresd_enable
+
+load_rc_config ${name}
+
+# set defaults
+
+kresd_enable=${kresd_enable:-"NO"}
+kresd_config=${kresd_config:-"%%ETCDIR%%/${name}.conf"}
+
+pidfile="%%RUNDIR%%/${name}.pid"
+procname="%%PREFIX%%/sbin/${name}"
+required_files="${kresd_config}"
+
+command="/usr/sbin/daemon"
+command_args="-c -f -S -r -P ${pidfile} -- ${procname} -c ${kresd_config} -n -q %%RUNDIR%%"
+
+run_rc_command "$1"
diff --git a/dns/knot-resolver/files/patch-etc_meson.build b/dns/knot-resolver/files/patch-etc_meson.build
new file mode 100644
index 000000000000..f918c3e4f8ab
--- /dev/null
+++ b/dns/knot-resolver/files/patch-etc_meson.build
@@ -0,0 +1,14 @@
+--- etc/meson.build.orig 2020-07-01 12:27:52 UTC
++++ etc/meson.build
+@@ -7,9 +7,9 @@ if install_root_hints
+ etc_files += 'root.hints'
+ endif
+
+-if managed_ta
++#if managed_ta
+ etc_files += 'icann-ca.pem'
+-endif
++#endif
+
+ if install_root_keys
+ root_keys_path = keyfile_default.split('/')
diff --git a/dns/knot-resolver/files/patch-meson.build b/dns/knot-resolver/files/patch-meson.build
new file mode 100644
index 000000000000..87a828241e4b
--- /dev/null
+++ b/dns/knot-resolver/files/patch-meson.build
@@ -0,0 +1,11 @@
+--- meson.build.orig 2020-07-01 12:27:52 UTC
++++ meson.build
+@@ -47,7 +47,7 @@ endif
+ prefix = get_option('prefix')
+ data_dir = join_paths(prefix, get_option('datadir'), 'knot-resolver')
+ doc_dir = join_paths(prefix, get_option('datadir'), 'doc', 'knot-resolver')
+-examples_dir = join_paths(doc_dir, 'examples')
++examples_dir = join_paths(prefix, 'share', 'examples', 'knot-resolver')
+ etc_dir = join_paths(prefix, get_option('sysconfdir'), 'knot-resolver')
+ lib_dir = join_paths(prefix, get_option('libdir'), 'knot-resolver')
+ modules_dir = join_paths(lib_dir, 'kres_modules')
diff --git a/dns/knot-resolver/files/pkg-message.in b/dns/knot-resolver/files/pkg-message.in
index ff7ba777af08..57a03bdd6e96 100644
--- a/dns/knot-resolver/files/pkg-message.in
+++ b/dns/knot-resolver/files/pkg-message.in
@@ -6,11 +6,8 @@
- man kresd
- https://knot-resolver.readthedocs.io/
- To run as daemon see:
- - https://knot-resolver.readthedocs.io/en/latest/daemon.html
-
If upgrading:
- - https://knot-resolver.readthedocs.io/en/stable/upgrading.html
+ - https://knot-resolver.readthedocs.io/en/latest/upgrading.html
EOM
}
]
diff --git a/dns/knot-resolver/pkg-descr b/dns/knot-resolver/pkg-descr
index 91459c3a424d..d37ace7a4ebf 100644
--- a/dns/knot-resolver/pkg-descr
+++ b/dns/knot-resolver/pkg-descr
@@ -1,4 +1,10 @@
-The Knot DNS Resolver is a caching full resolver implementation,
-including both a resolver library and a daemon.
+Knot Resolver is a caching DNS resolver scalable from huge resolver
+farms down to home network routers.
+Knot Resolver is a modern resolver implementation designed for
+scalability, resiliency, and flexibility. Its design is
+different from other resolvers: The core architecture is tiny and
+efficient, and most of the rich features are implemented as
+optional modules, which limits attack surface and improves
+performance.
WWW: https://www.knot-resolver.cz/
diff --git a/dns/knot-resolver/pkg-plist b/dns/knot-resolver/pkg-plist
index 19e21c1667a4..17b0717784db 100644
--- a/dns/knot-resolver/pkg-plist
+++ b/dns/knot-resolver/pkg-plist
@@ -1,7 +1,6 @@
+@sample %%ETCDIR%%/kresd.conf
%%ETCDIR%%/icann-ca.pem
-%%ETCDIR%%/kresd.conf
%%ETCDIR%%/root.hints
-%%ETCDIR%%/root.keys
include/libkres/api.h
include/libkres/array.h
include/libkres/cdb_api.h
@@ -91,10 +90,5 @@ man/man8/kresd.8.gz
sbin/kres-cache-gc
sbin/kresc
sbin/kresd
-%%PORTDOCS%%%%DOCSDIR%%/examples/config.cluster
-%%PORTDOCS%%%%DOCSDIR%%/examples/config.docker
-%%PORTDOCS%%%%DOCSDIR%%/examples/config.internal
-%%PORTDOCS%%%%DOCSDIR%%/examples/config.isp
-%%PORTDOCS%%%%DOCSDIR%%/examples/config.personal
-%%PORTDOCS%%%%DOCSDIR%%/examples/config.privacy
-%%PORTDOCS%%%%DOCSDIR%%/examples/config.splitview
+@dir(%%USERS%%,%%GROUPS%%,0755) %%ETCDIR%%
+@dir(%%USERS%%,%%GROUPS%%,0755) %%RUNDIR%%