#!/bin/sh # Build script for formilux >0.1.8 # This build script is able to produce 3 outputs when used this way : # # SRC_FETCH_PATH="http://haproxy.1wt.eu/download/1.5/src/devel/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=" 0001-MINOR-stats-don-t-use-a-monospace-font-to-report-num.patch 0002-MINOR-session-remove-debugging-code.patch 0003-BUG-MAJOR-patterns-fix-double-free-caused-by-loading.patch 0004-MEDIUM-http-make-option-http_proxy-automatically-rew.patch 0005-BUG-MEDIUM-http-cook_cnt-forgets-to-set-its-output-t.patch 0006-BUG-MINOR-stats-correctly-report-throttle-rate-of-lo.patch 0007-BUG-MEDIUM-checks-servers-must-not-start-in-slowstar.patch 1000-add-dlmalloc.patch " ### Mainline: 11f64d65ffabee4f46c8bd789ceb1507aca36944 (v1.5-dev20) ### Updated : 02541e8be22c212493ceeb88a54ccd32190db36d (v1.5-dev20+) 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 "${FLX_ARCH##arm*}" ]; then USE_ACCEPT4= else USE_ACCEPT4=implicit fi SYSTEM_MAXCONN= ; DEFAULT_MAXCONN=10000 ; MEMMAX= $FLXPMAKE CC="$CC" \ 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/$PKGRADIX-$PKGVER/etc/haproxy/haproxy.cfg cp examples/rc.highsock $ROOTDIR/usr/share/examples/$PKGRADIX/$PKGRADIX-$PKGVER/etc/rc.highsock cp examples/config.rc.haproxy $ROOTDIR/usr/share/examples/$PKGRADIX/$PKGRADIX-$PKGVER/etc/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/$PKGRADIX-$PKGVER $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 }