# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id$

PortSystem          1.0

name                haproxy
version             1.6.9
set branch          [join [lrange [split ${version} .] 0 1] .]
categories          net
platforms           darwin
maintainers         gmail.com:jeremy.mcmillan openmaintainer
license             GPL-2+

description         The Reliable, High Performance TCP/HTTP Load Balancer

long_description    HAproxy is a high-performance and highly-robust TCP/HTTP \
                    load balancer which provides cookie-based persistence, \
                    automatic failover, header insertion, deletion, \
                    modification on the fly, advanced logging contents to \
                    help trouble-shooting buggy applications and/or networks, \
                    and a few other features. It uses its own state machine \
                    to achieve up to ten thousands hits per second on modern \
                    hardware, even with thousands simultaneous connections.

homepage            http://haproxy.1wt.eu/
master_sites        ${homepage}download/${branch}/src/

checksums           rmd160  f2c1c2ec78bf72246ad70298712229b05a5e6035 \
                    sha256  cf7d2fa891d2ae4aa6489fc43a9cadf68c42f9cb0de4801afad45d32e7dda133

depends_lib         port:pcre

patchfiles          patch-Makefile.diff

use_configure       no

variant universal {}

build.target        TARGET=osx

build.args          CC="${configure.cc} [get_canonical_archflags]" \
                    USE_LIBCRYPT=1 \
                    USE_PCRE=1

destroot.args       DOCDIR=${prefix}/share/doc/${name} \
                    PREFIX=${prefix}

platform i386 {
    build.args-append USE_REGPARM=1
}

livecheck.type      regex
livecheck.regex     ${name}-(\[0-9.\]+)${extract.suffix}