diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2011-07-15 09:27:10 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2011-07-15 09:37:04 +0000 |
commit | e5c3b3f71702b18447d65f6d9bae2858c055d2f5 (patch) | |
tree | 757277165d587b13f6120b33e3dc214282ac5f2f /testing/radvd | |
parent | 6856d1c7ad99d4870ed8f270019fb5b320d0342e (diff) | |
download | aports-e5c3b3f71702b18447d65f6d9bae2858c055d2f5.tar.bz2 aports-e5c3b3f71702b18447d65f6d9bae2858c055d2f5.tar.xz |
testing/radvd: new aport radvd
A Router Advertisement daemon"
http://www.litech.org/radvd/"
Diffstat (limited to 'testing/radvd')
-rw-r--r-- | testing/radvd/APKBUILD | 56 | ||||
-rw-r--r-- | testing/radvd/radvd-1.1-gnu-source.patch | 11 | ||||
-rw-r--r-- | testing/radvd/radvd.confd | 11 | ||||
-rw-r--r-- | testing/radvd/radvd.initd | 67 |
4 files changed, 145 insertions, 0 deletions
diff --git a/testing/radvd/APKBUILD b/testing/radvd/APKBUILD new file mode 100644 index 0000000000..93195bd10d --- /dev/null +++ b/testing/radvd/APKBUILD @@ -0,0 +1,56 @@ +# Contributor: Natanael Copa <ncopa@alpinelinux.org> +# Maintainer: Natanael Copa <ncopa@alpinelinux.org> +pkgname=radvd +pkgver=1.8 +pkgrel=0 +pkgdesc="A Router Advertisement daemon" +url="http://www.litech.org/radvd/" +arch="all" +license="BSD with advertising" +depends="" +depends_dev="" +makedepends="flex bison" +install="" +subpackages="$pkgname-doc" +source="http://www.litech.org/radvd/dist/radvd-$pkgver.tar.gz + radvd-1.1-gnu-source.patch + radvd.initd + radvd.confd + " + +_builddir="$srcdir"/radvd-$pkgver +prepare() { + local i + cd "$_builddir" + for i in $source; do + case $i in + *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; + esac + done +} + +build() { + cd "$_builddir" + ./configure --prefix=/usr \ + --sysconfdir=/etc/ \ + --with-pidfile=/var/run/radvd/radvd.pid \ + || return 1 + # work around parallel build issue + make gram.h && make || return 1 +} + +package() { + cd "$_builddir" + make -j1 DESTDIR="$pkgdir" install || return 1 + mkdir -p "$pkgdir"/var/run/radvd + + install -Dm755 "$srcdir"/radvd.initd "$pkgdir"/etc/init.d/radvd \ + || return 1 + install -Dm644 "$srcdir"/radvd.confd "$pkgdir"/etc/conf.d/radvd \ + || return 1 +} + +md5sums="50b4cfbdfa04d629d80437fd1d9e2aef radvd-1.8.tar.gz +c0297515f242d8e8e890d4cdc38bc5b4 radvd-1.1-gnu-source.patch +6af530b901277953d662dfaf2f5d42e6 radvd.initd +7593b61c3198d961cc86dd5b85b9f44a radvd.confd" diff --git a/testing/radvd/radvd-1.1-gnu-source.patch b/testing/radvd/radvd-1.1-gnu-source.patch new file mode 100644 index 0000000000..fc0d883557 --- /dev/null +++ b/testing/radvd/radvd-1.1-gnu-source.patch @@ -0,0 +1,11 @@ +--- radvd-1.1.orig/includes.h 2007-10-25 21:29:40.000000000 +0200 ++++ radvd-1.1/includes.h 2008-06-14 12:30:25.000000000 +0200 +@@ -18,6 +18,8 @@ + + #include <config.h> + ++#define _GNU_SOURCE /* needed for struct in6_pktinfo */ ++ + #include <string.h> + #include <stdio.h> + #include <stdarg.h> diff --git a/testing/radvd/radvd.confd b/testing/radvd/radvd.confd new file mode 100644 index 0000000000..e025c6862f --- /dev/null +++ b/testing/radvd/radvd.confd @@ -0,0 +1,11 @@ +# 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="" + +# Set this to "no" to tell the init script NOT to set up IPv6 forwarding +# using /proc/sys/net/ipv6/conf/all/forwarding +# Only change this if you know what you're doing! +FORWARD="yes" diff --git a/testing/radvd/radvd.initd b/testing/radvd/radvd.initd new file mode 100644 index 0000000000..df6faf7a9c --- /dev/null +++ b/testing/radvd/radvd.initd @@ -0,0 +1,67 @@ +#!/sbin/runscript +# 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.4 2011/03/05 10:43:29 vapier Exp $ + +CONFIGFILE=/etc/radvd.conf +PIDFILE=/var/run/radvd/radvd.pid +SYSCTL_FORWARD=net.ipv6.conf.all.forwarding + +opts="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 + + if [ "${FORWARD}" != "no" ]; then + ebegin "Enabling IPv6 forwarding" + sysctl -w "${SYSCTL_FORWARD}=1" >/dev/null + eend $? + fi + + 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() { + checkconfig || return 1 + + if [ "${FORWARD}" != "no" ]; then + ebegin "Enabling IPv6 forwarding" + sysctl -w "${SYSCTL_FORWARD}=1" >/dev/null + eend $? + fi + + ebegin "Reloading IPv6 Router Advertisement Daemon" + start-stop-daemon --stop --signal HUP --oknodo \ + --exec /usr/sbin/radvd --pidfile "${PIDFILE}" + eend $? +} |