summaryrefslogtreecommitdiff
path: root/net-dns/knot-resolver
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-12-02 02:07:07 +0000
committerV3n3RiX <venerix@koprulu.sector>2024-12-02 02:07:07 +0000
commitd4f65848c7ecabb56e2f93889cbd20078cd347f7 (patch)
tree180032f5afeb689db6a270d612f3e3364ed8fd2b /net-dns/knot-resolver
parentc635a4b7ddb6105bfc6fef130b188a087726677b (diff)
gentoo auto-resync : 02:12:2024 - 02:07:07
Diffstat (limited to 'net-dns/knot-resolver')
-rw-r--r--net-dns/knot-resolver/Manifest12
-rw-r--r--net-dns/knot-resolver/files/knot-resolver-6.0.9-config-example.patch40
-rw-r--r--net-dns/knot-resolver/files/knot-resolver-6.0.9-libsystemd.patch25
-rw-r--r--net-dns/knot-resolver/files/knot-resolver-6.0.9-pytest_tomli.patch31
-rw-r--r--net-dns/knot-resolver/files/knot-resolver-6.0.9-sd_notify_alt.patch82
-rw-r--r--net-dns/knot-resolver/files/knot-resolver.confd10
-rw-r--r--net-dns/knot-resolver/files/knot-resolver.initd37
-rw-r--r--net-dns/knot-resolver/files/kres-cache-gc.initd22
-rw-r--r--net-dns/knot-resolver/knot-resolver-6.0.9.ebuild176
-rw-r--r--net-dns/knot-resolver/metadata.xml6
10 files changed, 440 insertions, 1 deletions
diff --git a/net-dns/knot-resolver/Manifest b/net-dns/knot-resolver/Manifest
index 9765577cae97..3c26c714ec57 100644
--- a/net-dns/knot-resolver/Manifest
+++ b/net-dns/knot-resolver/Manifest
@@ -2,6 +2,13 @@ AUX knot-resolver-5.5.3-docdir.patch 925 BLAKE2B 9d40a287fe0a6d883d46dbe13fa3ba5
AUX knot-resolver-5.5.3-nghttp-openssl.patch 1087 BLAKE2B 4570658d9d358384c435c0b4694995945f9c788249899670e000d3273ae6c2631ff69319660db2d04f4143e24746bc0160295042a7887d30dae09de11556ce8e SHA512 50e8a99aef8bc4ce41ddb4d1760cd96818859b440aa74effdc1482af150c21f4fc3e451fae739a07161fc5a2e0ee2cd093c26950dd4e16de430e6bb8a635dd84
AUX knot-resolver-5.7.0-r2-tmpfiles.patch 1353 BLAKE2B f93e30113275fb92d524cfd7daf72d8f1da95970d721d4e5a83cb8fd3d1d1d95d65ade26609028b413645be3d23c2d3f30f9b43a36b8900e456fd32f316ec146 SHA512 6f9ec265ff7a82292dfcb8b1ab5756f9835573048c29829dd41fc595b535ab7a4d8c2e03cbe49894a78319fb4cf01d6be0ad02dbdc2e7e5559552d5f52a94908
AUX knot-resolver-5.7.4-libsystemd.patch 627 BLAKE2B c59e1ff9e99d11031227725625471a2229fc4143a5e0fdd2946aa35c025322981ad67b0717524cd7bbc0f13ea891906d3f7b74733c4bed534ad9a4ed41b59176 SHA512 2cfa807f2b72664ca6bc4ac7e41701bfe6fdab08b2f44fbd0eadb5aa165b726cb540eeef1480cc095e3b984f15205924984c3039cdc4d6cf1e0068f7524e9f99
+AUX knot-resolver-6.0.9-config-example.patch 992 BLAKE2B 35d2d4705ee916ffba56a4019bf07fddf64b4ec52fe599338a008acf94c6ec418ee8c6ff2b40706eaffe050b52f322cac5bac27956b639e28b53accabfc24869 SHA512 64d70abeb89210d26fa5d0fa56d8ab9a6294b5955704ccd333f83d94d7aa5e312c3342b9d370697c8eb74590e6c38422d23640a1d3806a33e9817ae56a283ec9
+AUX knot-resolver-6.0.9-libsystemd.patch 799 BLAKE2B 21c94660986683ed2515320c1e9d75fd62d98947c1accbacc3694431a9baf1d35a72c4f487e3938101e104368b5aefab91162f5909501241eefff3b6d7da8d8b SHA512 71fe41053eb4cfa22a7440da49f4f314acba5b688ef938dd4602b00eb12e0f88fdb4d45a6d8fbf816c4ea1f5363b9973c0d3d7f60286b63a7dfa071b7f016046
+AUX knot-resolver-6.0.9-pytest_tomli.patch 929 BLAKE2B 1a0349c2bfbe945411c2220e50be2c93fb917d3c81c8f506576ce7457595da932ab1a717b812656b76b1abc928bd0276327cd37d524a402410016d092d5f71dc SHA512 643e208b9c12156b8a5173afe2d46e489c9f9eb396847c825a484594f3fe3fe7395bd15083a0940e3de36a0b5e6a866364e8dc32297f0e9a4fafde5088ade002
+AUX knot-resolver-6.0.9-sd_notify_alt.patch 2556 BLAKE2B 3f64633d82e1a2b78c0c8f04da68aeb280553ae1ce27a21eca66320e7c99e3f0ee8d15119da8d9ac2fe1d742e1b62ce502a66ef47b2b35c14c1945872bd312b2 SHA512 46135f5f2dfa58055ed6e9b4948d57a56a18119679d82033bb6e4fa9da82975c54a9eff73ecadfd8a597285593ae2d9b7841c078a6587277a3a51219eb3a6d14
+AUX knot-resolver.confd 336 BLAKE2B eb4e119a67bee3cdcebcee7f917ad13a1976eb04fb82f42f810f79ea6550f3b8391842aa213808686f939194768c1ba339e586c0af7df0d34c9309e5b541d93d SHA512 422569884ff1bd7bcc73e710738022de77b8b063125127b584488272f66ee105256b12b1b66b45a68520f6f5c15f519eb7166ba3dc8fb5f9982158d0d0be3fbd
+AUX knot-resolver.initd 936 BLAKE2B f0681cf1c837089348196487ad6858998e76ce6f2303e68478e5b0d9b0de6307f198d5dbbf05a4debea3f02b604352c5460636e29251452833df1b397e5d11af SHA512 535b626f95de4c79906c2df0bf0665234aab05f7bc30a67a8eaf0db37b4bc6cf630d613323a5fa882bb2b40ee712805c8259323c3c87a004c70e8834926d7208
+AUX kres-cache-gc.initd 625 BLAKE2B 9b6002cb2811d1c6ad30e1c6dc98fc39bb17760d80f76f3c218857dd10023001c75684c8930a596713513bae067d68992cb1d91d167eeadd95214cba736b8135 SHA512 f4826fcdb61445aecc6b380f2e44dc193e93eaf6164f6f98e89cd67d5b1aa130eb17941e623276401982a7bf454a2155d3e339ad34d18f0b0bb361260622dfd6
AUX kresd.confd-r1 284 BLAKE2B e57439a2b7fd0f433c8ea221129c1696a74c6db95f1182a0a434eb7a53feeb5a8f8678539323bb8094e19e45d781747aae3acccd683fd3b3b4f375934191a77c SHA512 40200c590638e19f9fe26367e10148c022f11dba1182cde2d10cab695de52fd2acb8133e9f05ecc93457fccb019ef4c0b3e47999e0926bd50f1d283ba80d1195
AUX kresd.initd-r1 793 BLAKE2B 267b16475029eee74eed892fb73e8abc9f197a974f35fb22d6013b9ae68a4e5f18c0f5f371ec6309057aa31db7938f5f7dd3e87d9e1b00598253088a61aad452 SHA512 457eccdd9ec841920674d175d3bf8d25a75ea1f076cdb72a8aa24d743664412250436360e73e96fd5ce3370340c27ed6bf37faac502155e13971541653f84b72
AUX kresd.initd-r2 801 BLAKE2B add0d31ee7781e987d67e5b3bf187177c9e50819dd7dbdcce3637912a27ec6da8a7c0575a4212cfe0aa620fa749558a852fd930a83871ca988b2fa6e8e0ef785 SHA512 041b3b7a31c1d9957f9437527987d88e89eeaa3f72aea2f5fc1dd28f40aab7b222a5edf42ccca8f522dae60c893d2d82900329006cf7a4f4bcc733f6a1208a4a
@@ -9,6 +16,9 @@ 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
EBUILD knot-resolver-5.7.2.ebuild 2215 BLAKE2B 373293e59d03c0d65329f3dba92072d7618206d7a5d084555495f639f8b906e5cc3014b4c4dcbcca56826af2afa418d6cd135ae22c1dc57e9132df056b54c1b6 SHA512 77f661a294e6fecda8fe0cbc31e8518822f30f6b05093ff629c28147f2bae780e81fef5d47251e654094b72f6eb533e3e05c61b787664fac0fc7e84399a3508a
EBUILD knot-resolver-5.7.4-r1.ebuild 2107 BLAKE2B 2c9837a63016339f06b9b3793458c36468ae4117ef8fbef6462443e17001fb82a43f832cbca605316c1205f4a84006f589f986e871b8eb433cfdfbda50a86085 SHA512 acb6c8b7698c64ef4cbbf2608ba7db18c2e4c5e95411c1af7c907037d398fc9424247cb760889e25b06d813f076a8c3831b16fe2c86e526bfe03fec390ef00ce
-MISC metadata.xml 448 BLAKE2B 9314270946aa31927ca0e48d512acde53d11c56b295c91ddb64b17cc75d143ae84995c7810b37267966ee7d864283c3c363a4f1afc5dd71fd52991db2c67b0eb SHA512 c25cccfd240ef9f12572d836ffb5185dfb3acf482299fdd7b18c9bcc92363099df2a751cad18d014a16e6756c7887eb13732c576f606df636f36edb657d69e59
+EBUILD knot-resolver-6.0.9.ebuild 4544 BLAKE2B 693aa572ff552ddff76a49e6506dc2e89fb7822663d5d195af6426d5de45238f9cdc290a22155f8dcb4ffffee17aaf704a8c67547ca88c25f92039fcd1c811ec SHA512 5b1dbb81ce534383f281e03eb356e14218fd51af82b69a7546a0659ee83d4197d9bce5745674be7021df5ee8598bd68aec135618e23873366229cd66687f9501
+MISC metadata.xml 666 BLAKE2B 1a1dd25bfce96daec18b94625384ffa003d17eb87ce89d4c74d1a935c79cb176a1bd7e7fdb3989e41dcbf6aea6e5b48125134722d858ad20a76fd1725703ee8c SHA512 a7e66a0096de02ed0815fe1536e70987e71f61f36e6cb51b7017fcebf4680e421a39a29fd351edbc2e2a8410b54bfecadcd533b87441013d5eb107faf4598499
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 <nicolas.parlant@parhuet.fr>
+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 <nicolas.parlant@parhuet.fr>
+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..6ef4cbb64fd0
--- /dev/null
+++ b/net-dns/knot-resolver/knot-resolver-6.0.9.ebuild
@@ -0,0 +1,176 @@
+# 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() {
+ lua-single_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
+}
+
+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 kresd@N.service"
+ 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>