diff options
author | Pablo Oses <opablo@gmail.com> | 2010-05-12 23:32:25 +0200 |
---|---|---|
committer | Robby Workman <rworkman@slackbuilds.org> | 2010-05-12 23:32:25 +0200 |
commit | dbf69b7af097d6868491f123336d7fd0d1271de0 (patch) | |
tree | c308202d1702597873bbbfd44512c1250ab558ea | |
parent | 2576f42871101c77f74cc25feb43846a93a1571b (diff) |
network/miniupnpd: Added to 12.2 repository
-rw-r--r-- | network/miniupnpd/README | 12 | ||||
-rw-r--r-- | network/miniupnpd/doinst.sh | 25 | ||||
-rw-r--r-- | network/miniupnpd/miniupnpd.SlackBuild | 73 | ||||
-rw-r--r-- | network/miniupnpd/miniupnpd.info | 8 | ||||
-rw-r--r-- | network/miniupnpd/rc.miniupnpd | 53 | ||||
-rw-r--r-- | network/miniupnpd/slack-desc | 19 |
6 files changed, 190 insertions, 0 deletions
diff --git a/network/miniupnpd/README b/network/miniupnpd/README new file mode 100644 index 000000000000..8db51fd97a21 --- /dev/null +++ b/network/miniupnpd/README @@ -0,0 +1,12 @@ +The MiniUPnP daemon (MiniUPnPd) is software which supports the +UPnP Internet Gateway Device (IGD) specifications and the NAT Port +Mapping Protocol (NAT-PMP). + +UPnP-IGD and NAT-PMP are used to improve internet connectivity for +devices behind a NAT router. Any peer to peer network application +such as games, IM, etc. can benefit from a NAT router supporting +UPnP and/or NAT-PMP. + +Edit the config files before starting (including the .sh files) + +This requires libiptc. diff --git a/network/miniupnpd/doinst.sh b/network/miniupnpd/doinst.sh new file mode 100644 index 000000000000..894073810774 --- /dev/null +++ b/network/miniupnpd/doinst.sh @@ -0,0 +1,25 @@ +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then + # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +# Keep same perms on rc.miniupnpd.new: +if [ -e etc/rc.d/rc.miniupnpd ]; then + cp -a etc/rc.d/rc.miniupnpd etc/rc.d/rc.miniupnpd.new.incoming + cat etc/rc.d/rc.miniupnpd.new > etc/rc.d/rc.miniupnpd.new.incoming + mv etc/rc.d/rc.miniupnpd.new.incoming etc/rc.d/rc.miniupnpd.new +fi + +config etc/rc.d/rc.miniupnpd.new +config etc/miniupnpd/miniupnpd.conf.new +config etc/miniupnpd/iptables_init.sh.new +config etc/miniupnpd/iptables_removeall.sh.new + diff --git a/network/miniupnpd/miniupnpd.SlackBuild b/network/miniupnpd/miniupnpd.SlackBuild new file mode 100644 index 000000000000..88a196fa8a91 --- /dev/null +++ b/network/miniupnpd/miniupnpd.SlackBuild @@ -0,0 +1,73 @@ +#!/bin/sh + +# Slackware build script for miniupnpd + +# Written by Pablo Oses <opablo@gmail.com> + +PRGNAM=miniupnpd +VERSION=${VERSION:-1.3} +ARCH=${ARCH:-i486} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP + +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +cd $PRGNAM-$VERSION +chown -R root:root . +find . \ + \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ + -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ + -exec chmod 644 {} \; + +make -f Makefile.linux config.h + +make CFLAGS+="$SLKCFLAGS" CXXFLAGS+="$SLKCFLAGS" -f Makefile.linux + +PREFIX=$PKG make -f Makefile.linux install + +# Replace the sample init script with a slackware compatible one +rm -rf $PKG/etc/init.d +mkdir -p $PKG/etc/rc.d +cat $CWD/rc.miniupnpd > $PKG/etc/rc.d/rc.miniupnpd.new +chmod 0755 $PKG/etc/rc.d/rc.miniupnpd.new + +# Rename the sample config files adding '.new' +for i in iptables_init.sh iptables_removeall.sh miniupnpd.conf ; do + mv $PKG/etc/miniupnpd/${i} $PKG/etc/miniupnpd/${i}.new ; +done + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a \ + INSTALL LICENCE README \ + $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/doinst.sh > $PKG/install/doinst.sh +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz diff --git a/network/miniupnpd/miniupnpd.info b/network/miniupnpd/miniupnpd.info new file mode 100644 index 000000000000..28a5dfe3f068 --- /dev/null +++ b/network/miniupnpd/miniupnpd.info @@ -0,0 +1,8 @@ +PRGNAM="miniupnpd" +VERSION="1.3" +HOMEPAGE="http://miniupnp.free.fr" +DOWNLOAD="http://miniupnp.free.fr/files/miniupnpd-1.3.tar.gz" +MD5SUM="b5e70e80dcf45b424b8fe3c966bdc613" +MAINTAINER="Pablo Oses" +EMAIL="opablo@gmail.com" +APPROVED="rworkman" diff --git a/network/miniupnpd/rc.miniupnpd b/network/miniupnpd/rc.miniupnpd new file mode 100644 index 000000000000..1d8b6c594fd3 --- /dev/null +++ b/network/miniupnpd/rc.miniupnpd @@ -0,0 +1,53 @@ +#!/bin/sh + +# $Id: miniupnpd.init.d.script,v 1.2 2007/09/23 16:11:12 nanard Exp $ +# MiniUPnP project +# author: Thomas Bernard +# website: http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ + +# Re-created from scratch by the SlackBuild's author Pablo Oses <opablo@gmail.com> +# using the simple service start/stop/restart script template + +SERVICENAME="miniupnpd" +CONFIGPATH=/etc/miniupnpd +BINPATH=/usr/sbin + +# Start service: +start() +{ + echo -n "Starting $SERVICENAME..." + ${CONFIGPATH}/iptables_init.sh > /dev/null 2>&1 + ${BINPATH}/miniupnpd -f ${CONFIGPATH}/miniupnpd.conf + echo +} + +# Stop service: +stop() +{ + echo -n "Stopping ${SERVICENAME}... " + killall miniupnpd + ${CONFIGPATH}/iptables_removeall.sh > /dev/null 2>&1 + echo +} + +# Restart service: +restart() +{ + stop + sleep 1 + start +} + +case "$1" in + 'start') + start + ;; + 'stop') + stop + ;; + 'restart') + restart + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac diff --git a/network/miniupnpd/slack-desc b/network/miniupnpd/slack-desc new file mode 100644 index 000000000000..2c6e4e210cca --- /dev/null +++ b/network/miniupnpd/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' +# on the right side marks the last column you can put a character in. You must +# make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':'. + + |-----handy-ruler------------------------------------------------------| +miniupnpd: miniupnpd (UPnP-IGD and NAT-PMP daemon) +miniupnpd: +miniupnpd: The MiniUPnP daemon (MiniUPnPd) is a software which supports the +miniupnpd: UPnP Internet Gateway Device (IGD) specificationsand the NAT Port +miniupnpd: Mapping Protocol (NAT-PMP). +miniupnpd: +miniupnpd: UPnP-IGD and NAT-PMP are used to improve internet connectivity for +miniupnpd: devices behind a NAT router. Any peer to peer network application +miniupnpd: such as games, IM, etc. can benefit from a NAT router supporting +miniupnpd: UPnP and/or NAT-PMP. Homepage: http://miniupnp.free.fr/ +miniupnpd: |