From 1565510862c21b63891da958d258f1e593aa5667 Mon Sep 17 00:00:00 2001 From: "Thales A. Tsailas" Date: Tue, 11 May 2010 22:55:00 +0200 Subject: network/pound: Added to 12.1 repository --- network/pound/README | 10 ++++ network/pound/README.SLACKWARE | 12 +++++ network/pound/doinst.sh | 26 ++++++++++ network/pound/pound.SlackBuild | 110 +++++++++++++++++++++++++++++++++++++++++ network/pound/pound.cfg.new | 60 ++++++++++++++++++++++ network/pound/pound.info | 8 +++ network/pound/pound.logrotate | 23 +++++++++ network/pound/rc.pound.new | 103 ++++++++++++++++++++++++++++++++++++++ network/pound/slack-desc | 19 +++++++ 9 files changed, 371 insertions(+) create mode 100644 network/pound/README create mode 100644 network/pound/README.SLACKWARE create mode 100644 network/pound/doinst.sh create mode 100644 network/pound/pound.SlackBuild create mode 100644 network/pound/pound.cfg.new create mode 100644 network/pound/pound.info create mode 100644 network/pound/pound.logrotate create mode 100644 network/pound/rc.pound.new create mode 100644 network/pound/slack-desc (limited to 'network/pound') diff --git a/network/pound/README b/network/pound/README new file mode 100644 index 0000000000..36580138df --- /dev/null +++ b/network/pound/README @@ -0,0 +1,10 @@ +The Pound program is a reverse proxy, load balancer and HTTPS front- +end for Web server(s). Pound was developed to enable distributing the +the load among several Web-servers supporting FTP, gopher, and HTTP +data objects, and to allow for a convenient SSL wrapper for those web +servers that do not offer it natively. Pound is distributed under +the GPL license. + +Be sure to see the README.SLACKWARE file in this directory before +using pound (it's also installed into the standard documentation +directory by the build script). diff --git a/network/pound/README.SLACKWARE b/network/pound/README.SLACKWARE new file mode 100644 index 0000000000..cd4a32f04b --- /dev/null +++ b/network/pound/README.SLACKWARE @@ -0,0 +1,12 @@ +README.SLACKWARE + +Adding something like this to your /etc/syslog.conf file, and then +restarting syslogd should enable pound logging to its own files. + +# Redirect pound logs +local6.=info -/var/log/pound/access.log +local6.notice -/var/log/pound/error.log + +You might want to add "local6.none" to the excludes as well, but that's +your call. + diff --git a/network/pound/doinst.sh b/network/pound/doinst.sh new file mode 100644 index 0000000000..cd17973e1e --- /dev/null +++ b/network/pound/doinst.sh @@ -0,0 +1,26 @@ +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 permissions on rc.pound.new: +if [ -e etc/rc.d/rc.pound ]; then + cp -a etc/rc.d/rc.pound etc/rc.d/rc.pound.new.incoming + cat etc/rc.d/rc.pound.new > etc/rc.d/rc.pound.new.incoming + mv etc/rc.d/rc.pound.new.incoming etc/rc.d/rc.pound.new +else + # Install executable otherwise - irrelevant unless user starts in rc.local + chmod 0755 etc/rc.d/rc.pound.new +fi + +config etc/logrotate.d/pound.new +config etc/pound/pound.cfg.new +config etc/rc.d/rc.pound.new + diff --git a/network/pound/pound.SlackBuild b/network/pound/pound.SlackBuild new file mode 100644 index 0000000000..3eb869c8c0 --- /dev/null +++ b/network/pound/pound.SlackBuild @@ -0,0 +1,110 @@ +#!/bin/sh + +# Slackware build script for Pound + +# Copyright 2008 Thales A. Tsailas (ttsailas@enforcingit.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=pound +VERSION=2.4.3 +ARCH=${ARCH:-i486} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +POUNDUSER=${POUNDUSER:-nobody} +POUNDGROUP=${POUNDGROUP:-nobody} + +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 + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/Pound-$VERSION.tgz +mv Pound-$VERSION $PRGNAM-$VERSION +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/pound \ + --localstatedir=/var \ + --mandir=/usr/man \ + --docdir=/usr/doc/$PRGNAM-$VERSION \ + --build=$ARCH-slackware-linux + +make all +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 +) + +# Fix up some ownership and permissions +chown -R root:root $PKG +find $PKG/usr/sbin -type f -exec chmod 0755 {} \; + +( 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 +) + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a README GPL.txt FAQ CHANGELOG $CWD/README.SLACKWARE \ + $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild +chown root:root $PKG/usr/doc/$PRGNAM-$VERSION/* + +mkdir -p $PKG/var/log/pound +touch $PKG/var/log/pound/{access,error}.log +chown -R $POUNDUSER:$POUNDGROUP $PKG/var/log/pound + +mkdir -p $PKG/etc/{logrotate.d,pound,rc.d} +cat $CWD/pound.logrotate > $PKG/etc/logrotate.d/pound.new +cat $CWD/pound.cfg.new > $PKG/etc/pound/pound.cfg.new +cat $CWD/rc.pound.new > $PKG/etc/rc.d/rc.pound.new + +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/pound/pound.cfg.new b/network/pound/pound.cfg.new new file mode 100644 index 0000000000..de171740fa --- /dev/null +++ b/network/pound/pound.cfg.new @@ -0,0 +1,60 @@ +User "nobody" +Group "nobody" +#RootJail "/var/pound/jail" +#Alive 60 + +## Main listening ports +#ListenHTTP +# Address 1.2.3.4 +# Port 80 +# Client 10 +#End +#ListenHTTPS +# Address 1.2.3.4 +# Port 443 +# Cert "/etc/pound/pound.pem" +# Client 20 +#End + +## Image server +#Service +# URL ".*.(jpg|gif)" +# BackEnd +# Address 192.168.0.10 +# Port 80 +# End +#End +## Virtual host www.myserver.com +#Service +# URL ".*sessid=.*" +# HeadRequire "Host:.*www.myserver.com.*" +# BackEnd +# Address 192.168.0.11 +# Port 80 +# End +# Session +# Type URL +# ID "sessid" +# TTL 120 +# End +#End + +## Everybody else +#Service +# BackEnd +# Address 192.168.0.20 +# Port 80 +# Priority 5 +# End +# BackEnd +# Address 192.168.0.21 +# Port 80 +# Priority 4 +# End +# Session +# Type COOKIE +# ID "userid" +# TTL 180 +# End +#End + diff --git a/network/pound/pound.info b/network/pound/pound.info new file mode 100644 index 0000000000..b7ce840a54 --- /dev/null +++ b/network/pound/pound.info @@ -0,0 +1,8 @@ +PRGNAM="pound" +VERSION="2.4.3" +HOMEPAGE="http://www.apsis.ch/pound/" +DOWNLOAD="http://www.apsis.ch/pound/Pound-2.4.3.tgz" +MD5SUM="2de4c2ac1023b420b74a1bc08fb93b8a" +MAINTAINER="Thales A. Tsailas" +EMAIL="ttsailas@enforcingit.com" +APPROVED="rworkman" diff --git a/network/pound/pound.logrotate b/network/pound/pound.logrotate new file mode 100644 index 0000000000..17f3cf3306 --- /dev/null +++ b/network/pound/pound.logrotate @@ -0,0 +1,23 @@ + +/var/pound/access.log { + weekly + rotate 4 + compress + notifempty + postrotate + /bin/kill -HUP $(cat /var/run/syslogd.pid 2> /dev/null) 2> /dev/null || true + endscript +} + +/var/pound/error.log { + weekly + rotate 4 + compress + notifempty + missingok + postrotate + /bin/kill -HUP $(cat /var/run/syslogd.pid 2> /dev/null) 2> /dev/null || true + endscript +} + + diff --git a/network/pound/rc.pound.new b/network/pound/rc.pound.new new file mode 100644 index 0000000000..ec0c768cc2 --- /dev/null +++ b/network/pound/rc.pound.new @@ -0,0 +1,103 @@ +#!/bin/sh +# +# V 1.1 by Thales A. Tsailas (Modified the fedora Startup Scripts to Slackware Needs) +# description: Pound is a reverse proxy, load balancer and HTTPS front-end +# processname: pound +# config: /etc/pound/pound.cfg +# pidfile: /var/run/pound_pid.nnn + +if [ -f /var/run/pound.pid ]; then +pid=`cat /var/run/pound.pid` +else +pid=-1; +fi + +. /etc/init.d/functions + +# This is our service name +BASENAME=pound +if [ -L $0 ]; then + BASENAME=`find $0 -name $BASENAME -printf %l` + BASENAME=`basename $BASENAME` +fi + +[ -f /etc/pound/pound.cfg ] || exit 1 + +ROOTJAIL=$(grep -si "^RootJail" /etc/${BASENAME}/${BASENAME}.cfg | cut -d " " -f 2) +[ "$ROOTJAIL" = "/" ] && ROOTJAIL="" + +RETVAL=0 + +start() { + echo -n $"Starting $BASENAME: " + if [ -n "$ROOTJAIL" ]; then + [ -d $ROOTJAIL/dev ] || mkdir -p $ROOTJAIL/dev + mount --bind /dev $ROOTJAIL/dev + fi + /usr/sbin/$BASENAME + RETVAL=$? + echo + [ $RETVAL -eq 0 ] + return $RETVAL +} + +stop() { + echo -n $"Shutting down $BASENAME: " + (cat /var/run/pound*pid* | \ + while read pid; do kill $pid; done) 2> /dev/null + rm -f /var/run/pound*pid* + if [ -n "$ROOTJAIL" ]; then + mount | awk '{ if ($6 ~ /bind/ ) print $3}' | grep "^$ROOTJAIL/dev" | while read i; do + umount $ROOTJAIL/dev 2> /dev/null + done + fi + usleep 100000 + ! pidof -s $BASENAME > /dev/null + RETVAL=$? + [ $RETVAL -eq 0 ] && success + [ $RETVAL -ne 0 ] && failure + echo + [ $RETVAL -eq 0 ] && rm -f /var/run/pound_pid.* + return $RETVAL +} + +restart() { + stop + start +} + + +condrestart() { + [ -e /var/lock/subsys/$BASENAME ] && restart || : +} + +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + restart + ;; + reload) + restart + ;; + condrestart) + condrestart + ;; + status) + if [ -f /var/run/pound.pid ]; then + echo -en "pound is running with pid : $pid \n"; + else + echo -en "pound is not running\n"; + fi + ;; + *) + echo $"Usage: $BASENAME {start|stop|restart|reload|condrestart|status}" + RETVAL=1 + +esac +exit $RETVAL diff --git a/network/pound/slack-desc b/network/pound/slack-desc new file mode 100644 index 0000000000..6f0af16439 --- /dev/null +++ b/network/pound/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-------------------------------------------------------| +pound: pound (reverse proxy and load balancer for http servers) +pound: +pound: The Pound program is a reverse proxy, load balancer and HTTPS front- +pound: end for Web server(s). Pound was developed to enable distributing the +pound: the load among several Web-servers supporting FTP, gopher, and HTTP +pound: data objects, and to allow for a convenient SSL wrapper for those web +pound: servers that do not offer it natively. Pound is distributed under +pound: the GPL license. +pound: +pound: Homepage : http://www.apsis.ch/pound/ +pound: -- cgit v1.2.3-65-gdbad