diff options
author | Dmitry Sivachenko <demon@FreeBSD.org> | 2018-08-16 13:13:57 +0000 |
---|---|---|
committer | Dmitry Sivachenko <demon@FreeBSD.org> | 2018-08-16 13:13:57 +0000 |
commit | 737a6362f260d1eb9e7f8d9c9d532fb7ec84b974 (patch) | |
tree | be268d4705b953ab846210a0d7c6eadeae0e106f /net | |
parent | - Update to 5.3.0 (diff) |
Repo-copy haproxy->haproxy17 for the upcoming update of haproxy port.
Diffstat (limited to 'net')
-rw-r--r-- | net/Makefile | 1 | ||||
-rw-r--r-- | net/haproxy17/Makefile | 69 | ||||
-rw-r--r-- | net/haproxy17/distinfo | 3 | ||||
-rw-r--r-- | net/haproxy17/files/haproxy.in | 125 | ||||
-rw-r--r-- | net/haproxy17/files/patch-fix-cpuaffinity | 26 | ||||
-rw-r--r-- | net/haproxy17/files/patch-src_ssl__sock.c | 45 | ||||
-rw-r--r-- | net/haproxy17/pkg-descr | 6 | ||||
-rw-r--r-- | net/haproxy17/pkg-plist | 101 |
8 files changed, 376 insertions, 0 deletions
diff --git a/net/Makefile b/net/Makefile index ac5c84f13f61..d5808c83ab6b 100644 --- a/net/Makefile +++ b/net/Makefile @@ -240,6 +240,7 @@ SUBDIR += hanstunnel SUBDIR += haproxy SUBDIR += haproxy-devel + SUBDIR += haproxy17 SUBDIR += hexinject SUBDIR += hidentd SUBDIR += hinfo diff --git a/net/haproxy17/Makefile b/net/haproxy17/Makefile new file mode 100644 index 000000000000..6f181cee7dc6 --- /dev/null +++ b/net/haproxy17/Makefile @@ -0,0 +1,69 @@ +# Created by: Clement Laforet +# $FreeBSD$ + +PORTNAME= haproxy17 +PORTVERSION= 1.7.11 +CATEGORIES= net www +MASTER_SITES= http://www.haproxy.org/download/1.7/src/ +DISTNAME= haproxy-${PORTVERSION} + +MAINTAINER= demon@FreeBSD.org +COMMENT= Reliable, high performance TCP/HTTP load balancer + +LICENSE= GPLv2 LGPL21 +LICENSE_COMB= multi + +BROKEN_mips= fails to build: undefined reference to '__sync_sub_and_fetch_4' +BROKEN_mips64= fails to build: undefined reference to '__sync_sub_and_fetch_4' + +CONFLICTS_INSTALL= haproxy-[0-9]* haproxy-devel-[0-9]* + +USES= 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 + +.if ${PORT_OPTIONS:MOPENSSL} && ${SSL_DEFAULT:Mopenssl-devel} +BROKEN= Does not build with openssl-devel +.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> diff --git a/net/haproxy17/distinfo b/net/haproxy17/distinfo new file mode 100644 index 000000000000..0078476891b3 --- /dev/null +++ b/net/haproxy17/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1525108601 +SHA256 (haproxy-1.7.11.tar.gz) = d564b8e9429d1e8e13cb648bf4694926b472e36da1079df946bb732927b232ea +SIZE (haproxy-1.7.11.tar.gz) = 1752129 diff --git a/net/haproxy17/files/haproxy.in b/net/haproxy17/files/haproxy.in new file mode 100644 index 000000000000..3e2d8b3a034e --- /dev/null +++ b/net/haproxy17/files/haproxy.in @@ -0,0 +1,125 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: haproxy +# REQUIRE: DAEMON LOGIN +# KEYWORD: shutdown + +# +# Add the following lines to /etc/rc.conf to enable haproxy: +# +# haproxy_enable (bool): default: "NO" +# Set to "YES" to enable haproxy +# haproxy_pidfile (str): default: /var/run/haproxy.pid +# Set to the full path of the pid file +# haproxy_config (str): default: %%PREFIX%%/etc/haproxy.conf +# Set to the full path of the config file +# haproxy_flags (str): default: Autogenerated using pidfile and config options +# Set to override with your own options +# haproxy_profiles (str): default: empty +# Set to space-separated list of profiles: for each profile separate haproxy +# process will be spawned, with haproxy-${profile}.conf config file. +# You can override default pidfile and config file for each profile with +# haproxy_${profile}_config and haproxy_${profile}_pidfile. + +. /etc/rc.subr + +name="haproxy" +rcvar=haproxy_enable +command="%%PREFIX%%/sbin/haproxy" +extra_commands="reload configtest hardstop hardreload" +reload_cmd="haproxy_reload" +hardreload_cmd="haproxy_reload" +hardreload_precmd="def_hardreload_option" +stop_cmd="haproxy_stop" +hardstop_cmd="haproxy_stop" +hardstop_precmd="def_hardstop_signal" + +: ${haproxy_enable:="NO"} +: ${haproxy_config:="%%PREFIX%%/etc/${name}.conf"} +pidfile=${haproxy_pidfile:-"/var/run/haproxy.pid"} + +def_hardreload_option() +{ + reload_opt="-st" +} + +def_hardstop_signal() +{ + sig_stop="TERM" +} + +load_rc_config $name + +is_valid_profile() { + local profile + for profile in $haproxy_profiles; do + if [ "$profile" = "$1" ]; then + return 0 + fi + done + return 1 +} + +if [ -n "$2" ]; then + profile=$2 + if ! is_valid_profile $profile; then + echo "$0: no such profile ($profile) defined in ${name}_profiles." + exit 1 + fi + eval haproxy_config="\${haproxy_${profile}_config:-%%PREFIX%%/etc/haproxy-${profile}.conf}" + eval pidfile="\${haproxy_${profile}_pidfile:-/var/run/haproxy-${profile}.pid}" +else + if [ "x${haproxy_profiles}" != "x" -a "x$1" != "x" ]; then + for profile in ${haproxy_profiles}; do + echo "===> ${name} profile: ${profile}" + %%PREFIX%%/etc/rc.d/haproxy $1 ${profile} + retcode="$?" + if [ ${retcode} -ne 0 ]; then + failed="${profile} (${retcode}) ${failed:-}" + else + success="${profile} ${success:-}" + fi + done + exit 0 + fi +fi + +: ${haproxy_flags:="-q -f ${haproxy_config} -p ${pidfile}"} +configtest_cmd="$command -c -f $haproxy_config" +start_precmd="$command -q -c -f $haproxy_config" +required_files=$haproxy_config +sig_stop=SIGUSR1 +reload_opt="-sf" + +haproxy_reload() +{ + ${command} -q -c -f ${haproxy_config} + if [ $? -ne 0 ]; then + err 1 "Error found in ${haproxy_config} - not reloading current process!" + fi + rc_pid=$(check_pidfile ${pidfile} ${command}) + if [ $rc_pid ]; then + ${command} ${haproxy_flags} $reload_opt $(cat ${pidfile}) + else + _run_rc_notrunning + return 1 + fi +} + +haproxy_stop() +{ + rc_pid=$(check_pidfile ${pidfile} ${command}) + if [ $rc_pid ]; then + rc_pid=$(cat ${pidfile}) + kill -$sig_stop $rc_pid + wait_for_pids $rc_pid + else + _run_rc_notrunning + return 1 + fi +} + +run_rc_command "$1" diff --git a/net/haproxy17/files/patch-fix-cpuaffinity b/net/haproxy17/files/patch-fix-cpuaffinity new file mode 100644 index 000000000000..ba992d5f9465 --- /dev/null +++ b/net/haproxy17/files/patch-fix-cpuaffinity @@ -0,0 +1,26 @@ +X-Git-Url: http://git.haproxy.org/?p=haproxy.git;a=blobdiff_plain;f=src%2Fhaproxy.c;h=30e850c4ac4719b71adccb3b6bd41248ef5bb470;hp=7af4ab479c761a43b2fa64d2124388dbf5c21fc3;hb=97148f60b8feec39b76768d1bcfab6d755c12164;hpb=0d00593361b91017b894c4c7d5e24721a7838d6e + +diff --git a/src/haproxy.c b/src/haproxy.c +index 7af4ab4..30e850c 100644 +--- src/haproxy.c ++++ src/haproxy.c +@@ -2018,7 +2018,18 @@ int main(int argc, char **argv) + proc < LONGBITS && /* only the first 32/64 processes may be pinned */ + global.cpu_map[proc]) /* only do this if the process has a CPU map */ + #ifdef __FreeBSD__ +- cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1, sizeof(unsigned long), (void *)&global.cpu_map[proc]); ++ { ++ cpuset_t cpuset; ++ int i; ++ unsigned long cpu_map = global.cpu_map[proc]; ++ ++ CPU_ZERO(&cpuset); ++ while ((i = ffsl(cpu_map)) > 0) { ++ CPU_SET(i - 1, &cpuset); ++ cpu_map &= ~(1 << (i - 1)); ++ } ++ ret = cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1, sizeof(cpuset), &cpuset); ++ } + #else + sched_setaffinity(0, sizeof(unsigned long), (void *)&global.cpu_map[proc]); + #endif diff --git a/net/haproxy17/files/patch-src_ssl__sock.c b/net/haproxy17/files/patch-src_ssl__sock.c new file mode 100644 index 000000000000..d67b9127ca80 --- /dev/null +++ b/net/haproxy17/files/patch-src_ssl__sock.c @@ -0,0 +1,45 @@ +--- src/ssl_sock.c.orig 2017-07-07 09:49:34 UTC ++++ src/ssl_sock.c +@@ -794,8 +794,11 @@ static int ssl_sock_load_ocsp(SSL_CTX *c + ocsp = NULL; + + #ifndef SSL_CTX_get_tlsext_status_cb ++#ifndef SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB ++#define SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB 128 ++#endif + # define SSL_CTX_get_tlsext_status_cb(ctx, cb) \ +- *cb = (void (*) (void))ctx->tlsext_status_cb; ++ *cb = SSL_CTX_ctrl(ctx,SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB,0, (void (**)(void))cb) + #endif + SSL_CTX_get_tlsext_status_cb(ctx, &callback); + +@@ -823,7 +826,10 @@ static int ssl_sock_load_ocsp(SSL_CTX *c + int key_type; + EVP_PKEY *pkey; + +-#ifdef SSL_CTX_get_tlsext_status_arg ++#if defined(SSL_CTX_get_tlsext_status_arg) || defined(LIBRESSL_VERSION_NUMBER) ++#ifndef SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG ++#define SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG 129 ++#endif + SSL_CTX_ctrl(ctx, SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG, 0, &cb_arg); + #else + cb_arg = ctx->tlsext_status_arg; +@@ -3539,7 +3545,7 @@ int ssl_sock_handshake(struct connection + OSSL_HANDSHAKE_STATE state = SSL_get_state((SSL *)conn->xprt_ctx); + empty_handshake = state == TLS_ST_BEFORE; + #else +- empty_handshake = !((SSL *)conn->xprt_ctx)->packet_length; ++ empty_handshake = SSL_state((SSL *)conn->xprt_ctx) == SSL_ST_BEFORE; + #endif + + if (empty_handshake) { +@@ -3617,7 +3623,7 @@ int ssl_sock_handshake(struct connection + state = SSL_get_state((SSL *)conn->xprt_ctx); + empty_handshake = state == TLS_ST_BEFORE; + #else +- empty_handshake = !((SSL *)conn->xprt_ctx)->packet_length; ++ empty_handshake = SSL_state((SSL *)conn->xprt_ctx) == SSL_ST_BEFORE; + #endif + if (empty_handshake) { + if (!errno) { diff --git a/net/haproxy17/pkg-descr b/net/haproxy17/pkg-descr new file mode 100644 index 000000000000..678317bd6baf --- /dev/null +++ b/net/haproxy17/pkg-descr @@ -0,0 +1,6 @@ +HAProxy is a free, very fast and reliable solution offering high +availability, load balancing, and proxying for TCP and HTTP-based +applications. It is particularly suited for web sites crawling under +very high loads while needing persistence or Layer7 processing. + +WWW: http://www.haproxy.org diff --git a/net/haproxy17/pkg-plist b/net/haproxy17/pkg-plist new file mode 100644 index 000000000000..f1af4744412e --- /dev/null +++ b/net/haproxy17/pkg-plist @@ -0,0 +1,101 @@ +man/man1/haproxy.1.gz +sbin/halog +sbin/haproxy +%%PORTDOCS%%%%DOCSDIR%%/51Degrees-device-detection.txt +%%PORTDOCS%%%%DOCSDIR%%/DeviceAtlas-device-detection.txt +%%PORTDOCS%%%%DOCSDIR%%/SPOE.txt +%%PORTDOCS%%%%DOCSDIR%%/WURFL-device-detection.txt +%%PORTDOCS%%%%DOCSDIR%%/acl.fig +%%PORTDOCS%%%%DOCSDIR%%/architecture.txt +%%PORTDOCS%%%%DOCSDIR%%/close-options.txt +%%PORTDOCS%%%%DOCSDIR%%/coding-style.txt +%%PORTDOCS%%%%DOCSDIR%%/configuration.txt +%%PORTDOCS%%%%DOCSDIR%%/cookie-options.txt +%%PORTDOCS%%%%DOCSDIR%%/design-thoughts/backends-v0.txt +%%PORTDOCS%%%%DOCSDIR%%/design-thoughts/backends.txt +%%PORTDOCS%%%%DOCSDIR%%/design-thoughts/be-fe-changes.txt +%%PORTDOCS%%%%DOCSDIR%%/design-thoughts/binding-possibilities.txt +%%PORTDOCS%%%%DOCSDIR%%/design-thoughts/buffer-redesign.txt +%%PORTDOCS%%%%DOCSDIR%%/design-thoughts/buffers.fig +%%PORTDOCS%%%%DOCSDIR%%/design-thoughts/config-language.txt +%%PORTDOCS%%%%DOCSDIR%%/design-thoughts/connection-reuse.txt +%%PORTDOCS%%%%DOCSDIR%%/design-thoughts/connection-sharing.txt +%%PORTDOCS%%%%DOCSDIR%%/design-thoughts/dynamic-buffers.txt +%%PORTDOCS%%%%DOCSDIR%%/design-thoughts/entities-v2.txt +%%PORTDOCS%%%%DOCSDIR%%/design-thoughts/how-it-works.txt +%%PORTDOCS%%%%DOCSDIR%%/design-thoughts/http2.txt +%%PORTDOCS%%%%DOCSDIR%%/design-thoughts/http_load_time.url +%%PORTDOCS%%%%DOCSDIR%%/design-thoughts/rate-shaping.txt +%%PORTDOCS%%%%DOCSDIR%%/design-thoughts/sess_par_sec.txt +%%PORTDOCS%%%%DOCSDIR%%/gpl.txt +%%PORTDOCS%%%%DOCSDIR%%/haproxy.1 +%%PORTDOCS%%%%DOCSDIR%%/internals/acl.txt +%%PORTDOCS%%%%DOCSDIR%%/internals/body-parsing.txt +%%PORTDOCS%%%%DOCSDIR%%/internals/buffer-operations.txt +%%PORTDOCS%%%%DOCSDIR%%/internals/buffer-ops.fig +%%PORTDOCS%%%%DOCSDIR%%/internals/connect-status.txt +%%PORTDOCS%%%%DOCSDIR%%/internals/connection-header.txt +%%PORTDOCS%%%%DOCSDIR%%/internals/connection-scale.txt +%%PORTDOCS%%%%DOCSDIR%%/internals/entities-v2.txt +%%PORTDOCS%%%%DOCSDIR%%/internals/entities.fig +%%PORTDOCS%%%%DOCSDIR%%/internals/entities.pdf +%%PORTDOCS%%%%DOCSDIR%%/internals/entities.svg +%%PORTDOCS%%%%DOCSDIR%%/internals/entities.txt +%%PORTDOCS%%%%DOCSDIR%%/internals/filters.txt +%%PORTDOCS%%%%DOCSDIR%%/internals/hashing.txt +%%PORTDOCS%%%%DOCSDIR%%/internals/header-parser-speed.txt +%%PORTDOCS%%%%DOCSDIR%%/internals/header-tree.txt +%%PORTDOCS%%%%DOCSDIR%%/internals/http-cookies.txt +%%PORTDOCS%%%%DOCSDIR%%/internals/http-docs.txt +%%PORTDOCS%%%%DOCSDIR%%/internals/http-parsing.txt +%%PORTDOCS%%%%DOCSDIR%%/internals/list.fig +%%PORTDOCS%%%%DOCSDIR%%/internals/lua_socket.fig +%%PORTDOCS%%%%DOCSDIR%%/internals/lua_socket.pdf +%%PORTDOCS%%%%DOCSDIR%%/internals/naming.txt +%%PORTDOCS%%%%DOCSDIR%%/internals/pattern.dia +%%PORTDOCS%%%%DOCSDIR%%/internals/pattern.pdf +%%PORTDOCS%%%%DOCSDIR%%/internals/polling-states.fig +%%PORTDOCS%%%%DOCSDIR%%/internals/repartition-be-fe-fi.txt +%%PORTDOCS%%%%DOCSDIR%%/internals/sequence.fig +%%PORTDOCS%%%%DOCSDIR%%/internals/stats-v2.txt +%%PORTDOCS%%%%DOCSDIR%%/internals/stream-sock-states.fig +%%PORTDOCS%%%%DOCSDIR%%/intro.txt +%%PORTDOCS%%%%DOCSDIR%%/lgpl.txt +%%PORTDOCS%%%%DOCSDIR%%/linux-syn-cookies.txt +%%PORTDOCS%%%%DOCSDIR%%/lua-api/Makefile +%%PORTDOCS%%%%DOCSDIR%%/lua-api/_static/channel.fig +%%PORTDOCS%%%%DOCSDIR%%/lua-api/_static/channel.png +%%PORTDOCS%%%%DOCSDIR%%/lua-api/conf.py +%%PORTDOCS%%%%DOCSDIR%%/lua-api/index.rst +%%PORTDOCS%%%%DOCSDIR%%/lua.txt +%%PORTDOCS%%%%DOCSDIR%%/management.txt +%%PORTDOCS%%%%DOCSDIR%%/netscaler-client-ip-insertion-protocol.txt +%%PORTDOCS%%%%DOCSDIR%%/network-namespaces.txt +%%PORTDOCS%%%%DOCSDIR%%/proxy-protocol.txt +%%PORTDOCS%%%%DOCSDIR%%/queuing.fig +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/acl-content-sw.cfg +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/auth.cfg +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/check +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/check.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/content-sw-sample.cfg +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/debug2ansi +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/debug2html +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/debugfind +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/errorfiles/400.http +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/errorfiles/403.http +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/errorfiles/408.http +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/errorfiles/500.http +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/errorfiles/502.http +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/errorfiles/503.http +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/errorfiles/504.http +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/errorfiles/README +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/haproxy.init +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/haproxy.spec +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/haproxy.vim +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/init.haproxy +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/option-http_proxy.cfg +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/seamless_reload.txt +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/ssl.cfg +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/stats_haproxy.sh +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/transparent_proxy.cfg +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/wurfl-example.cfg |