diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2011-11-08 01:04:04 +0000 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2011-11-08 01:04:04 +0000 |
commit | c16fbd9aed7342c0de45d339cc3e02653e6d07b4 (patch) | |
tree | c364c4ea6ae1f2ebeaa78e36a26f947c2700c6d4 /net-misc/minissdpd | |
parent | Add rdep on net-mail/mailbase (bug #389797 by Tiziano Müller). (diff) | |
download | gentoo-2-c16fbd9aed7342c0de45d339cc3e02653e6d07b4.tar.gz gentoo-2-c16fbd9aed7342c0de45d339cc3e02653e6d07b4.tar.bz2 gentoo-2-c16fbd9aed7342c0de45d339cc3e02653e6d07b4.zip |
Allow configuration of interfaces on which to listen
(Portage version: 2.1.10.11/cvs/Linux x86_64)
Diffstat (limited to 'net-misc/minissdpd')
-rw-r--r-- | net-misc/minissdpd/ChangeLog | 7 | ||||
-rw-r--r-- | net-misc/minissdpd/files/minissdpd.confd | 10 | ||||
-rw-r--r-- | net-misc/minissdpd/files/minissdpd.initd-r1 | 61 | ||||
-rw-r--r-- | net-misc/minissdpd/minissdpd-1.1.20111007-r1.ebuild | 36 |
4 files changed, 114 insertions, 0 deletions
diff --git a/net-misc/minissdpd/ChangeLog b/net-misc/minissdpd/ChangeLog index a906788c26cd..902e20a37edb 100644 --- a/net-misc/minissdpd/ChangeLog +++ b/net-misc/minissdpd/ChangeLog @@ -1,5 +1,12 @@ +*minissdpd-1.1.20111007-r1 (08 Nov 2011) + + 08 Nov 2011; Anthony G. Basile <blueness@gentoo.org> + +minissdpd-1.1.20111007-r1.ebuild, +files/minissdpd.confd, + +files/minissdpd.initd-r1: + Allow configuration of interfaces on which to listen + *minissdpd-1.1.20111007 (14 Oct 2011) 14 Oct 2011; Anthony G. Basile <blueness@gentoo.org> diff --git a/net-misc/minissdpd/files/minissdpd.confd b/net-misc/minissdpd/files/minissdpd.confd new file mode 100644 index 000000000000..43b662eca182 --- /dev/null +++ b/net-misc/minissdpd/files/minissdpd.confd @@ -0,0 +1,10 @@ +# /etc/conf.d/minissdpd: config file for /etc/init.d/minissdpd + +# Configure on which interface or interfaces minissdpd will listen. +# List all interfaces space separated. If this is not specified then +# minissdpd will listen on just the interface for the default route. +# You probably want that when running minissdpd with miniupnpc on the +# client, but you most likely want to specify the internal interface +# when running with miniupnpd on the gateway. +# +# MINISSDPD_IFACE="eth0 eth1" diff --git a/net-misc/minissdpd/files/minissdpd.initd-r1 b/net-misc/minissdpd/files/minissdpd.initd-r1 new file mode 100644 index 000000000000..e29d21ef4357 --- /dev/null +++ b/net-misc/minissdpd/files/minissdpd.initd-r1 @@ -0,0 +1,61 @@ +#!/sbin/runscript + +MINISSDPD="/usr/sbin/minissdpd" +PIDFILE="/var/run/minissdpd.pid" + +ROUTE="/sbin/route" +IFCONFIG="/sbin/ifconfig" + +depend() { + need net + before miniupnpd +} + +checkconfig() { + if [ "x$MINISSDPD" != "x" ]; then + interfaces=$($IFCONFIG | grep "Link encap" | awk '{ print $1 }') + for interface in $MINISSDPD; do + hit=0 + for available in $interfaces; do + if [ "$interface" = "$available" ]; then + hit=1 + fi + done + if [ $hit = 0 ]; then + ewarn "Interface $interface not available" + return 1 + fi + done + fi + return 0 +} + +start() { + ebegin "Starting minissdpd" + checkconfig || return 1 + + if [ "x$MINISSDPD" = "x" ]; then + # We assume that the default interface has an IP address + interface=$($ROUTE | grep default | awk -- '{ print $8 }') + IP="$($IFCONFIG $interface | grep 'inet addr' | sed 's/.\+inet addr:\([0-9.]\+\).\+/\1/')" + ARGS="-i $IP " + else + ARGS="" + for interface in $MINISSDPD; do + # An interface may not have an IP address, so don't listen if it doesn't + IP="$($IFCONFIG $interface | grep 'inet addr' | sed 's/.\+inet addr:\([0-9.]\+\).\+/\1/')" + if [ "x$IP" != "x" ]; then + ARGS+="-i $IP " + fi + done + fi + + start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $MINISSDPD -- $ARGS + eend $? +} + +stop() { + ebegin "Stopping minissdpd" + start-stop-daemon --stop --pidfile "${PIDFILE}" + eend $? +} diff --git a/net-misc/minissdpd/minissdpd-1.1.20111007-r1.ebuild b/net-misc/minissdpd/minissdpd-1.1.20111007-r1.ebuild new file mode 100644 index 000000000000..429dea1788d7 --- /dev/null +++ b/net-misc/minissdpd/minissdpd-1.1.20111007-r1.ebuild @@ -0,0 +1,36 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/minissdpd/minissdpd-1.1.20111007-r1.ebuild,v 1.1 2011/11/08 01:04:03 blueness Exp $ + +EAPI=4 +inherit eutils toolchain-funcs + +DESCRIPTION="MiniSSDP Daemon" +SRC_URI="http://miniupnp.free.fr/files/${P}.tar.gz" +HOMEPAGE="http://miniupnp.free.fr/" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="" + +DEPEND="" +RDEPEND="sys-apps/net-tools + || ( net-misc/miniupnpd net-libs/miniupnpc )" + +src_prepare() { + epatch "${FILESDIR}/${PN}-respect-CFLAGS.patch" + epatch "${FILESDIR}/${PN}-remove-initd.patch" +} + +src_compile() { + emake CC="$(tc-getCC)" +} + +src_install () { + einstall PREFIX="${D}" + newinitd "${FILESDIR}/${PN}.initd-r1" ${PN} + newconfd "${FILESDIR}/${PN}.confd" ${PN} + dodoc Changelog.txt README + doman minissdpd.1 +} |