summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /net-misc/minissdpd/files
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'net-misc/minissdpd/files')
-rw-r--r--net-misc/minissdpd/files/minissdpd-1.2-remove-initd.patch14
-rw-r--r--net-misc/minissdpd/files/minissdpd-1.2-respect-CC.patch12
-rw-r--r--net-misc/minissdpd/files/minissdpd.confd10
-rw-r--r--net-misc/minissdpd/files/minissdpd.initd-r161
-rw-r--r--net-misc/minissdpd/files/minissdpd.initd-r261
5 files changed, 158 insertions, 0 deletions
diff --git a/net-misc/minissdpd/files/minissdpd-1.2-remove-initd.patch b/net-misc/minissdpd/files/minissdpd-1.2-remove-initd.patch
new file mode 100644
index 000000000000..9a5f5966e90f
--- /dev/null
+++ b/net-misc/minissdpd/files/minissdpd-1.2-remove-initd.patch
@@ -0,0 +1,14 @@
+diff -Naur minissdpd-1.1.20120121.orig//Makefile minissdpd-1.1.20120121/Makefile
+--- minissdpd-1.1.20120121.orig//Makefile 2012-01-02 05:46:24.000000000 -0500
++++ minissdpd-1.1.20120121/Makefile 2012-01-22 07:01:54.000000000 -0500
+@@ -42,10 +42,6 @@
+ $(INSTALL) minissdpd $(SBININSTALLDIR)
+ $(INSTALL) -d $(MANINSTALLDIR)/man1
+ $(INSTALL) minissdpd.1 $(MANINSTALLDIR)/man1/minissdpd.1
+-ifneq ($(OS), Darwin)
+- $(INSTALL) -d $(PREFIX)/etc/init.d
+- $(INSTALL) minissdpd.init.d.script $(PREFIX)/etc/init.d/minissdpd
+-endif
+
+ minissdpd: $(MINISSDPDOBJS)
+ $(CC) $(CFLAGS) -o $@ $(MINISSDPDOBJS)
diff --git a/net-misc/minissdpd/files/minissdpd-1.2-respect-CC.patch b/net-misc/minissdpd/files/minissdpd-1.2-respect-CC.patch
new file mode 100644
index 000000000000..99d8c947fcbd
--- /dev/null
+++ b/net-misc/minissdpd/files/minissdpd-1.2-respect-CC.patch
@@ -0,0 +1,12 @@
+diff -Naur minissdpd-1.2.orig//Makefile minissdpd-1.2/Makefile
+--- minissdpd-1.2.orig//Makefile 2012-05-02 06:26:50.000000000 -0400
++++ minissdpd-1.2/Makefile 2012-05-25 10:02:32.000000000 -0400
+@@ -18,7 +18,7 @@
+ CFLAGS += -fno-strict-aliasing -fno-common
+ CFLAGS += -D_GNU_SOURCE
+ CFLAGS += -ansi
+-CC = gcc
++CC ?= gcc
+ RM = rm -f
+ INSTALL = install
+ OS = $(shell uname -s)
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..d09ed2c5a985
--- /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="/bin/route"
+IFCONFIG="/bin/ifconfig"
+
+depend() {
+ need net
+ before miniupnpd
+}
+
+checkconfig() {
+ if [ "x$MINISSDPD_IFACE" != "x" ]; then
+ interfaces=$($IFCONFIG | grep "Link encap" | awk '{ print $1 }')
+ for interface in $MINISSDPD_IFACE; 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_IFACE" = "x" ]; then
+ # We assume that the default interface has an IP address
+ interface=$($ROUTE | grep default | awk -- '{ print $8 }')
+ IP="$($IFCONFIG $interface | grep 'inet' | sed 's/^.*inet \([0-9.]\+\).\+/\1/')"
+ ARGS="-i $IP "
+ else
+ ARGS=""
+ for interface in $MINISSDPD_IFACE; do
+ # An interface may not have an IP address, so don't listen if it doesn't
+ IP="$($IFCONFIG $interface | grep 'inet' | sed 's/^.*inet \([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/files/minissdpd.initd-r2 b/net-misc/minissdpd/files/minissdpd.initd-r2
new file mode 100644
index 000000000000..97f5f4070e5f
--- /dev/null
+++ b/net-misc/minissdpd/files/minissdpd.initd-r2
@@ -0,0 +1,61 @@
+#!/sbin/runscript
+
+MINISSDPD="/usr/sbin/minissdpd"
+PIDFILE="/var/run/minissdpd.pid"
+
+depend() {
+ need net
+ before miniupnpd
+}
+
+interfaceup() {
+ # interface exists?
+ if [ ! -f /sys/class/net/$1/flags ]; then return 1; fi
+ let "IFUP = `cat /sys/class/net/$1/flags` & 1"
+ # interface has UP flag?
+ if [ $IFUP -eq 0 ]; then return 1; fi
+ return 0
+}
+
+# awk script: scans the /proc routing table for local subnets
+# 1. filter list for entries with a gateway (column 3) of 0.0.0.0 (ie interface-local)
+# 2. read column 2 for network-order hex encoded subnet address
+# 3. match against a 10.x.x.x, 172.(16-31).x.x, or 192.168.x.x address
+# 4. print out any interface (column 1) that matches
+privateinterfaces() {
+ awk -f - /proc/net/route <<'FindPrivateNetworks'
+function p(m,n) { return(and(IP,m) == n); }
+$3=="00000000" { IP=strtonum("0x"$2); if (p(0xff,0x0a) || p(0x1fff,0x10ac) || p(0xffff,0xa8c0)) print $1; }
+FindPrivateNetworks
+}
+
+start() {
+ ebegin "Starting minissdpd"
+
+ ARGS=""
+ if [ "x$MINISSDPD_IFACE" = "x" ]; then
+ ewarn "No interfaces provided, using interfaces on private networks"
+ IFLIST=$(privateinterfaces)
+ else
+ IFLIST="$MINISSDPD_IFACE"
+ fi
+
+ eindent
+ for IF in $IFLIST; do
+ if interfaceup $IF; then
+ einfo Adding interface $IF
+ ARGS+="-i $IF "
+ else
+ ewarn "Interface $IF is not up"
+ fi
+ done
+ eoutdent
+ start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $MINISSDPD -- $ARGS
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping minissdpd"
+ start-stop-daemon --stop --pidfile "${PIDFILE}"
+ eend $?
+}