summaryrefslogtreecommitdiffstats
path: root/network/haproxy/haproxy.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'network/haproxy/haproxy.SlackBuild')
-rw-r--r--network/haproxy/haproxy.SlackBuild69
1 files changed, 58 insertions, 11 deletions
diff --git a/network/haproxy/haproxy.SlackBuild b/network/haproxy/haproxy.SlackBuild
index cfcb13e07b..6347d65637 100644
--- a/network/haproxy/haproxy.SlackBuild
+++ b/network/haproxy/haproxy.SlackBuild
@@ -1,10 +1,13 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for haproxy
# Copyright 2018 T3slider <t3slider@gmail.com>
# All rights reserved.
#
+# Copyright 2024 Badchay <badchay@protonmail.com>
+# All rights reserved.
+#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
@@ -22,10 +25,13 @@
# 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=haproxy
-VERSION=${VERSION:-1.8.13}
+VERSION=${VERSION:-2.8.9}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@@ -35,7 +41,14 @@ if [ -z "$ARCH" ]; then
esac
fi
-CWD=$(pwd)
+# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
+# the name of the created package would be, and then exit. This information
+# could be useful to other scripts.
+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}
@@ -56,10 +69,16 @@ fi
# This should work with Slackware-provided kernels, but you may wish to
# use 'generic' instead
-TARGET=${TARGET:-linux2628}
+TARGET=${TARGET:-linux-glibc}
-# Include lua support? (Requires lua53)
+# Include lua support? (Requires lua)
LUA=${LUA:-no}
+# Perl Compatible Regular Expressions version 2 is enabled by default.
+# You might want to use libpcre1 and/or JIT-enabled version instead.
+PCRE=${PCRE:-PCRE2}
+# Include QUIC (HTTP/3) support?
+# This requires QUICTLS or wolfSSL.
+QUIC=${QUIC:-no}
set -e
@@ -77,18 +96,36 @@ find -L . \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
LUAOPT=""
-if [ "$LUA" != "no" ]; then
+if [ "$LUA" == "yes" ]; then
LUAOPT="USE_LUA=1"
+else
+ LUAOPT="USE_LUA="
+fi
+
+PCREOPT=""
+if [ "$PCRE" != "PCRE2" ]; then
+ PCREOPT=$(echo $PCRE | sed -e 's/USE_//' -e 's/=1//')
+else
+ PCREOPT="PCRE2"
+fi
+
+QUICOPT=""
+if [ "$QUIC" == "yes" ]; then
+ LUAOPT="USE_QUIC=1"
+else
+ LUAOPT="USE_QUIC="
fi
make \
TARGET=$TARGET \
- CFLAGS="$SLKCFLAGS" \
- CXXFLAGS="$SLKCFLAGS" \
- USE_PCRE=1 \
+ USE_$PCREOPT=1 \
+ $QUICOPT \
USE_OPENSSL=1 \
+ USE_ENGINE=1 \
USE_ZLIB=1 \
USE_NS=1 \
+ USE_PROMEX=1 \
+ USE_SYSTEMD= \
$LUAOPT \
EXTRA=""
make install \
@@ -106,8 +143,18 @@ for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; r
install -D -m 0644 $CWD/rc.$PRGNAM $PKG/etc/rc.d/rc.$PRGNAM.new
-cp -a CHANGELOG CONTRIBUTING LICENSE MAINTAINERS README ROADMAP SUBVERS VERDATE VERSION examples \
+cp -a CONTRIBUTING LICENSE MAINTAINERS README BRANCHES SUBVERS VERDATE VERSION examples \
$PKG/usr/doc/$PRGNAM-$VERSION
+
+# If there's a CHANGELOG, installing at least part of the recent history
+# is useful, but don't let it get totally out of control:
+if [ -r CHANGELOG ]; then
+ head -n 1000 CHANGELOG > $PKG/usr/doc/$PRGNAM-$VERSION/CHANGELOG
+ touch -r CHANGELOG $PKG/usr/doc/$PRGNAM-$VERSION/CHANGELOG
+fi
+
+cp $CWD/{syslog.example,logrotate.example} $PKG/usr/doc/$PRGNAM-$VERSION/examples/
+
mkdir -p $PKG/etc/haproxy
mv $PKG/usr/doc/$PRGNAM-$VERSION/examples/errorfiles $PKG/etc/haproxy/errors
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
@@ -117,4 +164,4 @@ 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:-tgz}
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE