commit:     93a2b9e8d3375fbc5c5dfcfd26458452d269dad0
Author:     Nicolas PARLANT <nicolas.parlant <AT> parhuet <DOT> fr>
AuthorDate: Sun Nov 24 06:31:51 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Dec  1 15:16:52 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=93a2b9e8

net-dns/knot-resolver: add 6.0.9

Knot DNS API/ABI : >=net-dns/knot-3.3

New optional python component, manager, to start/manage Knot Resolver :
* useflag manager (enabled by default)
* python3_10..12 (no 3.13 due to app-admin/supervisor)
* start with /etc/init.d/knot-resolver or knot-resolver.service
* config file : /etc/conf.d/knot-resolver /etc/knot-resolver/config.yaml
* option garbage collector : /etc/init.d/kres-cache-gc

Old/legacy way to start Knot Resolver is still supported and installed by 
default, even with the manager enabled by useflag :
* start with /etc/init.d/kresd or kresd' <AT> '.service (installed by default 
with the meson_feature systemd_legacy_units)
* config file : /etc/conf.d/kresd /etc/kresd.conf (installed by default with 
-Dinstall_kresd_conf=enabled)

Useflags :
* kresc (removed) : has never gone beyond experiment/alpha
* prometheus (new) : prometheus metrics endpoint for the manager 
(dev-python/prometheus-client)

Patches :
* 5.X patches to set docdir and optional deps (nghttp, openssl)
* 6.0.9-libsystemd.patch : rebase from 5.7.4. tmpfiles is independent of the 
systemd option/useflag
* 6.0.9-config-example.patch : for the manager. A default config file is 
installed in /etc/knot-resolver/config.yaml and examples in /usr/share/doc/
* 6.0.9-sd_notify_alt.patch : upstream, fix systemd dep with sd_notify 
alternative for manager
* 6.0.9-pytest_tomli.patch : for one pytest, import toml is replaced with tomli

Tests :
* unit_tests for kresd : enabled
* unit_tests for manager : enabled
* config_tests : disabled. It requires external lua modules (basexx, cqueues)
* extra_tests : disabled. Too extra ...

Bug: https://bugs.gentoo.org/939471
Signed-off-by: Nicolas PARLANT <nicolas.parlant <AT> parhuet.fr>
Closes: https://github.com/gentoo/gentoo/pull/39482
Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-dns/knot-resolver/Manifest                     |   2 +
 .../files/knot-resolver-6.0.9-config-example.patch |  40 +++++
 .../files/knot-resolver-6.0.9-libsystemd.patch     |  25 +++
 .../files/knot-resolver-6.0.9-pytest_tomli.patch   |  31 ++++
 .../files/knot-resolver-6.0.9-sd_notify_alt.patch  |  82 ++++++++++
 net-dns/knot-resolver/files/knot-resolver.confd    |  10 ++
 net-dns/knot-resolver/files/knot-resolver.initd    |  37 +++++
 net-dns/knot-resolver/files/kres-cache-gc.initd    |  22 +++
 net-dns/knot-resolver/knot-resolver-6.0.9.ebuild   | 175 +++++++++++++++++++++
 net-dns/knot-resolver/metadata.xml                 |   6 +
 10 files changed, 430 insertions(+)

diff --git a/net-dns/knot-resolver/Manifest b/net-dns/knot-resolver/Manifest
index a237914c0214..42913251853c 100644
--- a/net-dns/knot-resolver/Manifest
+++ b/net-dns/knot-resolver/Manifest
@@ -2,3 +2,5 @@ DIST knot-resolver-5.7.2.tar.xz 1928336 BLAKE2B 
c4f17a050752a5d1ed141bae646f53f3
 DIST knot-resolver-5.7.2.tar.xz.asc 833 BLAKE2B 
f73f52d7b2326a58a37b821cd8495d20c93017bd1f7bad2cc828f807f1886fc376dc95405b3b36047719f8566e27d7c1052b7ab11fae3d1d67c5563a293d965e
 SHA512 
cf05ceca455400004cf249b1029b93619a1d5fcf839bca1259a7b411a1ddef1da0aff187ea0023c587de1981e91a8d26af3bb22341cf426e5055e8ca1c4024e2
 DIST knot-resolver-5.7.4.tar.xz 1931124 BLAKE2B 
670bd0bac1417fde0f7b6a02797e49e22af081e55b63c23e1fcd8dee369f21b7a2a8997fe641f69e7f0de5cbc7960307f32c939eb85c260fb2de015542dfce1e
 SHA512 
5d8ea5b5b0cba5a1058aaa6e04573c838895d6b2c204e8d09c9ad898fb074c52ef7589afdad164b007edf151167d31fd0f940466edfeec597f96e5bc1cd72171
 DIST knot-resolver-5.7.4.tar.xz.asc 833 BLAKE2B 
6432bc23ff779998eb351d57db34bcd9e41ea928fa5d83463122012d8adad16edec7afbcbfb0f0b41789c7797c895216b793ced2d6a01d69fdc3b0f2d12879cb
 SHA512 
d34a0e1fd8be372c325199ace5bb6f20b2b395a4fb5a6f6f4c2c89f29741ecfd36234900b0e836c174df831716012589231551b13426a6728e37aba6c74c197f
+DIST knot-resolver-6.0.9.tar.xz 2127432 BLAKE2B 
185a78737f6830b4ff036a537f2ceb032388e50ef050c239f0ce21d84a1fa2d1632aa95802a73d4ff80bcb18cef23f444a10b594121cd449cee3c12182dcab2e
 SHA512 
98b3074927d9cb484738592a6cad84b818130aafd91473ee6e17458884c3ff5cb528e22d020d8b8b92b429feb2e3432e9cb77574f505bdf2e5f6f286009ecd59
+DIST knot-resolver-6.0.9.tar.xz.asc 833 BLAKE2B 
10c9c895bd3a728b8a9d3769cb72ccc5dbf5c17164df388d1519c5e4734e21ee568c079191ada6ff76f1a150be911d79c5d1ebb02597c32d1aa5003a5ceaf02d
 SHA512 
b46a9346deda328fbe6638657e2d87903052ac36b11ff5d4f68bd145487687c1c2f43a7b62e40585f5853816b7ed66b1af3b98642e882f72e36cf521f5eb1bce

diff --git 
a/net-dns/knot-resolver/files/knot-resolver-6.0.9-config-example.patch 
b/net-dns/knot-resolver/files/knot-resolver-6.0.9-config-example.patch
new file mode 100644
index 000000000000..1e20fad33e16
--- /dev/null
+++ b/net-dns/knot-resolver/files/knot-resolver-6.0.9-config-example.patch
@@ -0,0 +1,40 @@
+From 432f3078eb506dc002de94a6472e3ccf3097f274 Mon Sep 17 00:00:00 2001
+From: Nicolas PARLANT <[email protected]>
+Date: Fri, 22 Nov 2024 13:23:38 +0100
+Subject: [PATCH] Add config.yaml in etc_dir
+
+---
+ etc/config/meson.build | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/etc/config/meson.build b/etc/config/meson.build
+index ca888084..29abb992 100644
+--- a/etc/config/meson.build
++++ b/etc/config/meson.build
+@@ -10,6 +10,11 @@ example_configs = [
+   'config.privacy',
+   'config.personal',
+   'config.splitview',
++  'config.dev.yaml',
++  'config.example.docker.yaml',
++  'config.example.isp.yaml',
++  'config.example.internal.yaml',
++  'config.example.personal.yaml',
+ ]
+ 
+ install_data(
+@@ -17,6 +22,11 @@ install_data(
+   install_dir: examples_dir,
+ )
+ 
++install_data(
++  sources: 'config.example.personal.yaml',
++  rename: 'config.yaml',
++  install_dir: etc_dir,
++)
+ 
+ # kresd.conf
+ install_kresd_conf = get_option('install_kresd_conf') == 'enabled'
+-- 
+2.45.2
+

diff --git a/net-dns/knot-resolver/files/knot-resolver-6.0.9-libsystemd.patch 
b/net-dns/knot-resolver/files/knot-resolver-6.0.9-libsystemd.patch
new file mode 100644
index 000000000000..6010881b3037
--- /dev/null
+++ b/net-dns/knot-resolver/files/knot-resolver-6.0.9-libsystemd.patch
@@ -0,0 +1,25 @@
+--- a/meson.build
++++ b/meson.build
+@@ -145,7 +145,7 @@ xdp = 
meson.get_compiler('c').has_header('libknot/xdp/xdp.h')
+ ### Systemd
+ systemd_files = get_option('systemd_files')
+ systemd_legacy_units = get_option('systemd_legacy_units')
+-libsystemd = dependency('libsystemd', required: systemd_files == 'enabled')
++libsystemd = dependency('libsystemd', required: get_option('systemd'))
+ 
+ # Uh, lifted this trivial line from tests/meson.build due to dependency 
sorting:
+ build_extra_tests = get_option('extra_tests') == 'enabled'
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -227,3 +227,10 @@ option(
+   value: 'auto',
+   description: 'add rpath to the knot resolver executables',
+ )
++
++option(
++  'systemd',
++  type: 'feature',
++  value: 'auto',
++  description: 'systemd watchdog support',
++)
+

diff --git a/net-dns/knot-resolver/files/knot-resolver-6.0.9-pytest_tomli.patch 
b/net-dns/knot-resolver/files/knot-resolver-6.0.9-pytest_tomli.patch
new file mode 100644
index 000000000000..9e9db90ffe66
--- /dev/null
+++ b/net-dns/knot-resolver/files/knot-resolver-6.0.9-pytest_tomli.patch
@@ -0,0 +1,31 @@
+From 70d2254de37555167cf60b60d1539ecc9d798fea Mon Sep 17 00:00:00 2001
+From: Nicolas PARLANT <[email protected]>
+Date: Mon, 25 Nov 2024 22:21:07 +0000
+Subject: [PATCH] use tomli instead toml for pytest
+
+---
+ tests/manager/test_knot_resolver_manager.py | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/tests/manager/test_knot_resolver_manager.py 
b/tests/manager/test_knot_resolver_manager.py
+index 05d0e61d..b45c79a4 100644
+--- a/tests/manager/test_knot_resolver_manager.py
++++ b/tests/manager/test_knot_resolver_manager.py
+@@ -1,11 +1,11 @@
+-import toml
++import tomli
+ 
+ from knot_resolver import __version__
+ 
+ 
+ def test_version():
+-    with open("pyproject.toml", "r") as f:
+-        pyproject = toml.load(f)
++    with open("pyproject.toml", "rb") as f:
++        pyproject = tomli.load(f)
+ 
+     version = pyproject["tool"]["poetry"]["version"]
+     assert __version__ == version
+-- 
+2.45.2
+

diff --git 
a/net-dns/knot-resolver/files/knot-resolver-6.0.9-sd_notify_alt.patch 
b/net-dns/knot-resolver/files/knot-resolver-6.0.9-sd_notify_alt.patch
new file mode 100644
index 000000000000..9752b314cfa0
--- /dev/null
+++ b/net-dns/knot-resolver/files/knot-resolver-6.0.9-sd_notify_alt.patch
@@ -0,0 +1,82 @@
+https://gitlab.nic.cz/knot/knot-resolver/-/merge_requests/1608
+Draft: daemon: add sd_notify alternative
+This allows kresd to run even if libsystemd is not available.
+
+diff --git a/daemon/main.c b/daemon/main.c
+index 
44b8ae4c1b745c19ae91f6c9119b895d7738947f..230b1e453217682df387165c08f4115d795cb983
 100644
+--- a/daemon/main.c
++++ b/daemon/main.c
+@@ -36,6 +36,8 @@
+ #include <uv.h>
+ #if ENABLE_LIBSYSTEMD
+ #include <systemd/sd-daemon.h>
++#else
++static int notify_ready(const char *state);
+ #endif
+ #include <libknot/error.h>
+ 
+@@ -68,6 +70,7 @@ KR_EXPORT const char *malloc_conf = "narenas:1";
+ #define TCP_BACKLOG_DEFAULT 128
+ #endif
+ 
++
+ /** I don't know why linker is dropping these functions otherwise. TODO: 
revisit. */
+ KR_EXPORT void kr_misc_unused(void)
+ {
+@@ -209,6 +212,8 @@ static int run_worker(uv_loop_t *loop, bool leader, struct 
args *args)
+       /* Notify supervisor. */
+ #if ENABLE_LIBSYSTEMD
+       sd_notify(0, "READY=1");
++#else
++      notify_ready("READY=1");
+ #endif
+       /* Run event loop */
+       uv_run(loop, UV_RUN_DEFAULT);
+@@ -414,6 +419,47 @@ static int start_listening(flagged_fd_array_t *fds) {
+       return some_bad_ret;
+ }
+ 
++#if !ENABLE_LIBSYSTEMD
++/* Notify supervisord about successful inicialization
++ * @note tested only on an abstract address in $NOTIFY_SOCKET*/
++static int notify_ready(const char *state)
++{
++      int sockfd;
++      struct sockaddr_un addr;
++      char *socket_path = getenv("NOTIFY_SOCKET");
++      if (!socket_path) {
++              kr_log_error(WORKER, "Failed retrieving env variable 
$NOTIFY_SOCKET\n");
++              return EXIT_FAILURE;
++      }
++      if ((sockfd = socket(AF_UNIX, SOCK_DGRAM, 0)) == -1) {
++              kr_log_error(WORKER, "Failed to create unix socket at 
$NOTIFY_SOCKET ('%s'): %s\n",
++                              socket_path, strerror(errno));
++              return EXIT_FAILURE;
++      }
++
++      addr.sun_family = AF_UNIX;
++
++      int addrlen;
++      if (socket_path[0] == '@') {
++              addr.sun_path[0] = '\0';
++              strncpy(&addr.sun_path[1], socket_path + 1, 
sizeof(addr.sun_path) - 2);
++              addrlen = offsetof(struct sockaddr_un, sun_path) + 
strlen(addr.sun_path + 1) + 1;
++      } else {
++              strncpy(addr.sun_path, socket_path, sizeof(addr.sun_path) - 1);
++              addrlen = offsetof(struct sockaddr_un, sun_path) + 
strlen(addr.sun_path) + 1;
++      }
++      if (sendto(sockfd, state, strlen(state), 0, &addr, addrlen) == -1) {
++              kr_log_error(WORKER, "Failed to send notify message to '%s': 
%s\n",
++                      socket_path, strerror(errno));
++              close(sockfd);
++              return EXIT_FAILURE;
++      }
++
++      close(sockfd);
++      return kr_ok();
++}
++#endif /* if !ENABLE_LIBSYSTEMD */
++
+ /* Drop POSIX 1003.1e capabilities. */
+ static void drop_capabilities(void)
+ {

diff --git a/net-dns/knot-resolver/files/knot-resolver.confd 
b/net-dns/knot-resolver/files/knot-resolver.confd
new file mode 100644
index 000000000000..8c3c65cf5772
--- /dev/null
+++ b/net-dns/knot-resolver/files/knot-resolver.confd
@@ -0,0 +1,10 @@
+# Copyright 2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+#KNOT_RESOLVER_USER=knot-resolver
+#KNOT_RESOLVER_GROUP=knot-resolver
+#KNOT_RESOLVER_CONFIG="/etc/knot-resolver/config.yaml"
+#KNOT_RESOLVER_PIDFILE="/run/knot-resolver.pid"
+
+#LOG TARGET : syslog stdout stderr
+#KNOT_RESOLVER_LOG="syslog"

diff --git a/net-dns/knot-resolver/files/knot-resolver.initd 
b/net-dns/knot-resolver/files/knot-resolver.initd
new file mode 100644
index 000000000000..79c9ec786a8b
--- /dev/null
+++ b/net-dns/knot-resolver/files/knot-resolver.initd
@@ -0,0 +1,37 @@
+#!/sbin/openrc-run
+# Copyright 2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+: ${KNOT_RESOLVER_USER:=knot-resolver}
+: ${KNOT_RESOLVER_GROUP:=knot-resolver}
+: ${KNOT_RESOLVER_CONFIG:=/etc/knot-resolver/config.yaml}
+: ${KNOT_RESOLVER_PIDFILE:=/run/knot-resolver.pid}
+: ${KNOT_RESOLVER_LOG:=syslog}
+
+export KRES_LOGGING_TARGET="${KNOT_RESOLVER_LOG}"
+
+command="/usr/bin/knot-resolver"
+command_args="-c ${KNOT_RESOLVER_CONFIG}"
+command_user="${KNOT_RESOLVER_USER}:${KNOT_RESOLVER_GROUP}"
+pidfile="${KNOT_RESOLVER_PIDFILE}"
+command_background=true
+retry="TERM/60/KILL/5"
+
+extra_started_commands="reload"
+
+capabilities="^cap_net_bind_service,^cap_setpcap"
+
+name="knot-resolver manager"
+description="scaleable caching DNS resolver"
+
+depend() {
+    need net
+    use logger
+    provide dns
+}
+
+reload() {
+       ebegin "Reloading ${SVCNAME}"
+       /usr/bin/kresctl --config=${KNOT_RESOLVER_CONFIG} reload
+       eend $?
+}

diff --git a/net-dns/knot-resolver/files/kres-cache-gc.initd 
b/net-dns/knot-resolver/files/kres-cache-gc.initd
new file mode 100644
index 000000000000..2f62e9564d3f
--- /dev/null
+++ b/net-dns/knot-resolver/files/kres-cache-gc.initd
@@ -0,0 +1,22 @@
+#!/sbin/openrc-run
+# Copyright 2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+: ${KRES_CACHE_GROUP:=knot-resolver}
+: ${KRES_CACHE_USER:=knot-resolver}
+: ${KRES_CACHE_DIR:=/var/cache/knot-resolver}
+: ${KRES_CACHE_PIDFILE:=/var/run/kres-cache-gc.pid}
+: ${KRES_CACHE_OPTS:="-d 1000"}
+
+command="/usr/bin/kres-cache-gc"
+command_args="-c ${KRES_CACHE_DIR} ${KRES_CACHE_OPTS}"
+command_user="${KRES_CACHE_USER}:${KRES_CACHE_GROUP}"
+pidfile="${KRES_CACHE_PIDFILE}"
+command_background=true
+
+name="kres-cache-gc"
+description="Knot Resolver Garbage Collector daemon"
+
+depend() {
+    need kresd
+}

diff --git a/net-dns/knot-resolver/knot-resolver-6.0.9.ebuild 
b/net-dns/knot-resolver/knot-resolver-6.0.9.ebuild
new file mode 100644
index 000000000000..407e78b02e4d
--- /dev/null
+++ b/net-dns/knot-resolver/knot-resolver-6.0.9.ebuild
@@ -0,0 +1,175 @@
+# Copyright 2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+LUA_COMPAT=( luajit )
+DISTUTILS_EXT=1
+DISTUTILS_OPTIONAL=1
+DISTUTILS_SINGLE_IMPL=1
+DISTUTILS_USE_PEP517=poetry
+# waiting app-admin/supervisor for py3_13
+PYTHON_COMPAT=( python3_{10..12} )
+
+inherit distutils-r1 lua-single meson tmpfiles verify-sig
+
+DESCRIPTION="A scaleable caching DNS resolver"
+HOMEPAGE="https://www.knot-resolver.cz 
https://gitlab.nic.cz/knot/knot-resolver";
+SRC_URI="
+       https://knot-resolver.nic.cz/release/${P}.tar.xz
+       verify-sig? ( https://knot-resolver.nic.cz/release/${P}.tar.xz.asc )
+"
+
+LICENSE="Apache-2.0 BSD CC0-1.0 GPL-3+ LGPL-2.1+ MIT"
+SLOT="0"
+KEYWORDS="~amd64"
+
+IUSE="caps dnstap jemalloc +manager nghttp2 prometheus systemd test xdp"
+RESTRICT="!test? ( test )"
+REQUIRED_USE="
+       ${LUA_REQUIRED_USE}
+       manager? ( ${PYTHON_REQUIRED_USE} )
+"
+
+RDEPEND="
+       ${LUA_DEPS}
+       acct-group/knot-resolver
+       acct-user/knot-resolver
+       dev-db/lmdb:=
+       dev-libs/libuv:=
+       >=net-dns/knot-3.3:=[xdp?]
+       net-libs/gnutls:=
+       caps? ( sys-libs/libcap-ng )
+       dnstap? (
+               dev-libs/fstrm
+               dev-libs/protobuf-c:=
+       )
+       jemalloc? ( dev-libs/jemalloc:= )
+       manager? (
+               ${PYTHON_DEPS}
+               $(python_gen_cond_dep '
+                       app-admin/supervisor[${PYTHON_USEDEP}]
+                       dev-python/aiohttp[${PYTHON_USEDEP}]
+                       dev-python/jinja2[${PYTHON_USEDEP}]
+                       dev-python/pyyaml[${PYTHON_USEDEP}]
+                       dev-python/typing-extensions[${PYTHON_USEDEP}]
+                       prometheus? ( 
dev-python/prometheus-client[${PYTHON_USEDEP}] )
+               ')
+       )
+       nghttp2? ( net-libs/nghttp2:= )
+       systemd? ( sys-apps/systemd:= )
+"
+DEPEND="
+       ${RDEPEND}
+       test? (
+               dev-util/cmocka
+               manager? (
+                       $(python_gen_cond_dep '
+                               dev-python/pyparsing[${PYTHON_USEDEP}]
+                               dev-python/pytest-asyncio[${PYTHON_USEDEP}]
+                               dev-python/tomli[${PYTHON_USEDEP}]
+                       ')
+               )
+       )
+"
+BDEPEND="
+       virtual/pkgconfig
+       manager? (
+               ${DISTUTILS_DEPS}
+               ${PYTHON_DEPS}
+       )
+       verify-sig? ( >=sec-keys/openpgp-keys-knot-resolver-20240304 )
+"
+
+VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/${PN}.gpg
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-5.5.3-docdir.patch
+       "${FILESDIR}"/${PN}-5.5.3-nghttp-openssl.patch
+       "${FILESDIR}"/${PN}-6.0.9-libsystemd.patch
+       "${FILESDIR}"/${PN}-6.0.9-config-example.patch
+       "${FILESDIR}"/${PN}-6.0.9-sd_notify_alt.patch
+       "${FILESDIR}"/${PN}-6.0.9-pytest_tomli.patch
+)
+
+pkg_setup() {
+       use manager && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+       default
+       use manager && distutils-r1_src_prepare
+}
+
+src_configure() {
+       local emesonargs=(
+               --localstatedir "${EPREFIX}"/var # double lib
+               # https://bugs.gentoo.org/870019
+               -Dauto_features=disabled
+               # requires non-gentoo lua modules (basexx, cqueues)
+               -Dconfig_tests=disabled
+               -Ddoc=disabled
+               -Ddocdir="${EPREFIX}"/usr/share/doc/${PF}
+               -Dinstall_kresd_conf=enabled
+               -Dopenssl=disabled
+               -Dmalloc=$(usex jemalloc jemalloc disabled)
+               -Dsystemd_files=enabled
+               $(meson_feature caps capng)
+               $(meson_feature dnstap)
+               $(meson_feature nghttp2)
+               $(meson_feature systemd)
+               $(meson_feature systemd systemd_legacy_units)
+               $(meson_feature test unit_tests)
+       )
+       meson_src_configure
+}
+
+src_compile() {
+       meson_src_compile
+       use manager && distutils-r1_src_compile
+}
+
+src_test() {
+       meson_src_test
+       use manager && distutils-r1_src_test
+}
+
+python_test() {
+       epytest tests/manager || die
+}
+
+src_install() {
+       meson_src_install
+       if use manager; then
+               distutils-r1_src_install
+               newinitd "${FILESDIR}"/knot-resolver.initd knot-resolver
+               newconfd "${FILESDIR}"/knot-resolver.confd knot-resolver
+       else
+               rm "${ED}"/usr/lib/systemd/system/knot-resolver.service || die
+       fi
+       fowners -R ${PN}: /etc/${PN}
+       newinitd "${FILESDIR}"/kresd.initd-r2 kresd
+       newconfd "${FILESDIR}"/kresd.confd-r1 kresd
+       newinitd "${FILESDIR}"/kres-cache-gc.initd kres-cache-gc
+}
+
+pkg_postinst() {
+       tmpfiles_process knot-resolver.conf
+       if use manager; then
+               elog "You choose the new way, called the manager, to start Knot 
Resolver :"
+               use systemd && elog "   systemctl start knot-resolver.service"
+               use !systemd && elog "  /etc/init.d/knot-resolver start"
+               elog "Configuration file : /etc/knot-resolver/config.yaml"
+               elog ""
+               elog "The older way, without the manager, is still available :"
+       else
+               elog "You choose the older way, without the manager, to start 
Knot Resolver :"
+       fi
+       use systemd && elog "   systemctl start [email protected]"
+       use !systemd && elog "  /etc/init.d/kresd start"
+       elog "Configuration file : /etc/knot-resolver/kresd.conf"
+       elog ""
+       elog "Optional garbage collector : /etc/init.d/kres-cache-gc"
+       elog ""
+       use !manager && elog "The new way is available with the useflag 
manager."
+}

diff --git a/net-dns/knot-resolver/metadata.xml 
b/net-dns/knot-resolver/metadata.xml
index c6e3e25b513e..caa5fc35963b 100644
--- a/net-dns/knot-resolver/metadata.xml
+++ b/net-dns/knot-resolver/metadata.xml
@@ -9,9 +9,15 @@
                <flag name="kresc">
                        Build (experimental) command-line client
                </flag>
+               <flag name="manager">
+                       Manager is a user-friendly interface and a component 
handling rolling restarts, config update logic and more.
+               </flag>
                <flag name="nghttp2">
                        DNS-over-HTTPS support
                </flag>
+               <flag name="prometheus">
+                       Metrics exported in Prometheus
+               </flag>
                <flag name="xdp">
                        Enable eXpress Data Path
                </flag>

Reply via email to