summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPÁLI Gábor János <pali.gabor@gmail.com>2023-09-24 10:02:17 +0200
committerPÁLI Gábor János <pali.gabor@gmail.com>2023-09-26 11:53:45 +0200
commitcd4ad7988e34326f1cc9552c71e522c8d31b1cc3 (patch)
treef82dc373ce18f3a94163371af2d99399ad4ce978
parente7633ba62583438640cdaa216c0f8f00bc37ad91 (diff)
downloadfreebsd-wifibox-alpine-cd4ad7988e34326f1cc9552c71e522c8d31b1cc3.zip
radvd: import
-rw-r--r--aports/radvd/APKBUILD43
-rw-r--r--aports/radvd/fix-alpine-plz.patch32
-rw-r--r--aports/radvd/radvd.confd6
-rw-r--r--aports/radvd/radvd.initd49
4 files changed, 130 insertions, 0 deletions
diff --git a/aports/radvd/APKBUILD b/aports/radvd/APKBUILD
new file mode 100644
index 0000000..78e4a95
--- /dev/null
+++ b/aports/radvd/APKBUILD
@@ -0,0 +1,43 @@
+# Maintainer: Gabor Pali <pali.gabor@gmail.com>
+#
+pkgname=radvd
+pkgver=2.19
+pkgrel=0 # base: 3
+pkgdesc="IPv6 router advertisement daemon"
+url="http://www.litech.org/radvd"
+arch="all"
+license="BSD with advertising"
+makedepends="flex bison linux-headers"
+install=
+source="http://www.litech.org/radvd/dist/radvd-$pkgver.tar.xz
+ radvd.initd
+ radvd.confd
+ fix-alpine-plz.patch
+ "
+options="!check"
+
+build() {
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc/ \
+ --without-check \
+ --with-pidfile=/run/radvd/radvd.pid
+ # work around parallel build issue
+ make gram.h && make
+}
+
+package() {
+ make -j1 DESTDIR="$pkgdir" install-exec
+ install -Dm755 "$srcdir"/radvd.initd "$pkgdir"/etc/init.d/radvd
+ install -Dm644 "$srcdir"/radvd.confd "$pkgdir"/etc/conf.d/radvd
+ ln -s /media/etc/radvd.conf "$pkgdir"/etc
+}
+
+sha512sums="
+a1eb40af90fc83ebab2517c16a0f7e85c11338ab276bec400b7c33177748d1e36bc5abd7e373b6742f12f7c690dd7ae6b951bc832c7de9bbb56f7e9bc844ed22 radvd-2.19.tar.xz
+fd78249b8ae25d1c55fc0b5cc2b3dd202388c0ca7be2737ecbd33ed5cd3c8616858aa46350967350fe8e8c0032552126918c8b9c36b13d799f3c5d8fb576fdf8 radvd.initd
+31cca1d48e5f0c4fe96a7a32ca6339e7aa9e478f7e9086f05bbc79ca59b1637d99e46079d7be77ef717a8fb975fada7664058e3bc61117309025b72f3e87d294 radvd.confd
+dffe4167c54c430fc38953e70d546fdf443944eceee4c610f14d63947fe8c04960b48a8acf5742edf8721558c4b811c9a4033ad9abe787ead9cc1bb0721b654c fix-alpine-plz.patch
+"
diff --git a/aports/radvd/fix-alpine-plz.patch b/aports/radvd/fix-alpine-plz.patch
new file mode 100644
index 0000000..cf7806e
--- /dev/null
+++ b/aports/radvd/fix-alpine-plz.patch
@@ -0,0 +1,32 @@
+From 06689f8c06f44c7e87f7ff1d814428f88375b53f Mon Sep 17 00:00:00 2001
+From: Jonathan Davies <jpds@protonmail.com>
+Date: Thu, 25 Nov 2021 15:29:18 +0000
+Subject: [PATCH] Reverts the include.h change in
+ 46883f8a1a02fe42040dd8e48aec0ed871545d4d
+
+Closes: #158
+
+Signed-off-by: Jonathan Davies <jpds@protonmail.com>
+---
+ includes.h | 5 -----
+ 1 file changed, 5 deletions(-)
+
+Patch-Origin: https://github.com/radvd-project/radvd/commit/06689f8c06f44c7e87f7ff1d814428f88375b53f
+
+diff --git a/includes.h b/includes.h
+index ef30b10..c528c86 100644
+--- a/includes.h
++++ b/includes.h
+@@ -76,12 +76,7 @@
+ #include <sys/sysctl.h>
+ #endif
+
+-#if !defined(__GLIBC__) && defined(linux)
+-#include <linux/if.h>
+-#define IF_NAMESIZE IFNAMSIZ
+-#else
+ #include <net/if.h>
+-#endif
+
+ #ifdef HAVE_NET_IF_DL_H
+ #include <net/if_dl.h>
diff --git a/aports/radvd/radvd.confd b/aports/radvd/radvd.confd
new file mode 100644
index 0000000..2c230ea
--- /dev/null
+++ b/aports/radvd/radvd.confd
@@ -0,0 +1,6 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/radvd/files/radvd.conf,v 1.1 2006/07/19 13:02:36 uberlord Exp $
+
+# Extra options to pass to radvd
+OPTIONS=""
diff --git a/aports/radvd/radvd.initd b/aports/radvd/radvd.initd
new file mode 100644
index 0000000..108e483
--- /dev/null
+++ b/aports/radvd/radvd.initd
@@ -0,0 +1,49 @@
+#!/sbin/openrc-run
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/radvd/files/radvd.init,v 1.6 2011/12/04 10:14:13 swegener Exp $
+
+CONFIGFILE=/etc/radvd.conf
+PIDFILE=/run/radvd/radvd.pid
+SYSCTL_FORWARD=net.ipv6.conf.all.forwarding
+
+extra_started_commands="reload"
+
+depend() {
+ need net
+ after firewall
+}
+
+checkconfig() {
+ if [ ! -f "${CONFIGFILE}" ]; then
+ eerror "Configuration file ${CONFIGFILE} not found"
+ return 1
+ fi
+
+ checkpath -d -o radvd:radvd ${PIDFILE%/*}
+}
+
+start() {
+ checkconfig || return 1
+
+ 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 $?
+}
+
+reload() {
+ checkconfig || return 1
+
+ ebegin "Reloading IPv6 Router Advertisement Daemon"
+ start-stop-daemon --stop --signal HUP --oknodo \
+ --exec /usr/sbin/radvd --pidfile "${PIDFILE}"
+ eend $?
+}