diff options
-rw-r--r-- | network/miredo/README | 24 | ||||
-rw-r--r-- | network/miredo/doinst.sh | 24 | ||||
-rw-r--r-- | network/miredo/miredo.SlackBuild | 110 | ||||
-rw-r--r-- | network/miredo/miredo.info | 10 | ||||
-rw-r--r-- | network/miredo/rc.miredo | 88 | ||||
-rw-r--r-- | network/miredo/slack-desc | 19 |
6 files changed, 275 insertions, 0 deletions
diff --git a/network/miredo/README b/network/miredo/README new file mode 100644 index 0000000000000..c20cb11c2584f --- /dev/null +++ b/network/miredo/README @@ -0,0 +1,24 @@ +Miredo is an opensource Teredo IPv6 tunneling software for Linux +and BSD operating systems. It includes functional implementations +of all components of the Teredo specification (client, relay and +server). It is meant to provide IPv6 connectivity even from +behind NAT devices. + +This script requires a 'miredo' user/group to exist before running. +The recommended UID/GID is 255. You can create these like so: + groupadd -g 255 miredo + useradd -u 255 -g 255 -c "Teredo IPv6 Tunneling" -d /dev/null -s /bin/false miredo + +Alternatively, you can fall back to default 'nobody' user by passing +NOBODY=yes to the script. However, this is less safe. + +The following can be used to start/stop miredo automatically: +/etc/rc.d/rc.local + if [ -x /etc/rc.d/rc.miredo ]; then + /etc/rc.d/rc.miredo start + fi + +/etc/rc.d/rc.local_shutdown + if [ -x /etc/rc.d/rc.miredo ]; then + /etc/rc.d/rc.miredo stop + fi diff --git a/network/miredo/doinst.sh b/network/miredo/doinst.sh new file mode 100644 index 0000000000000..e8b05b9a7adbf --- /dev/null +++ b/network/miredo/doinst.sh @@ -0,0 +1,24 @@ +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then + rm $NEW + fi +} + +preserve_perms() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + if [ -e $OLD ]; then + cp -a $OLD ${NEW}.incoming + cat $NEW > ${NEW}.incoming + mv ${NEW}.incoming $NEW + fi + config $NEW +} + +preserve_perms etc/rc.d/rc.miredo.new +config etc/miredo/miredo.conf.new + diff --git a/network/miredo/miredo.SlackBuild b/network/miredo/miredo.SlackBuild new file mode 100644 index 0000000000000..5e338253fa828 --- /dev/null +++ b/network/miredo/miredo.SlackBuild @@ -0,0 +1,110 @@ +#!/bin/sh +# +# Slackware build script for Miredo +# +# Copyright 2011 Fridrich von Stauffenberg <cancellor2@gmail.com> +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PRGNAM=miredo +VERSION=1.2.4 +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i486 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +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" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +if [ "${NOBODY:-no}" = "no" ]; then + if ! grep -q "^$PRGNAM:" /etc/passwd || ! grep -q "^$PRGNAM:" /etc/group; then + echo "You must have a $PRGNAM user and $PRGNAM group to run this script:" + echo "" + echo " groupadd -g 255 miredo" + echo " useradd -u 255 -g 255 -c \"Teredo IPv6 Tunneling\" -d /dev/null -s /bin/false miredo" + + exit 1 + fi + enable_user="--enable-$PRGNAM-user" +else + enable_user="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2 +cd $PRGNAM-$VERSION +chown -R root:root . + +CFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --mandir=/usr/man \ + --docdir=/usr/doc/$PRGNAM-$VERSION \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --build=$ARCH-slackware-linux \ + $enable_user + +make V=1 +make install-strip DESTDIR=$PKG + +install -D -m 0644 $CWD/rc.$PRGNAM $PKG/etc/rc.d/rc.$PRGNAM.new +( cd $PKG/etc/$PRGNAM ; mv $PRGNAM.conf{,.new} ) + +find $PKG/usr/man -type f -exec gzip -9 {} \; +for i in $(find $PKG/usr/man -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done + +cp ChangeLog AUTHORS THANKS COPYING INSTALL README NEWS TODO ABOUT-NLS \ + $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/network/miredo/miredo.info b/network/miredo/miredo.info new file mode 100644 index 0000000000000..e4c673db68fde --- /dev/null +++ b/network/miredo/miredo.info @@ -0,0 +1,10 @@ +PRGNAM="miredo" +VERSION="1.2.4" +HOMEPAGE="http://www.remlab.net/miredo" +DOWNLOAD="http://www.remlab.net/files/miredo/miredo-1.2.4.tar.bz2" +MD5SUM="1281e7e75bddbde244cd778d99fa22d4" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +MAINTAINER="Fridrich von Stauffenberg" +EMAIL="cancellor2@gmail.com" +APPROVED="Niels Horn" diff --git a/network/miredo/rc.miredo b/network/miredo/rc.miredo new file mode 100644 index 0000000000000..0ba5d706efcb8 --- /dev/null +++ b/network/miredo/rc.miredo @@ -0,0 +1,88 @@ +#!/bin/sh +# +# Miredo - Teredo IPv6 tunnelling +# +# Init script for miredo client. +# +# Written by Fridrich von Stauffenberg <cancellor2@gmail.com> +# Based on tor's init script by Marco Bonetti <sid77@slackware.it> + +PIDFILE=/var/run/miredo.pid +DAEMON=/usr/sbin/miredo + +miredo_start() { + echo "Starting Miredo: $DAEMON" + $DAEMON +} + +miredo_stop() { + echo -n "Stopping Miredo... " + PID=$(cat $PIDFILE 2>/dev/null) + if [ -z "$PID" ]; then + echo "not running." + exit 0 + fi + if kill -15 $PID; then + echo "stopped." + else + sleep 1 + if kill -9 $PID; then + echo "killed." + else + echo "error!" + exit 1 + fi + fi +} + +miredo_reload() { + echo -n "Reloading Miredo... " + PID=$(cat $PIDFILE 2>/dev/null) + if [ -z "$PID" ]; then + echo "not running." + exit 0 + fi + if kill -1 $PID; then + echo "reloaded." + else + echo "error!" + exit 1 + fi +} + +miredo_status() { + PID=$(cat $PIDFILE 2>/dev/null) + if [ -z "$PID" ]; then + echo "Not running." + exit 1 + elif kill -0 $PID; then + echo "Running with PID $PID." + exit 0 + else + echo "PID file $PIDFILE present, but PID $PID is not running." + exit 1 + fi +} + +case "$1" in + start) + miredo_start + ;; + stop) + miredo_stop + ;; + restart) + miredo_stop + sleep 1 + miredo_start + ;; + reload) + miredo_reload + ;; + status) + miredo_status + ;; + *) + echo "Usage: $0 (start|stop|restart|reload|status)" + ;; +esac diff --git a/network/miredo/slack-desc b/network/miredo/slack-desc new file mode 100644 index 0000000000000..f6058c3414989 --- /dev/null +++ b/network/miredo/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------------------------------------------------------| +miredo: Miredo (teredo IPv6 tunneling) +miredo: +miredo: Miredo is an opensource Teredo IPv6 tunneling software for Linux +miredo: and BSD operating systems. It includes functional implementations +miredo: of all components of the Teredo specification (client, relay and +miredo: server). It is meant to provide IPv6 connectivity even from +miredo: behind NAT devices. +miredo: +miredo: Homepage: http://www.remlab.net/miredo +miredo: +miredo: |