network/haproxy: Updated for version 1.5.12 + new maintainer.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
parent
4c4b36ede4
commit
49a0828736
|
@ -1,9 +1,3 @@
|
|||
HAProxy is a free, very fast and reliable solution offering high
|
||||
availability, load balancing, and proxying for TCP and HTTP-based
|
||||
applications. It is particularly suited for web sites crawling under
|
||||
very high loads while needing persistence or Layer7 processing.
|
||||
|
||||
Note:
|
||||
By default, this SlackBuild supposes that the kernel supports epoll if
|
||||
the kernel release is 2.4.x. Otherwise, please modify this SlackBuild
|
||||
to suit your situation.
|
||||
applications. It is particularly suited for very high traffic web sites.
|
||||
|
|
|
@ -24,5 +24,3 @@ preserve_perms() {
|
|||
|
||||
preserve_perms etc/rc.d/rc.haproxy.new
|
||||
config etc/haproxy/haproxy.cfg.new
|
||||
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
|
||||
# Slackware build script for haproxy
|
||||
#
|
||||
# Copyright 2008 Cherife Li <cherife-#-dotimes.com>
|
||||
|
||||
# Copyright 2015 T3slider
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use of this script, with or without modification, is
|
||||
|
@ -11,24 +11,19 @@
|
|||
# 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.
|
||||
#
|
||||
# Notes:
|
||||
# + By default, this SlackBuild supposes that the kernel supports epoll
|
||||
# if the kernel release is 2.4.x. Otherwise, please modify this SlackBuild
|
||||
# to suit your situation.
|
||||
# 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=haproxy
|
||||
VERSION=1.3.15.7
|
||||
VERSION=${VERSION:-1.5.12}
|
||||
BUILD=${BUILD:-1}
|
||||
TAG=${TAG:-_SBo}
|
||||
|
||||
|
@ -45,18 +40,6 @@ TMP=${TMP:-/tmp/SBo}
|
|||
PKG=$TMP/package-$PRGNAM
|
||||
OUTPUT=${OUTPUT:-/tmp}
|
||||
|
||||
CPU=$(uname -m)
|
||||
KERNEL=$(uname -r|cut -c3)
|
||||
if [ "$KERNEL" = "4" ]; then
|
||||
TARGET="linux24e"
|
||||
elif [ "$KERNEL" = "6" ]; then
|
||||
TARGET="linux26"
|
||||
elif [ "$KERNEL" = "2" ]; then
|
||||
TARGET="linux22"
|
||||
else
|
||||
TARGET="generic"
|
||||
fi
|
||||
|
||||
if [ "$ARCH" = "i486" ]; then
|
||||
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
|
||||
LIBDIRSUFFIX=""
|
||||
|
@ -71,50 +54,55 @@ else
|
|||
LIBDIRSUFFIX=""
|
||||
fi
|
||||
|
||||
# This should work with Slackware-provided kernels, but you may wish to
|
||||
# use 'generic' instead
|
||||
TARGET=${TARGET:-linux2628}
|
||||
|
||||
set -e
|
||||
|
||||
rm -rf $PKG
|
||||
mkdir -p $TMP $PKG $OUTPUT
|
||||
cd $TMP
|
||||
rm -rf $PRGNAM-$VERSION
|
||||
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz || exit 1
|
||||
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 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
|
||||
-exec chmod 644 {} \;
|
||||
\( -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 {} \;
|
||||
|
||||
make \
|
||||
TARGET=$TARGET \
|
||||
CPU=$CPU \
|
||||
CFLAGS="$SLKCFLAGS" \
|
||||
CXXFLAGS="$SLKCFLAGS" \
|
||||
USE_PCRE=1 \
|
||||
USE_REGPARM=1 \
|
||||
USE_STATIC_PCRE=1 \
|
||||
|| exit 1
|
||||
make install PREFIX=/usr DESTDIR=$PKG || exit 1
|
||||
TARGET=$TARGET \
|
||||
CFLAGS="$SLKCFLAGS" \
|
||||
CXXFLAGS="$SLKCFLAGS" \
|
||||
USE_PCRE=1 \
|
||||
USE_OPENSSL=1 \
|
||||
USE_ZLIB=1 \
|
||||
EXTRA=""
|
||||
make install-man \
|
||||
PREFIX=/usr \
|
||||
MANDIR=/usr/man \
|
||||
DESTDIR=$PKG
|
||||
# A Makefile bug builds/installs a systemd wrapper during the
|
||||
# install/install-bin step even with EXTRA=""...
|
||||
install -D -m 0755 haproxy $PKG/usr/sbin/haproxy
|
||||
|
||||
mkdir -p $PKG/etc/{rc.d,haproxy}
|
||||
cat $CWD/rc.haproxy > $PKG/etc/rc.d/rc.haproxy.new
|
||||
cat ./examples/haproxy.cfg > $PKG/etc/haproxy/haproxy.cfg.new
|
||||
|
||||
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
||||
cp -a CHANGELOG CONTRIB LICENSE README \
|
||||
ROADMAP SUBVERS TODO VERDATE VERSION doc/* \
|
||||
$PKG/usr/doc/$PRGNAM-$VERSION
|
||||
cat $CWD/haproxy.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/haproxy.SlackBuild
|
||||
|
||||
mv $PKG/usr/share/man $PKG/usr/
|
||||
rm -rf $PKG/usr/{share,/doc/haproxy}
|
||||
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
|
||||
|
||||
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
|
||||
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
|
||||
install -D -m 0644 $CWD/rc.$PRGNAM $PKG/etc/rc.d/rc.$PRGNAM.new
|
||||
install -D -m 0644 examples/$PRGNAM.cfg $PKG/etc/haproxy/$PRGNAM.cfg.new
|
||||
|
||||
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
||||
cp -a CHANGELOG LICENSE README ROADMAP SUBVERS VERDATE VERSION doc examples \
|
||||
$PKG/usr/doc/$PRGNAM-$VERSION
|
||||
mv $PKG/usr/doc/$PRGNAM-$VERSION/examples/errorfiles $PKG/etc/haproxy/errors
|
||||
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
||||
|
||||
mkdir -p $PKG/install
|
||||
cat $CWD/slack-desc > $PKG/install/slack-desc
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
PRGNAM="haproxy"
|
||||
VERSION="1.3.15.7"
|
||||
HOMEPAGE="http://haproxy.1wt.eu/"
|
||||
DOWNLOAD="http://haproxy.1wt.eu/download/1.3/src/haproxy-1.3.15.7.tar.gz"
|
||||
MD5SUM="6c1978071139c5cc27563232c2a488da"
|
||||
VERSION="1.5.12"
|
||||
HOMEPAGE="http://www.haproxy.org/"
|
||||
DOWNLOAD="http://www.haproxy.org/download/1.5/src/haproxy-1.5.12.tar.gz"
|
||||
MD5SUM="4b94b257f16d88c315716b062b22e48a"
|
||||
DOWNLOAD_x86_64=""
|
||||
MD5SUM_x86_64=""
|
||||
REQUIRES=""
|
||||
MAINTAINER="Cherife Li"
|
||||
EMAIL="cherife-#-dotimes.com"
|
||||
MAINTAINER="T3slider"
|
||||
EMAIL="t3slider@gmail.com"
|
||||
|
|
|
@ -1,31 +1,84 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# HAProxy daemon control script.
|
||||
# Written for Slackware Linux by Cherife Li <cherife-#-dotimes.com>.
|
||||
|
||||
BIN=/usr/sbin/haproxy
|
||||
CONF=/etc/haproxy/haproxy.cfg
|
||||
PID=/var/run/haproxy.pid
|
||||
HAPROXY=/usr/sbin/haproxy
|
||||
CONFIG=/etc/haproxy/haproxy.cfg
|
||||
PIDFILE=/var/run/haproxy.pid
|
||||
|
||||
start() {
|
||||
if [ -r $PIDFILE ]; then
|
||||
echo 'HAProxy is already running!'
|
||||
return
|
||||
fi
|
||||
$HAPROXY -f $CONFIG -D -p $PIDFILE
|
||||
}
|
||||
|
||||
stop() {
|
||||
if [ ! -r $PIDFILE ]; then
|
||||
echo 'HAProxy is not running!'
|
||||
return
|
||||
fi
|
||||
echo "Soft-stopping HAProxy..."
|
||||
kill -USR1 `cat $PIDFILE`
|
||||
# Even with the right permissions the PID file will not be removed...
|
||||
rm -f $PIDFILE
|
||||
}
|
||||
|
||||
force_stop() {
|
||||
if [ ! -r $PIDFILE ]; then
|
||||
echo 'HAProxy is not running!'
|
||||
return
|
||||
fi
|
||||
echo "Hard-stopping HAProxy..."
|
||||
kill `cat $PIDFILE`
|
||||
# Even with the right permissions the PID file will not be removed...
|
||||
rm -f $PIDFILE
|
||||
}
|
||||
|
||||
status() {
|
||||
if [ ! -r $PIDFILE ]; then
|
||||
echo "HAProxy is not running."
|
||||
return
|
||||
fi
|
||||
PID=`cat $PIDFILE`
|
||||
if [ -z "$PID" ]; then
|
||||
echo 'PID file is empty! HAProxy does not appear to be running, but there is a stale PID file.'
|
||||
elif kill -0 $PID; then
|
||||
echo "HAProxy is running."
|
||||
else
|
||||
echo "HAProxy is not running, but there is a stale PID file."
|
||||
fi
|
||||
}
|
||||
|
||||
checkconfig() {
|
||||
$HAPROXY -c -q -V -f $CONFIG
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
check)
|
||||
echo "Checking HAProxy configuration file..."
|
||||
$BIN -f $CONF -cV
|
||||
;;
|
||||
start)
|
||||
echo "Starting HAProxy..."
|
||||
$BIN -f $CONF -D -p $PID
|
||||
;;
|
||||
stop)
|
||||
echo "Shutting down HAProxy..."
|
||||
kill -TERM `cat $PID`
|
||||
rm -f $PID &> /dev/null
|
||||
;;
|
||||
restart)
|
||||
stop
|
||||
sleep 2
|
||||
start
|
||||
;;
|
||||
*)
|
||||
echo "usage `basename $0` {check|start|stop|restart}"
|
||||
'start')
|
||||
start
|
||||
;;
|
||||
'stop')
|
||||
stop
|
||||
;;
|
||||
'force_stop')
|
||||
force_stop
|
||||
;;
|
||||
'restart')
|
||||
stop
|
||||
start
|
||||
;;
|
||||
'force_restart')
|
||||
force_stop
|
||||
start
|
||||
;;
|
||||
'status')
|
||||
status
|
||||
;;
|
||||
'checkconfig')
|
||||
checkconfig
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|force_stop|restart|force_restart|status|checkconfig}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
|
|
@ -6,14 +6,14 @@
|
|||
# customary to leave one space after the ':' except on otherwise blank lines.
|
||||
|
||||
|-----handy-ruler------------------------------------------------------|
|
||||
haproxy: haproxy (a free, very fast and reliable proxy)
|
||||
haproxy: haproxy (a high performance TCP/HTTP load balancer)
|
||||
haproxy:
|
||||
haproxy: HAProxy is a free, very fast and reliable solution offering high
|
||||
haproxy: availability, load balancing, and proxying for TCP and HTTP-based
|
||||
haproxy: applications. It is particularly suited for web sites crawling under
|
||||
haproxy: very high loads while needing persistence or Layer7 processing.
|
||||
haproxy: applications. It is particularly suited for very high traffic web
|
||||
haproxy: sites.
|
||||
haproxy:
|
||||
haproxy: http://www.haproxy.org/
|
||||
haproxy:
|
||||
haproxy:
|
||||
haproxy:
|
||||
haproxy: Homepage: http://haproxy.1wt.eu/
|
||||
haproxy:
|
||||
|
|
Loading…
Reference in New Issue