summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--net-misc/radvd/files/radvd-1.1-gnu-source.patch11
-rw-r--r--net-misc/radvd/files/radvd-1.1-parallel-make.patch9
-rw-r--r--net-misc/radvd/files/radvd.conf11
-rw-r--r--net-misc/radvd/files/radvd.init64
-rw-r--r--net-misc/radvd/radvd-1.1.ebuild77
5 files changed, 172 insertions, 0 deletions
diff --git a/net-misc/radvd/files/radvd-1.1-gnu-source.patch b/net-misc/radvd/files/radvd-1.1-gnu-source.patch
new file mode 100644
index 00000000..fc0d8835
--- /dev/null
+++ b/net-misc/radvd/files/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/net-misc/radvd/files/radvd-1.1-parallel-make.patch b/net-misc/radvd/files/radvd-1.1-parallel-make.patch
new file mode 100644
index 00000000..b612a9aa
--- /dev/null
+++ b/net-misc/radvd/files/radvd-1.1-parallel-make.patch
@@ -0,0 +1,9 @@
+diff -Nuar radvd-1.1.orig/Makefile.am radvd-1.1/Makefile.am
+--- radvd-1.1.orig/Makefile.am 2008-01-24 02:03:17.000000000 -0800
++++ radvd-1.1/Makefile.am 2008-11-18 15:55:59.698396162 -0800
+@@ -61,3 +61,5 @@
+ mkdir $(distdir)/redhat
+ cp -p $(srcdir)/redhat/radvd.init $(srcdir)/redhat/radvd.spec \
+ $(srcdir)/redhat/radvd.sysconfig $(distdir)/redhat
++
++gram.h: gram.y
diff --git a/net-misc/radvd/files/radvd.conf b/net-misc/radvd/files/radvd.conf
new file mode 100644
index 00000000..e025c686
--- /dev/null
+++ b/net-misc/radvd/files/radvd.conf
@@ -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/net-misc/radvd/files/radvd.init b/net-misc/radvd/files/radvd.init
new file mode 100644
index 00000000..436e9341
--- /dev/null
+++ b/net-misc/radvd/files/radvd.init
@@ -0,0 +1,64 @@
+#!/sbin/runscript
+# 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.init,v 1.3 2008/11/19 00:00:24 robbat2 Exp $
+
+CONFIGFILE=/etc/radvd.conf
+PIDFILE=/var/run/radvd/radvd.pid
+SYSCTL_FORWARD=net.ipv6.conf.all.forwarding
+
+opts="reload"
+
+depend () {
+ need net
+}
+
+checkconfig() {
+ if [ ! -f "${CONFIGFILE}" ]; then
+ eerror "Configuration file ${CONFIGFILE} not found"
+ return 1
+ fi
+}
+
+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 $?
+}
diff --git a/net-misc/radvd/radvd-1.1.ebuild b/net-misc/radvd/radvd-1.1.ebuild
new file mode 100644
index 00000000..0ad7f07c
--- /dev/null
+++ b/net-misc/radvd/radvd-1.1.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/radvd/radvd-1.1.ebuild,v 1.8 2009/03/18 06:57:03 josejx Exp $
+
+inherit eutils autotools
+
+DESCRIPTION="Linux IPv6 Router Advertisement Daemon"
+HOMEPAGE="http://v6web.litech.org/radvd/"
+SRC_URI="http://v6web.litech.org/radvd/dist/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="amd64 arm hppa ppc sparc x86 ~x86-fbsd"
+IUSE="kernel_FreeBSD"
+
+DEPEND="sys-devel/bison
+ sys-devel/flex"
+RDEPEND=""
+WANT_AUTOMAKE="1.9"
+
+pkg_setup() {
+ enewgroup radvd
+ enewuser radvd -1 -1 /dev/null radvd
+
+ # force ownership of radvd user and group (bug #19647)
+ [[ -d ${ROOT}/var/run/radvd ]] && chown radvd:radvd "${ROOT}"/var/run/radvd
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${PN}-1.1-gnu-source.patch
+ epatch "${FILESDIR}"/${PN}-1.1-parallel-make.patch
+ eautomake
+}
+
+src_compile() {
+ econf \
+ --with-pidfile=/var/run/radvd/radvd.pid \
+ || die "econf failed"
+
+ emake || die "emake failed"
+}
+
+src_install() {
+ make DESTDIR="${D}" install || die "make install failed"
+
+ dodoc CHANGES README TODO radvd.conf.example
+ dohtml INTRO.html
+
+ newinitd "${FILESDIR}/${PN}".init "${PN}"
+ newconfd "${FILESDIR}/${PN}".conf "${PN}"
+
+ # location of radvd.pid needs to be writeable by the radvd user
+ keepdir /var/run/radvd
+ chown -R radvd:radvd "${D}"/var/run/radvd
+ fperms 755 /var/run/radvd
+
+ if use kernel_FreeBSD ; then
+ sed -i -e \
+ 's/^SYSCTL_FORWARD=.*$/SYSCTL_FORWARD=net.inet6.ip6.forwarding/g' \
+ "${D}"/etc/init.d/"${PN}" || die
+ fi
+}
+
+pkg_postinst() {
+ einfo
+ einfo "To use ${PN} you must create the configuration file"
+ einfo "${ROOT}/etc/radvd.conf"
+ einfo
+ einfo "An example configuration file has been installed under"
+ einfo "${ROOT}/usr/share/doc/${PF}"
+ einfo
+ einfo "grsecurity users should allow a specific group to read /proc"
+ einfo "and add the radvd user to that group, otherwise radvd may"
+ einfo "segfault on startup."
+}