#!/bin/sh # This is a variant of 1.5.3, it features a completely static # build, including ssl, zlib, pcre, libc, libdl. It disables dlmalloc # which conflicts with libc's malloc. # SRC_FETCH_PATH="http://haproxy.1wt.eu/download/1.5/src/haproxy-${PKGVER}.tar.gz" SRC_FETCH_METHOD="http" MAKEDEPENDS=( "pcre-*:::*.a *.h *.so *.so.*" "openssl-*:::*.h *.so *.so.*" "zlib-*:::*.h *.so *.so.*") # Note : PCRE is enabled. PCRE is statically built for x86_64 models # This pkg is built with smaller options allowing it to support a higher number # of simultaneous connections, typically 5000 with 256 MB memory including the # sockets and the system, or 40000 with 1 GB RAM. # Patches below 1000 are bugfixes and initial backports. # Patches above 1000 are aloha-specific or late backports. PATCH_LIST=" 1000-add-dlmalloc.patch " ### Mainline: b55c46eab5c742c78d2d77d0827d248f325f5356 (v1.5.4) FILE_LIST= HAPROXY_VERSION="${PKGVER}" HAPROXY_SUBVERS="-${DISTVER}_${VERSFX}" HAPROXY_DATE="$(date +%Y/%m/%d)" function do_compile_only { # halog ( cd contrib/halog $FLXMAKE CC=$CC halog ) # haproxy case "$FLX_ARCH_SMALL" in i?86) REGPARM=1 ; VSYSCALL=1 ; FUTEX=1 ;; x86*) REGPARM=1 ; VSYSCALL= ; FUTEX=1 ;; *) REGPARM= ; VSYSCALL= ; FUTEX= ;; esac # splice() was introduced in glibc-2.6 # accept4() was introduced in glibc-2.10 case "$(readlink $FLXROOTDIR/lib/libc.so.?)" in libc-2.[0-5].*) MY_SPLICE=1 ; MY_ACCEPT4=1 ;; libc-2.[6-9].*) MY_SPLICE= ; MY_ACCEPT4=1 ;; libc-2.1*.*) MY_SPLICE= ; MY_ACCEPT4= ;; *) MY_SPLICE= ;; esac if [ -z "${FLXARCH##arm*}" ]; then USE_ACCEPT4= else USE_ACCEPT4=implicit fi SYSTEM_MAXCONN= ; DEFAULT_MAXCONN=10000 ; MEMMAX= $FLXPMAKE CC="$CC" EXTRA= \ ADDLIB=-ldl LDFLAGS="\$(ARCH_FLAGS) -g" \ TARGET=linux2628 USE_PCRE=1 PCREDIR=$FLXROOTDIR/usr \ SMALL_OPTS="${SYSTEM_MAXCONN:+-DSYSTEM_MAXCONN=$SYSTEM_MAXCONN }${DEFAULT_MAXCONN:+-DDEFAULT_MAXCONN=$DEFAULT_MAXCONN }-DBUFSIZE=8030 -DMAXREWRITE=1030" \ USE_MY_SPLICE=${MY_SPLICE} USE_ACCEPT4=${USE_ACCEPT4} USE_MY_ACCEPT4=${MY_ACCEPT4} USE_TFO=1 \ USE_REGPARM=${REGPARM} USE_VSYSCALL=${VSYSCALL} \ USE_OPENSSL=1 USE_FUTEX=${FUTEX} USE_ZLIB=1 USE_DLMALLOC=1 \ SILENT_DEFINE="-DLISTEN_DEFAULT_CIPHERS=\"\\\"AES:RC4:ALL:!aNULL:!eNULL:!LOW:!EXPORT:!SSLv2\\\"\" \ -DCONNECT_DEFAULT_CIPHERS=\"\\\"AES:RC4:ALL:!aNULL:!eNULL:!LOW:!EXPORT:!SSLv2\\\"\"" } function do_prepack { # halog mkdir -p $ROOTDIR/usr/bin cp contrib/halog/halog $ROOTDIR/usr/bin/ mkdir -p $ROOTDIR/sbin/init.d ; cp examples/init.haproxy.flx0 $ROOTDIR/sbin/init.d/haproxy chmod 755 $ROOTDIR/sbin/init.d/haproxy mkdir -p $ROOTDIR/usr/sbin ; cp haproxy $ROOTDIR/usr/sbin mkdir -p $ROOTDIR/usr/share/examples/$PKGRADIX/$PKGRADIX-$PKGVER/etc/haproxy/ cp examples/haproxy.cfg $ROOTDIR/usr/share/examples/$PKGRADIX/haproxy.cfg cp examples/rc.highsock $ROOTDIR/usr/share/examples/$PKGRADIX/rc.highsock cp examples/config.rc.haproxy $ROOTDIR/usr/share/examples/$PKGRADIX/config.rc.haproxy mkdir -p $ROOTDIR/usr/share/$PKGRADIX/$PKGRADIX-$PKGVER cp doc/haproxy-{fr,en}.txt $ROOTDIR/usr/share/$PKGRADIX/$PKGRADIX-$PKGVER/ cp doc/architecture.txt $ROOTDIR/usr/share/$PKGRADIX/$PKGRADIX-$PKGVER/ cp doc/configuration.txt $ROOTDIR/usr/share/$PKGRADIX/$PKGRADIX-$PKGVER/ ln -s ../../examples/$PKGRADIX $ROOTDIR/usr/share/$PKGRADIX/$PKGRADIX-$PKGVER/examples cp examples/debug2ansi examples/debug2html examples/debugfind $ROOTDIR/usr/share/$PKGRADIX/$PKGRADIX-$PKGVER/ set_default_perm $ROOTDIR } function do_clean { $FLXMAKE clean rm -f contrib/halog/halog{,64} ( do_delpack ) return 0 }