aboutsummaryrefslogtreecommitdiffstats
path: root/net/haproxy/Makefile
blob: 33991ba77631845381d05e38a067f9b0bc4d346a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Created by: Clement Laforet
# $FreeBSD$

PORTNAME=   haproxy
DISTVERSION=    1.9.8
CATEGORIES= net www
MASTER_SITES=   http://www.haproxy.org/download/1.9/src/

MAINTAINER= demon@FreeBSD.org
COMMENT=    Reliable, high performance TCP/HTTP load balancer

LICENSE=    GPLv2 LGPL21
LICENSE_COMB=   multi

CONFLICTS_INSTALL=  haproxy-devel-[0-9]* haproxy17-[0-9]* haproxy18-[0-9]*

USES=       compiler:c++11-lang cpe gmake
USE_RC_SUBR=    haproxy

MAKE_ARGS=  TARGET=freebsd DEFINE=-DFREEBSD_PORTS USE_GETADDRINFO=1 \
        USE_ZLIB=1 USE_CPU_AFFINITY=1 USE_ACCEPT4=1 \
        CC="${CC}" DEBUG_CFLAGS="" CPU_CFLAGS="${CFLAGS}"

OPTIONS_DEFINE=     DOCS EXAMPLES LUA OPENSSL DEVICEATLAS
OPTIONS_RADIO=      PCRE
OPTIONS_RADIO_PCRE= DPCRE SPCRE
DPCRE_DESC=     Link dynamically
SPCRE_DESC=     Link statically
DEVICEATLAS_DESC=   DeviceAtlas Device Detection support
OPTIONS_DEFAULT=    SPCRE OPENSSL

DPCRE_LIB_DEPENDS=  libpcre.so:devel/pcre
DPCRE_MAKE_ARGS=    USE_PCRE=1 USE_PCRE_JIT=1
SPCRE_LIB_DEPENDS=  libpcre.so:devel/pcre
SPCRE_MAKE_ARGS=    USE_PCRE=1 USE_STATIC_PCRE=1 USE_PCRE_JIT=1
DEVICEATLAS_LIB_DEPENDS=    libda.so:net/deviceatlas-enterprise-c
DEVICEATLAS_MAKE_ARGS=      USE_DEVICEATLAS=1 DEVICEATLAS_LIB=${LOCALBASE}/lib DEVICEATLAS_INC=${LOCALBASE}/include
OPENSSL_USES=       ssl
OPENSSL_MAKE_ARGS=  USE_OPENSSL=1 SSL_LIB=${OPENSSLLIB} SSL_INC=${OPENSSLINC}
LUA_USES=       lua:53
LUA_MAKE_ARGS=      USE_LUA=1 LUA_INC=${LUA_INCDIR} LUA_LIB=${LUA_LIBDIR} LUA_LIB_NAME=lua-${LUA_VER}

.include <bsd.port.pre.mk>

.if ${ARCH} == "amd64" || ${ARCH} == "i386"
MAKE_ARGS+= USE_REGPARM=1
.endif

post-build:
    cd ${WRKSRC}/contrib/halog && ${MAKE_CMD} ${MAKE_ENV}

do-install:
    ${INSTALL_PROGRAM} ${WRKSRC}/haproxy ${STAGEDIR}${PREFIX}/sbin/
    ${INSTALL_PROGRAM} ${WRKSRC}/contrib/halog/halog ${STAGEDIR}${PREFIX}/sbin/
    ${INSTALL_MAN} ${WRKSRC}/doc/haproxy.1 ${STAGEDIR}${MAN1PREFIX}/man/man1
    ${MKDIR} ${STAGEDIR}${DOCSDIR}
    (cd ${WRKSRC}/doc/ && ${COPYTREE_SHARE} \* ${STAGEDIR}${DOCSDIR})
    ${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
    (cd ${WRKSRC}/examples/ && ${COPYTREE_SHARE} \* ${STAGEDIR}${EXAMPLESDIR})

.include <bsd.port.post.mk>