From 7f0ed188ba2783aa3a461bc1564c2783cd47ed3f Mon Sep 17 00:00:00 2001 From: jca Date: Thu, 1 Jun 2017 13:42:01 +0000 Subject: [PATCH] Major update to knot-2.4.2 Upstream stopped supporting LTS 1.6.* releases. Let's move to the 2.x branch which only supports LMDB (patched to use MDB_WRITEMAP) and uses __thread (thus, needs clang or lang/gcc). The config format changed a bit, /usr/local/libexec/knot1to2 might help. Most work done by Alexis Vachette, ok fcambus@ --- net/knot/Makefile | 36 ++++---- net/knot/distinfo | 4 +- .../patches/patch-samples_knot_sample_conf_in | 34 +++---- net/knot/patches/patch-src_contrib_lmdb_mdb_c | 17 ++++ net/knot/patches/patch-src_libknot_lookup_h | 12 +++ net/knot/pkg/PLIST | 88 ++++++++++++++++++- net/knot/pkg/knot.rc | 4 +- 7 files changed, 150 insertions(+), 45 deletions(-) create mode 100644 net/knot/patches/patch-src_contrib_lmdb_mdb_c create mode 100644 net/knot/patches/patch-src_libknot_lookup_h diff --git a/net/knot/Makefile b/net/knot/Makefile index 869c7969d1e..26cf2bdbe55 100644 --- a/net/knot/Makefile +++ b/net/knot/Makefile @@ -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 +# $OpenBSD: Makefile,v 1.14 2017/06/01 13:42:01 jca Exp $ 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,32 @@ MAINTAINER = Pierre Emeriaud , \ # 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 +# Needs TLS emulation, and atomic builtins on arm +COMPILER = base gcc +COMPILER_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: diff --git a/net/knot/distinfo b/net/knot/distinfo index 82713d774a5..407ddceefbc 100644 --- a/net/knot/distinfo +++ b/net/knot/distinfo @@ -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 diff --git a/net/knot/patches/patch-samples_knot_sample_conf_in b/net/knot/patches/patch-samples_knot_sample_conf_in index 0178792078c..3d29ccb62a5 100644 --- a/net/knot/patches/patch-samples_knot_sample_conf_in +++ b/net/knot/patches/patch-samples_knot_sample_conf_in @@ -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 { +$OpenBSD: patch-samples_knot_sample_conf_in,v 1.2 2017/06/01 13:42:01 jca Exp $ +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. diff --git a/net/knot/patches/patch-src_contrib_lmdb_mdb_c b/net/knot/patches/patch-src_contrib_lmdb_mdb_c new file mode 100644 index 00000000000..331b1a05585 --- /dev/null +++ b/net/knot/patches/patch-src_contrib_lmdb_mdb_c @@ -0,0 +1,17 @@ +$OpenBSD: patch-src_contrib_lmdb_mdb_c,v 1.1 2017/06/01 13:42:01 jca Exp $ +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); diff --git a/net/knot/patches/patch-src_libknot_lookup_h b/net/knot/patches/patch-src_libknot_lookup_h new file mode 100644 index 00000000000..62b13a5697f --- /dev/null +++ b/net/knot/patches/patch-src_libknot_lookup_h @@ -0,0 +1,12 @@ +$OpenBSD: patch-src_libknot_lookup_h,v 1.1 2017/06/01 13:42:01 jca Exp $ +Index: src/libknot/lookup.h +--- src/libknot/lookup.h.orig ++++ src/libknot/lookup.h +@@ -25,6 +25,7 @@ + #pragma once + + #include ++#include + + /*! + * \brief A general purpose lookup table. diff --git a/net/knot/pkg/PLIST b/net/knot/pkg/PLIST index 9a7c062cbb3..de6e8dafc0d 100644 --- a/net/knot/pkg/PLIST +++ b/net/knot/pkg/PLIST @@ -1,23 +1,109 @@ -@comment $OpenBSD: PLIST,v 1.2 2015/04/12 16:26:10 jca Exp $ +@comment $OpenBSD: PLIST,v 1.3 2017/06/01 13:42:01 jca Exp $ @newgroup _knot:751 @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/ diff --git a/net/knot/pkg/knot.rc b/net/knot/pkg/knot.rc index e7268d26df8..f945657b4bd 100644 --- a/net/knot/pkg/knot.rc +++ b/net/knot/pkg/knot.rc @@ -1,10 +1,10 @@ #!/bin/sh # -# $OpenBSD: knot.rc,v 1.4 2015/04/14 06:38:23 ajacoutot Exp $ +# $OpenBSD: knot.rc,v 1.5 2017/06/01 13:42:01 jca Exp $ daemon="${PREFIX}/sbin/knotd -d" knotc="${PREFIX}/sbin/knotc" -knotcheckconf="${knotc} checkconf" +knotcheckconf="${knotc} conf-check" . /etc/rc.d/rc.subr