network/pdnsd: Added to 12.2 repository

This commit is contained in:
André Geraldo Vieira 2010-05-12 23:32:39 +02:00 committed by David Somero
parent 4ecb4572b7
commit dcfc8298b2
6 changed files with 227 additions and 0 deletions

13
network/pdnsd/README Normal file
View file

@ -0,0 +1,13 @@
pdnsd is a proxy DNS server with permanent caching (the cache contents are
written to hard disk on exit) that is designed to cope with unreachable or
down DNS servers (e.g., in dial-in networking).
Add this to /etc/rc.d/rc.local:
if [ -x /etc/rc.d/rc.pdnsd ]; then
/etc/rc.d/rc.pdnsd start
fi
Add this to /etc/rc.d/rc.local_shutdown
if [ -x /etc/rc.d/rc.pdnsd ]; then
/etc/rc.d/rc.pdnsd stop
fi

23
network/pdnsd/doinst.sh Normal file
View file

@ -0,0 +1,23 @@
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.pdnsd.new:
if [ -e etc/rc.d/rc.pdnsd ]; then
cp -a etc/rc.d/rc.pdnsd etc/rc.d/rc.pdnsd.new.incoming
cat etc/rc.d/rc.pdnsd.new > etc/rc.d/rc.pdnsd.new.incoming
mv etc/rc.d/rc.pdnsd.new.incoming etc/rc.d/rc.pdnsd.new
fi
config etc/rc.d/rc.pdnsd.new
config etc/pdnsd.conf.new

View file

@ -0,0 +1,86 @@
#!/bin/sh
# Slackware build script for pdnsd
# Written by André Geraldo Vieira <andre.geraldo@gmail.com>
PRGNAM=pdnsd
VERSION=${VERSION:-1.2.7}
ARCH=${ARCH:-i486}
BUILD=${BUILD:-3}
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"
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
fi
set -e # Exit on most errors
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION-par.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 {} \;
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
--mandir=/usr/man \
--enable-ipv6 \
--build=$ARCH-slackware-linux
make
make install DESTDIR=$PKG
( cd $PKG
find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | \
xargs strip --strip-unneeded 2> /dev/null || true
find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | \
xargs strip --strip-unneeded 2> /dev/null
)
( cd $PKG/usr/man
find . -type f -exec gzip -9 {} \;
for i in $( find . -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
)
# Install an init script
mkdir -p $PKG/etc/rc.d/
cat $CWD/rc.pdnsd > $PKG/etc/rc.d/rc.pdnsd.new
chmod 0755 $PKG/etc/rc.d/rc.pdnsd.new
# Rename pdnsd.conf.sample to pdnsd.conf.new
mv $PKG/etc/pdnsd.conf.sample $PKG/etc/pdnsd.conf.new
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a \
AUTHORS ChangeLog* COPYING* INSTALL NEWS PKGBUILD README* THANKS TODO \
version doc/html doc/txt \
$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.tgz

8
network/pdnsd/pdnsd.info Normal file
View file

@ -0,0 +1,8 @@
PRGNAM="pdnsd"
VERSION="1.2.7"
HOMEPAGE="http://www.phys.uu.nl/~rombouts/pdnsd/"
DOWNLOAD="http://www.phys.uu.nl/~rombouts/pdnsd/releases/pdnsd-1.2.7-par.tar.gz"
MD5SUM="114b3b21b09b43cbfcccdde726b84c12"
MAINTAINER="André Geraldo Vieira"
EMAIL="andre.geraldo@gmail.com"
APPROVED="dsomero"

78
network/pdnsd/rc.pdnsd Normal file
View file

@ -0,0 +1,78 @@
#!/bin/bash
#
# /etc/rc.d/rc.pdnsd
#
# Starts the Proxy DNS Daemon
#
# description: Proxy DNS Daemon
# processname: pdnsd
# config: /etc/pdnsd.conf
# distribution: Slackware
# author: André Geraldo Vieira <andre.geraldo@gmail.com>
#
# Additional info:
# 1) put these lines in the /etc/rc.d/rc.local:
# if [ -x /etc/rc.d/rc.pdnsd ]; then
# /etc/rc.d/rc.pdnsd start
# fi
#
# 2) put these lines in the /etc/rc.d/rc.local_shutdown:
# if [ -x /etc/rc.d/rc.pdnsd ]; then
# /etc/rc.d/rc.pdnsd stop
# fi
start() {
if ! [ -r /var/run/pdnsd.pid ]; then
echo -n 'Starting pdnsd...'
/usr/sbin/pdnsd -d -p /var/run/pdnsd.pid
echo 'OK'
else
echo 'The PDNSD is already running!'
fi
}
stop() {
if [ -r /var/run/pdnsd.pid ]; then
echo -n "Shutting down pdnsd... "
kill -15 `cat /var/run/pdnsd.pid` && rm -f /var/run/pdnsd.pid 2> /dev/null
echo ' OK'
else
echo 'The PDNSD already stopped!'
fi
}
restart() {
stop
sleep 3
start
}
status() {
if [ -r /var/run/pdnsd.pid ]; then
pid=`cat /var/run/pdnsd.pid`
echo "PDNSD (pid $pid) is running."
else
echo 'PDNSD is stopped.'
fi
}
case "$1" in
start)
start
;;
stop)
stop
;;
reload|restart)
restart
;;
status)
status
;;
*)
echo "Usage: $0 {start|stop|restart|reload|status}"
exit 1
;;
esac
exit 0
#EOF

19
network/pdnsd/slack-desc Normal file
View file

@ -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-----------------------------------------------------|
pdnsd: pdnsd (proxy dns server)
pdnsd:
pdnsd: pdnsd is a proxy DNS server with permanent caching (the cache contents
pdnsd: are written to hard disk on exit) that is designed to cope with
pdnsd: unreachable or down DNS servers (for example in dial-in networking).
pdnsd: Since version 1.1.0, pdnsd supports negative caching.
pdnsd:
pdnsd: pdnsd is licensed under the GNU General Public License (GPL).
pdnsd:
pdnsd:
pdnsd: