summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Weber <xmw@gentoo.org>2012-06-29 08:09:52 +0000
committerMichael Weber <xmw@gentoo.org>2012-06-29 08:09:52 +0000
commit8a253340ef457d18026ccc5aff365f001a49a5d5 (patch)
treedc27493b60386cb817b2c982d082509658fd4e2d /net-misc
parentBump to 2.1.0.68, thanks to Simone Scanzoni. Clean up metadata (diff)
downloadgentoo-2-8a253340ef457d18026ccc5aff365f001a49a5d5.tar.gz
gentoo-2-8a253340ef457d18026ccc5aff365f001a49a5d5.tar.bz2
gentoo-2-8a253340ef457d18026ccc5aff365f001a49a5d5.zip
Version bump (thanks euscan), improve config-check in initd
(Portage version: 2.1.11.3/cvs/Linux x86_64)
Diffstat (limited to 'net-misc')
-rw-r--r--net-misc/radvd/ChangeLog8
-rw-r--r--net-misc/radvd/files/radvd-1.9.1.init71
-rw-r--r--net-misc/radvd/radvd-1.9.1.ebuild70
3 files changed, 148 insertions, 1 deletions
diff --git a/net-misc/radvd/ChangeLog b/net-misc/radvd/ChangeLog
index 389d17b9e16b..090f30c2ae35 100644
--- a/net-misc/radvd/ChangeLog
+++ b/net-misc/radvd/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for net-misc/radvd
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/radvd/ChangeLog,v 1.90 2012/06/21 15:13:20 jer Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/radvd/ChangeLog,v 1.91 2012/06/29 08:09:52 xmw Exp $
+
+*radvd-1.9.1 (29 Jun 2012)
+
+ 29 Jun 2012; Michael Weber <xmw@gentoo.org> +files/radvd-1.9.1.init,
+ +radvd-1.9.1.ebuild:
+ Version bump (thanks euscan), improve config-check in initd
21 Jun 2012; Jeroen Roovers <jer@gentoo.org> radvd-1.8.5-r1.ebuild:
Inherit user instead of eutils.
diff --git a/net-misc/radvd/files/radvd-1.9.1.init b/net-misc/radvd/files/radvd-1.9.1.init
new file mode 100644
index 000000000000..65e81c7f0caf
--- /dev/null
+++ b/net-misc/radvd/files/radvd-1.9.1.init
@@ -0,0 +1,71 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/radvd/files/radvd-1.9.1.init,v 1.1 2012/06/29 08:09:52 xmw 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
+}
+
+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
+
+ 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 --signal HUP \
+ --exec /usr/sbin/radvd --pidfile "${PIDFILE}"
+ eend $?
+}
diff --git a/net-misc/radvd/radvd-1.9.1.ebuild b/net-misc/radvd/radvd-1.9.1.ebuild
new file mode 100644
index 000000000000..5f87f0791de7
--- /dev/null
+++ b/net-misc/radvd/radvd-1.9.1.ebuild
@@ -0,0 +1,70 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/radvd/radvd-1.9.1.ebuild,v 1.1 2012/06/29 08:09:52 xmw Exp $
+
+EAPI=4
+
+inherit user
+
+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 selinux"
+
+RDEPEND="selinux? ( sec-policy/selinux-radvd )"
+DEPEND="${RDEPEND}
+ dev-libs/libdaemon
+ sys-devel/bison
+ sys-devel/flex
+ virtual/pkgconfig"
+
+DOCS=( CHANGES README TODO radvd.conf.example )
+
+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_configure() {
+ econf --with-pidfile=/var/run/radvd/radvd.pid
+}
+
+src_install() {
+ default
+
+ dohtml INTRO.html
+
+ newinitd "${FILESDIR}"/${P}.init ${PN}
+ newconfd "${FILESDIR}"/${PN}.conf ${PN}
+
+ # location of radvd.pid needs to be writeable by the radvd user
+ keepdir /var/run/radvd
+ fowners -R radvd:radvd /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() {
+ elog
+ elog "To use ${PN} you must create the configuration file"
+ elog "${ROOT}etc/radvd.conf"
+ elog
+ elog "An example configuration file has been installed under"
+ elog "${ROOT}usr/share/doc/${PF}"
+ elog
+ elog "grsecurity users should allow a specific group to read /proc"
+ elog "and add the radvd user to that group, otherwise radvd may"
+ elog "segfault on startup."
+}