diff options
author | T3slider <t3slider@gmail.com> | 2015-05-20 20:27:22 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2015-05-20 20:27:47 +0700 |
commit | 49a08287360064b069cefb2fd14498a2e80e3d07 (patch) | |
tree | 938fa311319f504f1b887359ccdf4b81be1e5a54 /network/haproxy/haproxy.SlackBuild | |
parent | 4c4b36ede4cb24ecd6605ef8297f8e4c9b6513fc (diff) |
network/haproxy: Updated for version 1.5.12 + new maintainer.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'network/haproxy/haproxy.SlackBuild')
-rw-r--r-- | network/haproxy/haproxy.SlackBuild | 106 |
1 files changed, 47 insertions, 59 deletions
diff --git a/network/haproxy/haproxy.SlackBuild b/network/haproxy/haproxy.SlackBuild index aa8ec9a31e30e..8eb7b61f636ba 100644 --- a/network/haproxy/haproxy.SlackBuild +++ b/network/haproxy/haproxy.SlackBuild @@ -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 - -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 + 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/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 |