From dcfc8298b253229af2f918842754ef61650698b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Geraldo=20Vieira?= Date: Wed, 12 May 2010 23:32:39 +0200 Subject: [PATCH] network/pdnsd: Added to 12.2 repository --- network/pdnsd/README | 13 +++++ network/pdnsd/doinst.sh | 23 +++++++++ network/pdnsd/pdnsd.SlackBuild | 86 ++++++++++++++++++++++++++++++++++ network/pdnsd/pdnsd.info | 8 ++++ network/pdnsd/rc.pdnsd | 78 ++++++++++++++++++++++++++++++ network/pdnsd/slack-desc | 19 ++++++++ 6 files changed, 227 insertions(+) create mode 100644 network/pdnsd/README create mode 100644 network/pdnsd/doinst.sh create mode 100644 network/pdnsd/pdnsd.SlackBuild create mode 100644 network/pdnsd/pdnsd.info create mode 100644 network/pdnsd/rc.pdnsd create mode 100644 network/pdnsd/slack-desc diff --git a/network/pdnsd/README b/network/pdnsd/README new file mode 100644 index 0000000000..f11b7d39ea --- /dev/null +++ b/network/pdnsd/README @@ -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 diff --git a/network/pdnsd/doinst.sh b/network/pdnsd/doinst.sh new file mode 100644 index 0000000000..b09bee1dad --- /dev/null +++ b/network/pdnsd/doinst.sh @@ -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 + diff --git a/network/pdnsd/pdnsd.SlackBuild b/network/pdnsd/pdnsd.SlackBuild new file mode 100644 index 0000000000..5acfacfff8 --- /dev/null +++ b/network/pdnsd/pdnsd.SlackBuild @@ -0,0 +1,86 @@ +#!/bin/sh + +# Slackware build script for pdnsd + +# Written by André Geraldo Vieira + +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 diff --git a/network/pdnsd/pdnsd.info b/network/pdnsd/pdnsd.info new file mode 100644 index 0000000000..d3f7972e47 --- /dev/null +++ b/network/pdnsd/pdnsd.info @@ -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" diff --git a/network/pdnsd/rc.pdnsd b/network/pdnsd/rc.pdnsd new file mode 100644 index 0000000000..64115e1cb5 --- /dev/null +++ b/network/pdnsd/rc.pdnsd @@ -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 +# +# 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 diff --git a/network/pdnsd/slack-desc b/network/pdnsd/slack-desc new file mode 100644 index 0000000000..4ca0c3fbe6 --- /dev/null +++ b/network/pdnsd/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-----------------------------------------------------| +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: