# -*- 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: Portfile 92837 2012-05-09 00:51:48Z ryandesign@macports.org $

PortSystem          1.0

name                haproxy
version             1.4.18
revision            2
set branch          [join [lrange [split ${version} .] 0 1] .]
categories          net
platforms           darwin
maintainers         samgranieri.com:sam
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           md5     4ac88bb1a76c4b84ed4f6131183bedbe \
                    sha1    191dbcb5880c711580693bd081ca5fdd8dde3012 \
                    rmd160  16729f0519a47123d88e849ae95d600c590c8583

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     {>Stable ([0-9.]+)<}
