diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2012-10-22 06:29:34 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2012-10-22 06:30:49 +0000 |
commit | 0a5e89eab97504fe901bdae1c6bb87b360d59aff (patch) | |
tree | b28541b0f1763d6945b10055eaf94b599ad40034 /main | |
parent | ea1d2187ea42928c1200d87ff6856e0107a70c99 (diff) | |
download | aports-0a5e89eab97504fe901bdae1c6bb87b360d59aff.tar.bz2 aports-0a5e89eab97504fe901bdae1c6bb87b360d59aff.tar.xz |
main/radvd: moved from testing
Diffstat (limited to 'main')
-rw-r--r-- | main/radvd/APKBUILD | 56 | ||||
-rw-r--r-- | main/radvd/radvd-1.1-gnu-source.patch | 11 | ||||
-rw-r--r-- | main/radvd/radvd.confd | 11 | ||||
-rw-r--r-- | main/radvd/radvd.initd | 67 |
4 files changed, 145 insertions, 0 deletions
diff --git a/main/radvd/APKBUILD b/main/radvd/APKBUILD new file mode 100644 index 0000000000..6861da4988 --- /dev/null +++ b/main/radvd/APKBUILD @@ -0,0 +1,56 @@ +# Contributor: Natanael Copa <ncopa@alpinelinux.org> +# Maintainer: Natanael Copa <ncopa@alpinelinux.org> +pkgname=radvd +pkgver=1.8 +pkgrel=1 +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 +ed1e493b9cd46b705886b8934ebc988f radvd.initd +7593b61c3198d961cc86dd5b85b9f44a radvd.confd" diff --git a/main/radvd/radvd-1.1-gnu-source.patch b/main/radvd/radvd-1.1-gnu-source.patch new file mode 100644 index 0000000000..fc0d883557 --- /dev/null +++ b/main/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/main/radvd/radvd.confd b/main/radvd/radvd.confd new file mode 100644 index 0000000000..e025c6862f --- /dev/null +++ b/main/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/main/radvd/radvd.initd b/main/radvd/radvd.initd new file mode 100644 index 0000000000..8510ae1cca --- /dev/null +++ b/main/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.6 2011/12/04 10:14:13 swegener Exp $ + +CONFIGFILE=/etc/radvd.conf +PIDFILE=/var/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 + + 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 $? +} |