From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id D8C9515838C for ; Sat, 20 Jan 2024 12:23:33 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E6856E29FF; Sat, 20 Jan 2024 12:23:32 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C2327E29FF for ; Sat, 20 Jan 2024 12:23:32 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D2A5C34332D for ; Sat, 20 Jan 2024 12:23:31 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 52A4014C3 for ; Sat, 20 Jan 2024 12:23:29 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1705753376.b6783bf26fbf710fa3bbf3379c182a131f03d54f.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/radvd/files/, net-misc/radvd/ X-VCS-Repository: repo/gentoo X-VCS-Files: net-misc/radvd/files/radvd-2.19.init net-misc/radvd/radvd-2.19-r7.ebuild X-VCS-Directories: net-misc/radvd/files/ net-misc/radvd/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: b6783bf26fbf710fa3bbf3379c182a131f03d54f X-VCS-Branch: master Date: Sat, 20 Jan 2024 12:23:29 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 43aa549e-e170-49ed-93c4-1d2dcc8dafea X-Archives-Hash: 7988c2d8e82a70b3749ce9080ec4895f commit: b6783bf26fbf710fa3bbf3379c182a131f03d54f Author: Oskari Pirhonen gmail com> AuthorDate: Tue Dec 26 03:59:18 2023 +0000 Commit: Sam James gentoo org> CommitDate: Sat Jan 20 12:22:56 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b6783bf2 net-misc/radvd: small OpenRC service tweaks Provide a `configtest` command usable with `rc-service`. Add some descriptive strings when running `rc-service radvd describe`. Signed-off-by: Oskari Pirhonen gmail.com> Closes: https://github.com/gentoo/gentoo/pull/34479 Signed-off-by: Sam James gentoo.org> net-misc/radvd/files/radvd-2.19.init | 83 ++++++++++++++++++++++++++++++++++++ net-misc/radvd/radvd-2.19-r7.ebuild | 76 +++++++++++++++++++++++++++++++++ 2 files changed, 159 insertions(+) diff --git a/net-misc/radvd/files/radvd-2.19.init b/net-misc/radvd/files/radvd-2.19.init new file mode 100644 index 000000000000..069801e841ab --- /dev/null +++ b/net-misc/radvd/files/radvd-2.19.init @@ -0,0 +1,83 @@ +#!/sbin/openrc-run +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +CONFIGFILE=/etc/radvd.conf +PIDFILE=/run/radvd/radvd.pid +SYSCTL_FORWARD=net.ipv6.conf.all.forwarding + +description="IPv6 Router Advertisement Daemon" + +extra_commands="configtest" +extra_started_commands="reload" +description_configtest="Test the configuration and run startup tests" +description_reload="Reload the radvd configuration file" + +depend() { + need net +} + +checkconfig() { + if [ ! -f "${CONFIGFILE}" ]; then + eerror "Configuration file ${CONFIGFILE} not found" + return 1 + fi + + if ! /usr/sbin/radvd -c -C "${CONFIGFILE}" ; then + eerror "Configuration file ${CONFIGFILE} failed test" + return 1 + fi +} + +configtest() { + ebegin "Checking ${RC_SVCNAME} configuration" + checkconfig + eend $? +} + +start() { + if [ "${FORWARD}" != "no" ]; then + ebegin "Enabling IPv6 forwarding" + sysctl -w "${SYSCTL_FORWARD}=1" >/dev/null + eend $? + fi + + checkconfig || return 1 + + checkpath -d -o radvd:radvd "${PIDFILE%/*}" + + ebegin "Starting IPv6 Router Advertisement Daemon" + start-stop-daemon --start --exec /usr/sbin/radvd \ + --pidfile "${PIDFILE}" \ + -- -C "${CONFIGFILE}" -p "${PIDFILE}" -u radvd ${OPTIONS} + eend $? +} + +stop() { + ebegin "Stopping IPv6 Router Advertisement Daemon" + start-stop-daemon --stop --exec /usr/sbin/radvd --pidfile "${PIDFILE}" + eend $? + + if [ "${FORWARD}" != "no" ]; then + ebegin "Disabling IPv6 forwarding" + sysctl -w "${SYSCTL_FORWARD}=0" > /dev/null + eend $? + fi +} + +reload() { + if [ "${FORWARD}" != "no" ]; then + ebegin "Enabling IPv6 forwarding" + sysctl -w "${SYSCTL_FORWARD}=1" >/dev/null + eend $? + fi + + checkconfig || return 1 + + checkpath -d -o radvd:radvd "${PIDFILE%/*}" + + ebegin "Reloading IPv6 Router Advertisement Daemon" + start-stop-daemon --signal HUP \ + --exec /usr/sbin/radvd --pidfile "${PIDFILE}" + eend $? +} diff --git a/net-misc/radvd/radvd-2.19-r7.ebuild b/net-misc/radvd/radvd-2.19-r7.ebuild new file mode 100644 index 000000000000..803571c1bfce --- /dev/null +++ b/net-misc/radvd/radvd-2.19-r7.ebuild @@ -0,0 +1,76 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit autotools readme.gentoo-r1 systemd toolchain-funcs + +DESCRIPTION="Linux IPv6 Router Advertisement Daemon" +HOMEPAGE="https://radvd.litech.org/" +SRC_URI="https://v6web.litech.org/radvd/dist/${P}.tar.xz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~riscv ~sparc ~x86" +IUSE="selinux test" +RESTRICT="!test? ( test )" + +BDEPEND=" + sys-devel/bison + sys-devel/flex + virtual/pkgconfig" +DEPEND="test? ( dev-libs/check )" +RDEPEND=" + acct-group/radvd + acct-user/radvd + selinux? ( sec-policy/selinux-radvd )" + +PATCHES=( + "${FILESDIR}"/${P}-musl-include.patch + "${FILESDIR}"/${P}-clang16.patch + "${FILESDIR}"/${P}-configure-c99.patch +) + +src_prepare() { + default + + # Drop once clang16 patch is in a release + eautoreconf +} + +src_configure() { + # Needs reentrant functions (yyset_in), bug #884375 + export LEX=flex + + econf --with-pidfile=/run/radvd/radvd.pid \ + --with-systemdsystemunitdir=no \ + $(use_with test check) +} + +src_compile() { + emake AR="$(tc-getAR)" +} + +src_install() { + HTML_DOCS=( INTRO.html ) + default + dodoc radvd.conf.example + + newinitd "${FILESDIR}"/${PN}-2.19.init ${PN} + newconfd "${FILESDIR}"/${PN}.conf ${PN} + + systemd_dounit "${FILESDIR}"/${PN}.service + + DISABLE_AUTOFORMATTING=1 + local DOC_CONTENTS="Please create a configuration file ${EPREFIX}/etc/radvd.conf. +See ${EPREFIX}/usr/share/doc/${PF} for an example. + +grsecurity users should allow a specific group to read /proc +and add the radvd user to that group, otherwise radvd may +segfault on startup." + readme.gentoo_create_doc +} + +pkg_postinst() { + readme.gentoo_print_elog +}