public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: net-dns/knot/
Date: Mon, 30 Dec 2024 14:04:05 +0000 (UTC)	[thread overview]
Message-ID: <1735567382.a7dcb4d2107d22f9a12d597c294c82d8fcfe8559.sam@gentoo> (raw)

commit:     a7dcb4d2107d22f9a12d597c294c82d8fcfe8559
Author:     Nicolas PARLANT <nicolas.parlant <AT> parhuet <DOT> fr>
AuthorDate: Fri Dec 13 22:40:25 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Dec 30 14:03:02 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a7dcb4d2

net-dns/knot: add python/prometheus support

Add support for:
* Libknot API in Python : a Python interface for managing the Knot DNS daemon.
* knot-exporter : A Prometheus exporter for Knot DNS's server and query
  statistics.

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

 .../{knot-3.4.3-r1.ebuild => knot-3.4.3-r2.ebuild} | 36 ++++++++++++++++++++--
 net-dns/knot/metadata.xml                          |  3 ++
 2 files changed, 37 insertions(+), 2 deletions(-)

diff --git a/net-dns/knot/knot-3.4.3-r1.ebuild b/net-dns/knot/knot-3.4.3-r2.ebuild
similarity index 78%
rename from net-dns/knot/knot-3.4.3-r1.ebuild
rename to net-dns/knot/knot-3.4.3-r2.ebuild
index 348eb7571ad6..7802470727a0 100644
--- a/net-dns/knot/knot-3.4.3-r1.ebuild
+++ b/net-dns/knot/knot-3.4.3-r2.ebuild
@@ -3,7 +3,9 @@
 
 EAPI=8
 
-inherit flag-o-matic systemd tmpfiles
+PYTHON_COMPAT=( python3_{10..13} )
+
+inherit python-single-r1 flag-o-matic systemd tmpfiles
 
 # subslot: libknot major.libdnssec major.libzscanner major
 KNOT_SUBSLOT="15.9.4"
@@ -33,8 +35,12 @@ KNOT_MODULES=(
 	"+whoami"
 )
 
-IUSE="caps +daemon dbus +doc doh +fastparser +idn pkcs11 quic systemd test +utils xdp ${KNOT_MODULES[@]}"
+IUSE="caps +daemon dbus +doc doh +fastparser +idn pkcs11 prometheus python quic systemd test +utils xdp ${KNOT_MODULES[@]}"
 RESTRICT="!test? ( test )"
+REQUIRED_USE="
+	prometheus? ( python )
+	python? ( ${PYTHON_REQUIRED_USE} )
+"
 
 COMMON_DEPEND="
 	dev-libs/libedit
@@ -62,6 +68,13 @@ RDEPEND="
 		doh? ( net-libs/nghttp2:= )
 		idn? ( net-dns/libidn2:= )
 	)
