diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2024-06-21 07:16:43 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2024-06-21 21:38:12 +0700 |
commit | 3ef44ca2ddd4aae4239b585128046eed78d916eb (patch) | |
tree | ff6b18f38cb1ac87bb8bc5a0a8bd6cbca301cd76 /network | |
parent | 589d72757bfaaba50e6d0873f826eaadb7662c4c (diff) |
network/pound: Added (load balancer).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'network')
-rw-r--r-- | network/pound/README | 9 | ||||
-rw-r--r-- | network/pound/doinst.sh | 20 | ||||
-rw-r--r-- | network/pound/pound.SlackBuild | 120 | ||||
-rw-r--r-- | network/pound/pound.cfg | 32 | ||||
-rw-r--r-- | network/pound/pound.info | 10 | ||||
-rw-r--r-- | network/pound/rc.pound | 55 | ||||
-rw-r--r-- | network/pound/slack-desc | 19 |
7 files changed, 265 insertions, 0 deletions
diff --git a/network/pound/README b/network/pound/README new file mode 100644 index 0000000000000..fe8f9f124e1d0 --- /dev/null +++ b/network/pound/README @@ -0,0 +1,9 @@ +Pound is a reverse proxy, load balancer and HTTPS front-end for +web servers. +It was developed to enable distributing the load among several +servers and to allow for a convenient SSL wrapper for those servers +that do not offer it natively. + +Be sure to edit its configuration file /etc/pound.cfg to your liking. +Detailed documentation about the package is provided both in manpage +(man pound) and in texinfo (info pound) format. diff --git a/network/pound/doinst.sh b/network/pound/doinst.sh new file mode 100644 index 0000000000000..d385ca659bfd0 --- /dev/null +++ b/network/pound/doinst.sh @@ -0,0 +1,20 @@ +#! /bin/sh +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... +} + +config etc/pound.cfg.new +config etc/rc.d/rc.pound.new + +if [ -x /usr/bin/install-info ]; then + /usr/bin/install-info --info-dir=/usr/info /usr/info/pound.info.gz 2>/dev/null +fi + diff --git a/network/pound/pound.SlackBuild b/network/pound/pound.SlackBuild new file mode 100644 index 0000000000000..de7be622b2107 --- /dev/null +++ b/network/pound/pound.SlackBuild @@ -0,0 +1,120 @@ +#!/bin/bash + +# Slackware build script for pound + +# Copyright 2024 Sergey Poznyakoff <gray@gnu.org> +# 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. + +cd $(dirname $0) ; CWD=$(pwd) + +PRGNAM=pound +VERSION=${VERSION:-4.12} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +elif [ "$ARCH" = "aarch64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +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 -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --mandir=/usr/man \ + --infodir=/usr/info \ + --docdir=/usr/doc/$PRGNAM-$VERSION \ + --build=$ARCH-slackware-linux + +make +make install DESTDIR=$PKG + +rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la + +find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + +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 + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a \ + AUTHORS COPYING ChangeLog NEWS README THANKS \ + $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/etc $PKG/etc/rc.d +cp $CWD/pound.cfg $PKG/etc/pound.cfg.new +cp $CWD/rc.pound $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.$PKGTYPE diff --git a/network/pound/pound.cfg b/network/pound/pound.cfg new file mode 100644 index 0000000000000..43205c8eb9b80 --- /dev/null +++ b/network/pound/pound.cfg @@ -0,0 +1,32 @@ +## A minimal pound configuration. +## Refer to pound(8) for details. + +User "nobody" +Group "nobody" +Daemon 1 +LogFacility local3 +LogLevel "detailed" + +Service + BackEnd + Address 127.0.0.1 + Port 8080 + End +End + +ListenHTTP + Address 0.0.0.0 + Port 80 +End + +## Uncomment and edit the following section in order to enable HTTPS +# ListenHTTPS +# Address 0.0.0.0 +# Port 443 +# Cert "/etc/ssl/private/pound.pem" +# Disable SSLv3 +# Ciphers "ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:!DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA" +# AddHeader "X-Forwarded-Proto: https" +# RewriteLocation 0 +# xHTTP 2 +# End diff --git a/network/pound/pound.info b/network/pound/pound.info new file mode 100644 index 0000000000000..213d9724449bf --- /dev/null +++ b/network/pound/pound.info @@ -0,0 +1,10 @@ +PRGNAM="pound" +VERSION="4.12" +HOMEPAGE="https://github.com/graygnuorg/pound" +DOWNLOAD="https://github.com/graygnuorg/pound/releases/download/v4.12/pound-4.12.tar.gz" +MD5SUM="22c720d639bce3c4585e34fe738e2ee0" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="Sergey Poznyakoff" +EMAIL="gray@gnu.org" diff --git a/network/pound/rc.pound b/network/pound/rc.pound new file mode 100644 index 0000000000000..ed6d44e05647a --- /dev/null +++ b/network/pound/rc.pound @@ -0,0 +1,55 @@ +#!/bin/sh + +DAEMON=/usr/sbin/pound +OPTIONS= +PID= + +test -r /etc/default/pound && . /etc/default/pound + +# 0 - running +# 1 - not running +pound_is_running() { + PID=$(pidof $DAEMON) + test -n "$PID" +} + +pound_status() { + if pound_is_running; then + echo "$DAEMON is running (pid $PID)" + exit 0 + else + echo "$DAEMON is not running" + exit 1 + fi +} + +pound_start() { + if pound_is_running; then + echo "$DAEMON is already running (pid $PID)" + else + $DAEMON $OPTIONS + fi +} + +pound_stop() { + if pound_is_running; then + kill -TERM $PID + else + echo "$DAEMON is not running" + fi +} + +case "$1" in +start) + pound_start;; +stop) + pound_stop;; +restart) + pound_stop + pound_start;; +status) + pound_status;; +*) + echo "usage: $0 start|stop|restart|status" +esac + diff --git a/network/pound/slack-desc b/network/pound/slack-desc new file mode 100644 index 0000000000000..7c7230bdbbb56 --- /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 ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +pound: pound (reverse proxy and load balancer for http servers) +pound: +pound: Pound is a reverse proxy, load balancer and HTTPS front-end for Web +pound: servers. It was developed to enable distributing the load among +pound: several Web-servers and to allow for a convenient SSL wrapper for +pound: those Web servers that do not offer it natively. Pound is distributed +pound: under the GNU General Public License, Version 3, or (at your option) +pound: any later version. +pound: +pound: Homepage: https://github.com/graygnuorg/pound +pound: |