Hi, the update below has been prepared with Alexis Vachette. It makes use of an embedded copy of LMDB as store backend. Upstream knot already uses MDB_WRITEMAP on OpenBSD by default, I added another patch that always activates MDB_WRITEMAP in the lmdb sources. This would be needed if we ever activate the rosedb module.
Upstream has already released knot-2.4.3 but I want to stop delaying the update to the 2.X.Y branch. I do not use knot myself; Alexis successfully tested this on a master setup, but additional tests and reports are welcome, especially if you're migrating from knot-1.6.8. /usr/local/libexec/knot1to2 might help. Thanks to espie@ and sthen@ for the WANT_CXX hints. ok? Index: Makefile =================================================================== RCS file: /d/cvs/ports/net/knot/Makefile,v retrieving revision 1.13 diff -u -p -r1.13 Makefile --- Makefile 30 Dec 2016 15:47:55 -0000 1.13 +++ Makefile 26 May 2017 15:57:07 -0000 @@ -1,14 +1,12 @@ # $OpenBSD: Makefile,v 1.13 2016/12/30 15:47:55 jca Exp $ -PORTROACH = limit:^1\. skipv:1.99.1 -PORTROACH_COMMENT = knot-2.x uses __thread and lmdb - COMMENT = authoritative DNS server -DISTNAME = knot-1.6.8 +DISTNAME = knot-2.4.2 -SHARED_LIBS += zscanner 0.0 # .0.1 -SHARED_LIBS += knot 0.0 # .0.1 +SHARED_LIBS += zscanner 1.0 # .1.0 +SHARED_LIBS += knot 1.0 # .5.0 +SHARED_LIBS += dnssec 0.0 # .3.0 CATEGORIES = net @@ -20,30 +18,33 @@ MAINTAINER = Pierre Emeriaud <petrus.lt # GPLv3+ PERMIT_PACKAGE_CDROM = Yes -WANTLIB += c crypto idn m pthread urcu urcu-common z +WANTLIB += c curses edit ffi gmp gnutls hogweed idn idn2 jansson +WANTLIB += m nettle p11-kit pthread tasn1 unistring urcu urcu-common +WANTLIB += z MASTER_SITES = https://secure.nic.cz/files/knot-dns/ EXTRACT_SUFX = .tar.xz -MODULES = devel/gettext gcc4 -# for atomic builtins: __sync_add_and_fetch_4, __sync_sub_and_fetch_4 -MODGCC4_ARCHS = arm +MODULES = devel/gettext +# need TLS emulation, and atomic builtins on arm +WANT_CXX = base gcc +MODGCC4_LANGS = c BUILD_DEPENDS = devel/bison LIB_DEPENDS = devel/libidn \ - devel/liburcu + devel/liburcu \ + devel/jansson \ + security/gnutls USE_GMAKE = Yes USE_LIBTOOL= gnu CONFIGURE_STYLE = gnu CONFIGURE_ARGS += --with-storage=${LOCALSTATEDIR}/db/knot \ --with-libidn \ - --disable-dnstap \ - --disable-lmdb -CONFIGURE_ENV = CPPFLAGS="-I${LOCALBASE}/include" \ - LDFLAGS="-L${LOCALBASE}/lib" \ - ac_cv_path_PDFLATEX="false" \ + --disable-dnstap + +CONFIGURE_ENV = ac_cv_path_PDFLATEX="false" \ ac_cv_path_SPHINXBUILD="false" post-install: Index: distinfo =================================================================== RCS file: /d/cvs/ports/net/knot/distinfo,v retrieving revision 1.6 diff -u -p -r1.6 distinfo --- distinfo 11 Aug 2016 12:04:17 -0000 1.6 +++ distinfo 10 Apr 2017 17:06:01 -0000 @@ -1,2 +1,2 @@ -SHA256 (knot-1.6.8.tar.xz) = jZXf01n7GHKJ19CF4hfY+rtgIhNdNYE07UFlQYomkjc= -SIZE (knot-1.6.8.tar.xz) = 806748 +SHA256 (knot-2.4.2.tar.xz) = N9p/zx8ZS9Y3bGPYxPooohiZtWo/O2PbpwlXQKV1LFI= +SIZE (knot-2.4.2.tar.xz) = 1109156 Index: patches/patch-samples_knot_sample_conf_in =================================================================== RCS file: /d/cvs/ports/net/knot/patches/patch-samples_knot_sample_conf_in,v retrieving revision 1.1.1.1 diff -u -p -r1.1.1.1 patch-samples_knot_sample_conf_in --- patches/patch-samples_knot_sample_conf_in 12 Apr 2015 16:07:13 -0000 1.1.1.1 +++ patches/patch-samples_knot_sample_conf_in 26 May 2017 15:00:48 -0000 @@ -1,23 +1,13 @@ $OpenBSD: patch-samples_knot_sample_conf_in,v 1.1.1.1 2015/04/12 16:07:13 jca Exp $ ---- samples/knot.sample.conf.in.orig Tue Feb 10 23:44:11 2015 -+++ samples/knot.sample.conf.in Tue Feb 10 23:44:44 2015 -@@ -13,7 +13,7 @@ system { +Index: samples/knot.sample.conf.in +--- samples/knot.sample.conf.in.orig ++++ samples/knot.sample.conf.in +@@ -9,7 +9,7 @@ server: + # Listen on all configured IPv6 interfaces. + listen: ::@53 + # User for running the server. +- # user: knot:knot ++ user: _knot:_knot - # User for running server - # May also specify user.group (e.g. knot.knot) -- user knot.knot; -+ user _knot._knot; - - # Directory for storing run-time data - # e.g. PID file and control sockets -@@ -83,7 +83,7 @@ log { - } - - # Log warnings, errors and criticals to stderr -- stderr { -- any warning; -- } -+ #stderr { -+ # any warning; -+ #} - } + log: + # Log info and more serious events to syslog. Index: patches/patch-src_contrib_lmdb_mdb_c =================================================================== RCS file: patches/patch-src_contrib_lmdb_mdb_c diff -N patches/patch-src_contrib_lmdb_mdb_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-src_contrib_lmdb_mdb_c 26 May 2017 15:03:06 -0000 @@ -0,0 +1,17 @@ +$OpenBSD$ +Index: src/contrib/lmdb/mdb.c +--- src/contrib/lmdb/mdb.c.orig ++++ src/contrib/lmdb/mdb.c +@@ -4921,6 +4921,12 @@ mdb_env_open(MDB_env *env, const char *path, unsigned + if (env->me_fd!=INVALID_HANDLE_VALUE || (flags & ~(CHANGEABLE|CHANGELESS))) + return EINVAL; + ++ /* ++ * Always force MDB_WRITEMAP, the code does the right thing if ++ * asking for a read-only handle. ++ */ ++ flags |= MDB_WRITEMAP; ++ + flags |= env->me_flags; + + rc = mdb_fname_init(path, flags, &fname); Index: patches/patch-src_libknot_lookup_h =================================================================== RCS file: patches/patch-src_libknot_lookup_h diff -N patches/patch-src_libknot_lookup_h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-src_libknot_lookup_h 26 May 2017 15:03:06 -0000 @@ -0,0 +1,12 @@ +$OpenBSD$ +Index: src/libknot/lookup.h +--- src/libknot/lookup.h.orig ++++ src/libknot/lookup.h +@@ -25,6 +25,7 @@ + #pragma once + + #include <string.h> ++#include <strings.h> + + /*! + * \brief A general purpose lookup table. Index: pkg/PLIST =================================================================== RCS file: /d/cvs/ports/net/knot/pkg/PLIST,v retrieving revision 1.2 diff -u -p -r1.2 PLIST --- pkg/PLIST 12 Apr 2015 16:26:10 -0000 1.2 +++ pkg/PLIST 16 May 2017 01:29:36 -0000 @@ -3,21 +3,107 @@ @newuser _knot:751:_knot::Knot DNS Server:/var/empty:/sbin/nologin @bin bin/kdig @bin bin/khost +@bin bin/kjournalprint @bin bin/knsec3hash @bin bin/knsupdate +@bin bin/kzonecheck +include/dnssec/ +include/dnssec/binary.h +include/dnssec/crypto.h +include/dnssec/dnssec.h +include/dnssec/error.h +include/dnssec/event.h +include/dnssec/kasp.h +include/dnssec/key.h +include/dnssec/keyid.h +include/dnssec/keystate.h +include/dnssec/keystore.h +include/dnssec/keytag.h +include/dnssec/keyusage.h +include/dnssec/list.h +include/dnssec/nsec.h +include/dnssec/random.h +include/dnssec/sign.h +include/dnssec/tsig.h +include/dnssec/version.h +include/libknot/ +include/libknot/attribute.h +include/libknot/binary.h +include/libknot/codes.h +include/libknot/consts.h +include/libknot/control/ +include/libknot/control/control.h +include/libknot/cookies/ +include/libknot/cookies/alg-fnv64.h +include/libknot/cookies/client.h +include/libknot/cookies/server.h +include/libknot/db/ +include/libknot/db/db.h +include/libknot/db/db_lmdb.h +include/libknot/db/db_trie.h +include/libknot/descriptor.h +include/libknot/dname.h +include/libknot/errcode.h +include/libknot/error.h +include/libknot/libknot.h +include/libknot/lookup.h +include/libknot/mm_ctx.h +include/libknot/packet/ +include/libknot/packet/compr.h +include/libknot/packet/pkt.h +include/libknot/packet/rrset-wire.h +include/libknot/packet/wire.h +include/libknot/rdata.h +include/libknot/rdataset.h +include/libknot/rrset-dump.h +include/libknot/rrset.h +include/libknot/rrtype/ +include/libknot/rrtype/aaaa.h +include/libknot/rrtype/dnskey.h +include/libknot/rrtype/ds.h +include/libknot/rrtype/naptr.h +include/libknot/rrtype/nsec.h +include/libknot/rrtype/nsec3.h +include/libknot/rrtype/nsec3param.h +include/libknot/rrtype/opt-cookie.h +include/libknot/rrtype/opt.h +include/libknot/rrtype/rdname.h +include/libknot/rrtype/rrsig.h +include/libknot/rrtype/soa.h +include/libknot/rrtype/tsig.h +include/libknot/rrtype/txt.h +include/libknot/tsig-op.h +include/libknot/tsig.h +include/libknot/version.h +include/zscanner/ +include/zscanner/error.h +include/zscanner/scanner.h +include/zscanner/version.h +lib/libdnssec.a +lib/libdnssec.la +@lib lib/libdnssec.so.${LIBdnssec_VERSION} lib/libknot.a lib/libknot.la @lib lib/libknot.so.${LIBknot_VERSION} lib/libzscanner.a lib/libzscanner.la @lib lib/libzscanner.so.${LIBzscanner_VERSION} +lib/pkgconfig/libdnssec.pc +lib/pkgconfig/libknot.pc +lib/pkgconfig/libzscanner.pc +@bin libexec/knot1to2 @man man/man1/kdig.1 @man man/man1/khost.1 +@man man/man1/kjournalprint.1 +@man man/man1/knot1to2.1 @man man/man1/knsec3hash.1 @man man/man1/knsupdate.1 +@man man/man1/kzonecheck.1 @man man/man5/knot.conf.5 +@man man/man8/keymgr.8 @man man/man8/knotc.8 @man man/man8/knotd.8 +@bin sbin/keymgr @bin sbin/knotc @bin sbin/knotd share/examples/knot/ Index: pkg/knot.rc =================================================================== RCS file: /d/cvs/ports/net/knot/pkg/knot.rc,v retrieving revision 1.4 diff -u -p -r1.4 knot.rc --- pkg/knot.rc 14 Apr 2015 06:38:23 -0000 1.4 +++ pkg/knot.rc 10 Apr 2017 17:06:01 -0000 @@ -4,7 +4,7 @@ daemon="${PREFIX}/sbin/knotd -d" knotc="${PREFIX}/sbin/knotc" -knotcheckconf="${knotc} checkconf" +knotcheckconf="${knotc} conf-check" . /etc/rc.d/rc.subr -- jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE