commit:     e77e694f3a347d31e6a999750c3532f1745d44c4
Author:     Nicolas PARLANT <nicolas.parlant <AT> parhuet <DOT> fr>
AuthorDate: Thu Sep 18 14:20:22 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Sep 20 09:15:43 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e77e694f

net-dns/knot: add 3.5.0

relicense w/ GPL2+
new subslot
add redis support for daemon with dev-libs/hiredis
remove -latomic for riscv (seems no longer required for a long time,
but it’s been tested now).

Signed-off-by: Nicolas PARLANT <nicolas.parlant <AT> parhuet.fr>
Part-of: https://github.com/gentoo/gentoo/pull/43849
Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-dns/knot/Manifest                              |   3 +
 net-dns/knot/files/knot-3.5.0-full_redis_opt.patch |  62 ++++++
 net-dns/knot/knot-3.5.0.ebuild                     | 242 +++++++++++++++++++++
 net-dns/knot/metadata.xml                          |   3 +
 4 files changed, 310 insertions(+)

diff --git a/net-dns/knot/Manifest b/net-dns/knot/Manifest
index bdead198cee0..e7966641c34b 100644
--- a/net-dns/knot/Manifest
+++ b/net-dns/knot/Manifest
@@ -4,3 +4,6 @@ DIST knot-3.4.7.tar.xz.asc 833 BLAKE2B 
2b0a073f3c5ed1ae4f7fb3078361ee39c9427650c
 DIST knot-3.4.8-manpages.tar.xz 37756 BLAKE2B 
19eff0aa04988619f3950c3d983992558b25a7c24cc690b5c85b44a5839004e4b50db17008eb183e3bd5012856d6b9aa9dbad70ec57a707ba3333acdbebd00d3
 SHA512 
3fd1826a10cdb94690c1e457e6b12abc47b8338e0873fd6ca1e3d15f1e83e544da1db98e2d0ddb90e190d8e0ff878980a0da23537ff1af54c52cdbd2bdbd4a06
 DIST knot-3.4.8.tar.xz 1656224 BLAKE2B 
493fb10965fc8ec037b2e89652f18b35e2f5f655423663fd88aa87385ff8d1333203914d64b87b2ad21f6ccee61e8c50a886b6b4bd04ad8597ed734002919d3e
 SHA512 
62fb62e07c751bbc63759c0c74e3967b6a245bb0c76770e109b2c1bacf1580be98315ce3ecac8adfbdd37beab7b300a06078c44e57a1189def9efbc48b8d2c3e
 DIST knot-3.4.8.tar.xz.asc 833 BLAKE2B 
0bdcfd3a9ada6c9b09a418bd1686f30e08aadefcbafab786c3073f855c2f958ed3b7b563a7f6d1561d89735787b4e331fa4b37b93a2edc89a99c476cde628c6b
 SHA512 
55900f6cd9963299066597da6eab2be61a9a8fb7acd562b24a6883466e132372b99fc9e9643aef39566d2eff5fec27850fed0d8b97ca8ea417626ef5c90481e1
+DIST knot-3.5.0-manpages.tar.xz 39928 BLAKE2B 
af806daf42697354136f0edf5cb7b6f659468e28c3aa8d0ea33748051e346542e86b1721e1d9c4cbfa09f9fa584422734dbcd9073a732721e959a66f0c3b138c
 SHA512 
0612a9e65d0059d7d7bc37e5647a970bf0b7dd08683318b188f58d3c6a29e0260e14d70f15bc022363696c9b47a78b25922f3b1d62c6da06c19c347f3a419d7e
+DIST knot-3.5.0.tar.xz 1716348 BLAKE2B 
681de5b8947de9d104e949ac99f15cacea7be36f3c1a03c0328aa2894222c920b37bc1123afd1705fb2430def912287cfe0c760e9e4862d430477a7da4fdf314
 SHA512 
740c8f2d92921e68de3e2e62b7c714bad7ca41884e59236df02e5935889cc4f2102d8693dda2b700e1bfafda71d8760ec4337cc80d42c493d37eef5d0516d1ad
+DIST knot-3.5.0.tar.xz.asc 833 BLAKE2B 
e183ed714215df6e18bdfe839a085e7be5a7a411097a8de6632eed3330a2d4f031bbbdac37345d9ed97f9eefba61dcb7996d6a7eeef6d5dc4260007cd4251903
 SHA512 
44675f89bcb6186bf96f8297ffc898bbb08b7a33470038797abee5b3eadc8e20c321e2bebb43ac7b2cb560beccbbf4dca5446b0964de89670cf63e0c7c910aff

diff --git a/net-dns/knot/files/knot-3.5.0-full_redis_opt.patch 
b/net-dns/knot/files/knot-3.5.0-full_redis_opt.patch
new file mode 100644
index 000000000000..008fd4f1bca3
--- /dev/null
+++ b/net-dns/knot/files/knot-3.5.0-full_redis_opt.patch
@@ -0,0 +1,62 @@
+PR merged
+https://gitlab.nic.cz/knot/knot-dns/-/merge_requests/1808.patch
+From bd5df719f331c5aa78fbd1ca1dadfe6dd727b94d Mon Sep 17 00:00:00 2001
+From: Nicolas PARLANT <[email protected]>
+Date: Fri, 19 Sep 2025 10:36:55 +0200
+Subject: [PATCH] Make redis fully optional
+
+Add options :
+*client (only) for a knot package
+*module (only) for a redis-knot package
+--- a/configure.ac
++++ b/configure.ac
+@@ -261,21 +261,23 @@ AS_IF([test "$enable_reuseport" = yes],[
+ 
+ # Redis zone backend support
+ AC_ARG_ENABLE([redis],
+-   AS_HELP_STRING([--enable-redis=auto|yes|no], [enable Redis support 
[default=auto]]),
++   AS_HELP_STRING([--enable-redis=auto|yes|client|module|no], [enable Redis 
support [default=auto]]),
+    [], [enable_redis=auto])
+ 
+ PKG_CHECK_MODULES([hiredis], [hiredis], [have_hiredis=yes], [have_hiredis=no])
+ 
+ AS_CASE([$enable_redis],
+-   [auto], [AS_IF([test "$have_hiredis" = "yes"], [enable_redis=yes], 
[enable_redis=no])],
+-   [yes],  [AS_IF([test "$have_hiredis" = "yes"], [enable_redis=yes], 
[AC_MSG_ERROR([libhiredis not available])])],
++   [auto],   [AS_IF([test "$have_hiredis" = "yes"], [enable_redis=yes], 
[enable_redis=no])],
++   [yes],    [AS_IF([test "$have_hiredis" = "yes"], [enable_redis=yes], 
[AC_MSG_ERROR([libhiredis not available])])],
++   [client], [AS_IF([test "$have_hiredis" = "yes"], [enable_redis=client], 
[AC_MSG_ERROR([libhiredis not available])])],
++   [module], [AS_IF([test "$enable_shared" = "yes"], [enable_redis=module], 
[AC_MSG_ERROR([link mode has to be 'shared'])])],
+    [no], [],
+    [*], [AC_MSG_ERROR([Invalid value of --enable-redis.])]
+ )
+ AM_CONDITIONAL([ENABLE_REDIS], [test "$enable_redis" != "no"])
+-AM_CONDITIONAL([ENABLE_REDIS_MODULE], [test "$enable_redis" != "no" && test 
"$enable_shared" = "yes"])
++AM_CONDITIONAL([ENABLE_REDIS_MODULE], [test "$enable_redis" != "no" && test 
"$enable_redis" != "client" && test "$enable_shared" = "yes"])
+ 
+-AS_IF([test "$enable_redis" = yes],[
++AS_IF([test "$enable_redis" = yes -o "$enable_redis" = client],[
+    AC_DEFINE([ENABLE_REDIS], [1], [Enable Redis support.])
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <hiredis/hiredis.h>
+                                      #if (HIREDIS_MAJOR < 1) || 
(HIREDIS_MAJOR == 1 && HIREDIS_MINOR < 1)
+@@ -283,7 +285,7 @@ AS_IF([test "$enable_redis" = yes],[
+                                      #endif]])],
+                   [AC_DEFINE([ENABLE_REDIS_TLS], [1], [Enable Redis TLS 
support.])],
+                   [enable_redis="yes (no TLS)"])
+-   AS_IF([test "$enable_shared" = yes],[
++   AS_IF([test "$enable_redis" = yes && test "$enable_shared" = yes],[
+       enable_redis="${enable_redis} module"
+    ])
+ ])
+@@ -515,7 +517,7 @@ PKG_CHECK_MODULES([lmdb], [lmdb >= 0.9.15], [], [
+   CPPFLAGS="$save_CPPFLAGS"
+   LIBS="$save_LIBS"
+ 
+-  AS_IF([test "$have_lmdb" = "no"], [
++  AS_IF([test "$have_lmdb" = "no" && test "$enable_redis" != "module"], [
+     AC_MSG_ERROR([lmdb library not found])
+   ])
+ ])
+-- 
+GitLab
+

diff --git a/net-dns/knot/knot-3.5.0.ebuild b/net-dns/knot/knot-3.5.0.ebuild
new file mode 100644
index 000000000000..3b17c7367808
--- /dev/null
+++ b/net-dns/knot/knot-3.5.0.ebuild
@@ -0,0 +1,242 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{11..14} )
+inherit autotools eapi9-ver python-r1 systemd tmpfiles verify-sig
+
+# subslot: libknot major.libdnssec major.libzscanner major
+KNOT_SUBSLOT="16.10.5"
+
+DESCRIPTION="High-performance authoritative-only DNS server"
+HOMEPAGE="https://www.knot-dns.cz/ https://gitlab.nic.cz/knot/knot-dns";
+SRC_URI="
+       https://knot-dns.nic.cz/release/${P}.tar.xz
+       !doc? ( 
https://raw.githubusercontent.com/PPN-SD/gentoo-manpages/refs/tags/${P}/${P}-manpages.tar.xz
 )
+       verify-sig? ( https://knot-dns.nic.cz/release/${P}.tar.xz.asc )
+"
+LICENSE="GPL-2+"
+SLOT="0/${KNOT_SUBSLOT}"
+KEYWORDS="~amd64 ~arm64 ~riscv ~x86"
+
+# Modules without dep. Built unconditionally.
+KNOT_MODULES=(
+       "authsignal"
+       "cookies"
+       "dnsproxy"
+       "noudp"
+       "onlinesign"
+       "queryacl"
+       "rrl"
+       "stats"
+       "synthrecord"
+       "whoami"
+)
+
+KNOT_MODULES_OPT=(
+       "dnstap"
+       "geoip"
+)
+
+IUSE="caps +daemon dbus doc doh +fastparser +idn pkcs11 prometheus python quic 
redis selinux systemd test +utils xdp ${KNOT_MODULES_OPT[@]}"
+RESTRICT="!test? ( test )"
+REQUIRED_USE="
+       prometheus? ( python )
+       python? ( ${PYTHON_REQUIRED_USE} )
+"
+
+COMMON_DEPEND="
+       dev-libs/libedit
+       dnstap? (
+               dev-libs/fstrm
+               dev-libs/protobuf-c:=
+       )
+"
+RDEPEND="
+       dev-db/lmdb:=
+       net-libs/gnutls:=[pkcs11?]
+       daemon? (
+               ${COMMON_DEPEND}
+               acct-group/knot
+               acct-user/knot
+               dev-libs/userspace-rcu:=
+               caps? ( sys-libs/libcap-ng )
+               dbus? ( sys-apps/dbus )
+               geoip? ( dev-libs/libmaxminddb:= )
+               redis? ( >=dev-libs/hiredis-1.1.0:= )
+               systemd? ( sys-apps/systemd:= )
+               )
+       prometheus? (
+               dev-python/prometheus-client[${PYTHON_USEDEP}]
+               dev-python/psutil[${PYTHON_USEDEP}]
+       )
+       python? ( ${PYTHON_DEPS} )
+       quic? ( net-libs/ngtcp2[gnutls] )
+       selinux? ( sec-policy/selinux-knot )
+       utils? (
+               ${COMMON_DEPEND}
+               doh? ( net-libs/nghttp2:= )
+               idn? ( net-dns/libidn2:= )
+       )
+       xdp? (
+               >=dev-libs/libbpf-1.0:=
+               net-libs/xdp-tools
+               utils? ( net-libs/libmnl:= )
+       )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+       virtual/pkgconfig
+       doc? (
+               $(python_gen_any_dep '
+                       dev-python/sphinx[${PYTHON_USEDEP}]
+                       dev-python/sphinx-panels[${PYTHON_USEDEP}]
+               ')
+       )
+       python? ( ${PYTHON_DEPS} )
+       test? (
+               pkcs11? ( dev-libs/softhsm )
+       )
+       verify-sig? ( sec-keys/openpgp-keys-knot )
+"
+
+VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/${PN}.asc
+
+PATCHES=(
+       # PR merged 
https://gitlab.nic.cz/knot/knot-dns/-/merge_requests/1808.patch
+       "${FILESDIR}"/${PN}-3.5.0-full_redis_opt.patch
+)
+
+# Used to check cpuset_t in sched.h with NetBSD.
+# False positive because linux have sched.h too but with cpu_set_t
+QA_CONFIG_IMPL_DECL_SKIP=( cpuset_create cpuset_destroy )
+
+python_check_deps() {
+       use doc || return 0
+       python_has_version "dev-python/sphinx[${PYTHON_USEDEP}]" \
+               "dev-python/sphinx-panels[${PYTHON_USEDEP}]"
+}
+
+pkg_setup() {
+       if use doc || use python; then
+               python_setup
+       fi
+}
+
+src_unpack() {
+       if use verify-sig; then
+               verify-sig_verify_detached "${DISTDIR}"/${P}.tar.xz{,.asc}
+       fi
+       default
+}
+
+src_prepare() {
+       default
+       # avoid the old ltmain.sh modified by upstream which causes a linking 
issue
+       # reproduced with test and musl
+       eautoreconf
+}
+
+src_configure() {
+       local u
+       local my_conf=(
+               --with-storage="${EPREFIX}/var/lib/${PN}"
+               --with-rundir="${EPREFIX}/var/run/${PN}"
+               $(use_enable caps cap_ng)
+               $(use_enable daemon)
+               # enable-dnstap defines support for kdig only
+               $(use_enable dnstap dnstap $(usex utils))
+               $(use_enable doc documentation)
+               $(use_with doh libnghttp2)
+               $(use_enable fastparser)
+               $(use_enable geoip maxminddb)
+               $(use_with idn libidn)
+               $(use_enable quic)
+               $(use_enable redis redis $(usex daemon client))
+               $(use_enable systemd)
+               $(use_enable utils utilities)
+               $(use_enable xdp)
+       )
+       # modules are only used by daemon
+       # module-dnstap defines support for knotd only
+       if use daemon; then
+               for u in "${KNOT_MODULES[@]}"; do
+                       my_conf+=("--with-module-${u}")
+               done
+               for u in "${KNOT_MODULES_OPT[@]#+}"; do
+                       my_conf+=("$(use_with ${u} module-${u})")
+               done
+       else
+               my_conf+=( --disable-modules )
+       fi
+
+       if use !daemon; then
+               my_conf+=("--enable-dbus=no")
+       elif use dbus; then
+               my_conf+=("--enable-dbus=libdbus")
+       elif use !dbus && use !systemd; then
+               my_conf+=("--enable-dbus=no")
+       elif use !dbus && use systemd; then
+               my_conf+=("--enable-dbus=systemd")
+       fi
+
+       econf "${my_conf[@]}"
+}
+
+src_compile() {
+       default
+
+       use doc && emake -C doc html
+}
+
+src_install() {
+       if use doc; then
+               local HTML_DOCS=( 
doc/_build/html/{*.html,*.js,_sources,_static} )
+       else
+               doman "${WORKDIR}"/man/*
+       fi
+
+       if use python; then
+               python_foreach_impl python_domodule python/libknot/libknot
+               newdoc python/libknot/README.md README.python.md
+       fi
+
+       if use prometheus; then
+               python_foreach_impl python_domodule 
python/knot_exporter/knot_exporter
+               python_scriptinto /usr/sbin
+               python_foreach_impl python_newscript 
python/knot_exporter/knot_exporter/knot_exporter.py knot-exporter
+               newdoc python/knot_exporter/README.md README.knot_exporter.md
+       fi
+
+       default
+
+       if use daemon; then
+               rmdir "${D}/var/run/${PN}" "${D}/var/run/" || die
+
+               newinitd "${FILESDIR}"/knot-3.init knot
+               newconfd "${FILESDIR}"/knot.confd knot
+
+               newtmpfiles "${FILESDIR}"/${PN}.tmpfile ${PN}.conf
+
+               use systemd && systemd_newunit distro/common/knot.service 
knot.service
+       fi
+
+       find "${D}" -name '*.la' -delete || die
+
+       keepdir /var/lib/knot
+}
+
+pkg_postinst() {
+       use daemon && tmpfiles_process ${PN}.conf
+
+       if has_version net-dns/redis-knot || use redis; then
+               ewarn "To use redis, 
${EPREFIX}/usr/$(get_libdir)/knot/redis/knot.so from net-dns/redis-knot"
+               ewarn "must be loaded by an instance of Redis."
+       fi
+
+       if ver_replacing -lt 3.5; then
+               elog "See documentation for migration:"
+               elog 
"https://www.knot-dns.cz/docs/3.5/html/migration.html#upgrade-3-4-x-to-3-5-x";
+       fi
+}

diff --git a/net-dns/knot/metadata.xml b/net-dns/knot/metadata.xml
index c39f9c07d1b5..be9be89e1cfa 100644
--- a/net-dns/knot/metadata.xml
+++ b/net-dns/knot/metadata.xml
@@ -33,6 +33,9 @@
                <flag name="quic">
                        Enable the DNS over QUIC (DoQ) module using libngtcp2
                </flag>
+               <flag name="redis">
+                       Enable database zone backend using Redis
+               </flag>
                <flag name="utils">
                        Install Knot utilities, such as kdig, kzonecheck, ...
                </flag>

Reply via email to