commit:     f78480292d1ae4d2a89762eb33fb72101af5d446
Author:     Spencer Pavkovic <smp <AT> nandre <DOT> com>
AuthorDate: Mon Jul 24 23:51:06 2023 +0000
Commit:     Matthew Smith <matthew <AT> gentoo <DOT> org>
CommitDate: Wed Jul 26 20:33:04 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f7848029

net-dns/knot-resolver: added OpenRC init script

Signed-off-by: Spencer Pavkovic <smp <AT> nandre.com>
Closes: https://github.com/gentoo/gentoo/pull/32028
Signed-off-by: Matthew Smith <matthew <AT> gentoo.org>

 net-dns/knot-resolver/files/kresd.confd            |  5 ++
 net-dns/knot-resolver/files/kresd.initd            | 23 ++++++
 .../knot-resolver/knot-resolver-5.6.0-r1.ebuild    | 96 ++++++++++++++++++++++
 3 files changed, 124 insertions(+)

diff --git a/net-dns/knot-resolver/files/kresd.confd 
b/net-dns/knot-resolver/files/kresd.confd
new file mode 100644
index 000000000000..6749da309845
--- /dev/null
+++ b/net-dns/knot-resolver/files/kresd.confd
@@ -0,0 +1,5 @@
+# Copyright 1999-2023 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+KRESD_OPTS="-n /var/run/kresd"
+
+#KRESD_PIDFILE="/var/run/kresd.pid"
\ No newline at end of file

diff --git a/net-dns/knot-resolver/files/kresd.initd 
b/net-dns/knot-resolver/files/kresd.initd
new file mode 100644
index 000000000000..b443d98d749d
--- /dev/null
+++ b/net-dns/knot-resolver/files/kresd.initd
@@ -0,0 +1,23 @@
+#!/sbin/openrc-run
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+command="/usr/sbin/kresd"
+command_args="${KRESD_OPTS}"
+pidfile="${KRESD_PIDFILE:-/var/run/${RC_SVCNAME}.pid}"
+command_background=true
+start_stop_daemon_args="--start -bm --pidfile ${pidfile} --exec ${command} -- 
${command_args}"
+
+name="knot-resolver"
+description="scaleable caching DNS resolver"
+
+depend() {
+    need net
+    use logger
+    provide dns
+}
+
+start() {
+       checkpath --directory /var/run/kresd
+       default_start
+}

diff --git a/net-dns/knot-resolver/knot-resolver-5.6.0-r1.ebuild 
b/net-dns/knot-resolver/knot-resolver-5.6.0-r1.ebuild
new file mode 100644
index 000000000000..eb66bdf93586
--- /dev/null
+++ b/net-dns/knot-resolver/knot-resolver-5.6.0-r1.ebuild
@@ -0,0 +1,96 @@
+# Copyright 2022-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+LUA_COMPAT=( luajit )
+
+inherit 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://secure.nic.cz/files/${PN}/${P}.tar.xz
+       verify-sig? ( https://secure.nic.cz/files/${PN}/${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 kresc nghttp2 systemd test"
+RESTRICT="!test? ( test )"
+REQUIRED_USE="${LUA_REQUIRED_USE}"
+
+RDEPEND="
+       ${LUA_DEPS}
+       acct-group/knot-resolver
+       acct-user/knot-resolver
+       dev-db/lmdb:=
+       dev-libs/libuv:=
+       net-dns/knot:=
+       net-libs/gnutls:=
+       caps? ( sys-libs/libcap-ng )
+       dnstap? (
+               dev-libs/fstrm
+               dev-libs/protobuf-c:=
+       )
+       kresc? ( dev-libs/libedit )
+       nghttp2? ( net-libs/nghttp2:= )
+       systemd? ( sys-apps/systemd:= )
+"
+DEPEND="
+       ${RDEPEND}
+       test? (
+                 dev-util/cmocka
+       )
+"
+BDEPEND="
+       virtual/pkgconfig
+       verify-sig? ( sec-keys/openpgp-keys-knot-resolver )
+"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-5.5.3-docdir.patch
+       "${FILESDIR}"/${PN}-5.5.3-nghttp-openssl.patch
+)
+
+VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/${PN}.gpg
+
+src_unpack() {
+       if use verify-sig; then
+               verify-sig_verify_detached "${DISTDIR}"/${P}.tar.xz{,.asc}
+       fi
+
+       unpack ${P}.tar.xz
+}
+
+src_configure() {
+       local emesonargs=(
+               --localstatedir "${EPREFIX}"/var # double lib
+               # https://bugs.gentoo.org/870019
+               -Dauto_features=disabled
+               -Ddoc=disabled
+               -Ddocdir="${EPREFIX}"/usr/share/doc/${PF}
+               -Dopenssl=disabled
+               $(meson_feature caps capng)
+               $(meson_feature dnstap)
+               $(meson_feature kresc client)
+               $(meson_feature nghttp2)
+               $(meson_feature test unit_tests)
+               $(meson_feature systemd systemd_files)
+       )
+
+       meson_src_configure
+}
+
+src_install() {
+       meson_src_install
+       fowners -R ${PN}: /etc/${PN}
+
+       newinitd "${FILESDIR}"/kresd.initd kresd
+       newconfd "${FILESDIR}"/kresd.confd kresd
+}
+
+pkg_postinst() {
+       use systemd && tmpfiles_process knot-resolver.conf
+}

Reply via email to