+	python? ( ${PYTHON_DEPS} )
+	prometheus? (
+		$(python_gen_cond_dep '
+			dev-python/prometheus-client[${PYTHON_USEDEP}]
+			dev-python/psutil[${PYTHON_USEDEP}]
+		')
+	)
 	xdp? (
 		>=dev-libs/libbpf-1.0:=
 		net-libs/xdp-tools
@@ -72,6 +85,9 @@ DEPEND="${RDEPEND}"
 BDEPEND="
 	virtual/pkgconfig
 	doc? ( dev-python/sphinx )
+	python? (
+		${PYTHON_DEPS}
+	)
 	test? (
 		pkcs11? ( dev-libs/softhsm )
 	)
@@ -81,6 +97,10 @@ BDEPEND="
 # False positive because linux have sched.h too but with cpu_set_t
 QA_CONFIG_IMPL_DECL_SKIP=( cpuset_create cpuset_destroy )
 
+pkg_setup() {
+	use python && python-single-r1_pkg_setup
+}
+
 src_prepare() {
 	# https://gitlab.nic.cz/knot/knot-dns/-/issues/946
 	cat > tests/contrib/test_atomic.c <<-_EOF_ || die
@@ -149,6 +169,18 @@ src_compile() {
 src_install() {
 	use doc && local HTML_DOCS=( doc/_build/html/{*.html,*.js,_sources,_static} )
 
+	if use python; then
+		python_domodule python/libknot/libknot
+		newdoc python/libknot/README.md README.python.md
+	fi
+
+	if use prometheus; then
+		python_domodule python/knot_exporter/knot_exporter
+		python_scriptinto /usr/sbin
+		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

diff --git a/net-dns/knot/metadata.xml b/net-dns/knot/metadata.xml
index eb4839a1be64..6544e399dce4 100644
--- a/net-dns/knot/metadata.xml
+++ b/net-dns/knot/metadata.xml
@@ -51,6 +51,9 @@
 		<flag name="pkcs11">
 			Add support for PKCS#11
 		</flag>
+		<flag name="prometheus">
+			A Prometheus exporter for server and query statistics.
+		</flag>
 		<flag name="queryacl">
 			Enable the module for query access control
 		</flag>


             reply	other threads:[~2024-12-30 14:04 UTC|newest]

Thread overview: 132+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-30 14:04 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-08-26 15:12 [gentoo-commits] repo/gentoo:master commit in: net-dns/knot/ Sam James
2025-07-23  2:32 Sam James
2025-07-23  2:32 Sam James
2025-07-16 13:29 Joonas Niilola
2025-07-16 13:29 Joonas Niilola
2025-06-05 21:22 Sam James
2025-05-28 14:46 Sam James
2025-05-28 14:46 Sam James
2025-05-28 10:34 Sam James
2025-05-27 19:45 Kenton Groombridge
2025-05-22 22:21 Sam James
2025-04-26  1:17 Sam James
2025-03-24  6:10 Sam James
2025-03-01 17:17 Arthur Zamarin
2025-03-01 17:17 Arthur Zamarin
2025-02-16 16:27 Sam James
2025-02-16 16:27 Sam James
2025-02-04 14:17 Sam James
2025-02-04 14:17 Sam James
2025-02-04 13:49 Florian Schmaus
2025-02-04 13:49 Florian Schmaus
2024-12-30 14:04 Sam James
2024-12-30 14:04 Sam James
2024-12-11 11:26 Sam James
2024-12-06 15:36 Sam James
2024-12-06 15:36 Sam James
2024-12-05 15:16 Florian Schmaus
2023-08-03  7:45 Florian Schmaus
2023-08-03  7:45 Florian Schmaus
2023-05-01 13:36 Sam James
2023-04-29 15:48 Arthur Zamarin
2023-04-16 16:35 Arthur Zamarin
2022-12-11 18:33 Arthur Zamarin
2022-12-07 14:50 Sam James
2022-12-07 14:50 Sam James
2022-11-05  6:57 Yixun Lan
2022-11-01 17:59 Matthew Smith
2022-11-01 17:59 Matthew Smith
2022-10-16 11:11 Matthew Smith
2022-10-16 11:11 Matthew Smith
2022-09-11  8:41 Florian Schmaus
2022-08-24  9:28 Florian Schmaus
2022-08-13  7:59 Matthew Smith
2022-05-22 17:18 Florian Schmaus
2022-05-22 17:18 Florian Schmaus
2022-04-22 15:20 Agostino Sarubbo
2022-04-21  8:25 Jakov Smolić
2022-04-19 19:28 Florian Schmaus
2022-04-19 19:28 Florian Schmaus
2022-04-19 19:28 Florian Schmaus
2022-04-19 19:28 Florian Schmaus
2021-12-27 17:23 Florian Schmaus
2021-11-23  9:40 Florian Schmaus
2021-11-23  9:40 Florian Schmaus
2021-10-31  3:43 Sam James
2021-09-21  7:03 Joonas Niilola
2021-08-10 13:02 Florian Schmaus
2021-08-10 13:02 Florian Schmaus
2021-08-08 21:39 Marek Szuba
2021-07-14  6:25 Joonas Niilola
2021-06-08  7:39 Sam James
2021-02-05  4:34 Sam James
2021-02-05  4:34 Sam James
2020-12-29 21:15 Sam James
2020-11-13 23:51 Aaron Bauman
2020-11-13 23:51 Aaron Bauman
2020-10-17 14:04 Joonas Niilola
2020-10-17 14:04 Joonas Niilola
2020-10-08 10:02 Joonas Niilola
2020-09-30  7:06 Joonas Niilola
2020-09-30  7:06 Joonas Niilola
2020-06-10 15:54 Craig Andrews
2020-06-10 15:54 Craig Andrews
2020-03-08 12:58 Joonas Niilola
2020-01-07  6:20 Joonas Niilola
2020-01-07  6:20 Joonas Niilola
2019-12-18 16:32 Joonas Niilola
2019-11-26 14:59 Joonas Niilola
2019-10-13 16:55 Joonas Niilola
2019-10-13 16:55 Joonas Niilola
2019-10-07  5:20 Joonas Niilola
2019-10-07  5:20 Joonas Niilola
2019-09-01 11:19 Joonas Niilola
2019-06-06 17:36 Michał Górny
2019-06-06 17:36 Michał Górny
2019-04-27 14:24 Michał Górny
2019-04-19 14:09 Michał Górny
2019-04-19 14:09 Michał Górny
2018-12-04 21:20 Michał Górny
2018-10-26 18:57 Sven Wegener
2018-10-18 21:40 Patrice Clement
2018-09-08  8:26 Michał Górny
2018-09-08  8:26 Michał Górny
2018-07-13  7:42 Tony Vroon
2018-07-13  7:42 Tony Vroon
2018-06-07 11:36 Michał Górny
2018-04-22 19:21 Michał Górny
2018-04-22 19:21 Michał Górny
2018-02-18 17:16 Patrice Clement
2018-02-18 17:16 Patrice Clement
2018-01-06  0:01 Craig Andrews
2018-01-06  0:01 Craig Andrews
2017-11-28 16:19 Mikle Kolyada
2017-11-28 16:19 Mikle Kolyada
2017-11-17 18:47 David Seifert
2017-11-08 22:48 Patrice Clement
2017-11-08 22:48 Patrice Clement
2017-10-09 21:53 Patrice Clement
2017-10-09 21:53 Patrice Clement
2017-09-03 15:43 Andreas Sturmlechner
2017-08-22  9:07 Michał Górny
2017-08-22  9:07 Michał Górny
2017-08-22  9:07 Michał Górny
2017-08-22  9:07 Michał Górny
2017-08-01 21:32 Amy Liffey
2017-08-01 21:11 Amy Liffey
2017-08-01 17:10 Amy Liffey
2017-07-30  9:54 David Seifert
2017-07-30  9:54 David Seifert
2017-06-26  1:13 Jeroen Roovers
2017-06-26  1:13 Jeroen Roovers
2017-06-22 12:10 Tomas Chvatal
2017-06-12 21:46 Patrice Clement
2017-06-12 21:46 Patrice Clement
2017-06-12 21:46 Patrice Clement
2017-05-25 21:06 Patrice Clement
2017-02-27 11:12 Patrick Lauer
2016-12-29 13:14 David Seifert
2016-08-30 16:53 Patrice Clement
2016-03-02 13:32 Amy Winston
2016-02-08 10:25 Tomas Chvatal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1735567382.a7dcb4d2107d22f9a12d597c294c82d8fcfe8559.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox