Commit fd61ead9 authored by Dmitry Sivachenko's avatar Dmitry Sivachenko
Browse files

net/haproxy24: GC obsoleted haproxy version.

parent 16bd82bf
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -246,7 +246,6 @@
    SUBDIR += hanstunnel
    SUBDIR += haproxy
    SUBDIR += haproxy-devel
    SUBDIR += haproxy24
    SUBDIR += haproxy26
    SUBDIR += haproxy28
    SUBDIR += haproxy30

net/haproxy24/Makefile

deleted100644 → 0
+0 −74
Original line number Diff line number Diff line
PORTNAME=	haproxy
DISTVERSION=	2.4.35
CATEGORIES=	net www
PKGNAMESUFFIX=	24
MASTER_SITES=	http://www.haproxy.org/download/2.4/src/

MAINTAINER=	demon@FreeBSD.org
COMMENT=	Reliable, high performance TCP/HTTP load balancer
WWW=		https://www.haproxy.org

LICENSE=	GPLv2 LGPL21
LICENSE_COMB=	multi

FLAVORS=	default lua
FLAVOR?=	${FLAVORS:[1]}

default_CONFLICTS_INSTALL=	haproxy-lua
lua_CONFLICTS_INSTALL=		haproxy
lua_PKGNAMESUFFIX=		24-lua

CONFLICTS_INSTALL=	haproxy haproxy-devel haproxy26 haproxy28

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

ALL_TARGET=	all admin/halog/halog
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}" \
		${MAKE_ARGS_${ARCH}}
MAKE_ARGS_i386=	USE_LIBATOMIC=
MAKE_ARGS_powerpc=	USE_LIBATOMIC=

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

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
PROMEX_MAKE_ARGS=	USE_PROMEX=1
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}

.if ${FLAVOR:U} == lua
OPTIONS_DEFAULT+=	LUA
.endif

.include <bsd.port.pre.mk>

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

do-install:
	${INSTALL_PROGRAM} ${WRKSRC}/haproxy ${STAGEDIR}${PREFIX}/sbin/
	${INSTALL_PROGRAM} ${WRKSRC}/admin/halog/halog ${STAGEDIR}${PREFIX}/sbin/
	${INSTALL_MAN} ${WRKSRC}/doc/haproxy.1 ${STAGEDIR}${PREFIX}/share/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>

net/haproxy24/distinfo

deleted100644 → 0
+0 −3
Original line number Diff line number Diff line
TIMESTAMP = 1778529912
SHA256 (haproxy-2.4.35.tar.gz) = 931ad4de3f036ac8f18a5f1370460aed69dc5b0b0d3fa228dddb7211970fb44a
SIZE (haproxy-2.4.35.tar.gz) = 3688410

net/haproxy24/files/haproxy.in

deleted100644 → 0
+0 −131
Original line number Diff line number Diff line
#!/bin/sh

# 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 softreload"
reload_cmd="haproxy_reload"
hardreload_cmd="haproxy_reload"
hardreload_precmd="def_hardreload_option"
softreload_cmd="haproxy_reload"
softreload_precmd="def_softreload_option"
stop_cmd="haproxy_stop"
hardstop_cmd="haproxy_stop"
hardstop_precmd="def_hardstop_signal"

: ${haproxy_enable:="NO"}
: ${haproxy_config:="%%PREFIX%%/etc/${name}.conf"}
: ${haproxy_socket:="/var/run/${name}/socket"}
pidfile=${haproxy_pidfile:-"/var/run/haproxy.pid"}

def_hardreload_option()
{
    reload_opt="-st"
}

def_softreload_option()
{
    reload_opt="-x ${haproxy_socket} -sf"
}

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 haproxy_fib="\${haproxy_${profile}_fib:${haproxy_fib}}"
    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"
+0 −78
Original line number Diff line number Diff line
From ce5ca630697a069ffbd81169663e5dbeb554179a Mon Sep 17 00:00:00 2001
From: Willy Tarreau <w@1wt.eu>
Date: Wed, 6 Oct 2021 11:23:32 +0200
Subject: CLEANUP: servers: do not include openssl-compat

This is exactly the same as for listeners, servers only include
openssl-compat to provide the SSL_CTX type to use as two pointers to
contexts, and to detect if NPN, ALPN, and cipher suites are supported,
and save up to 5 pointers in the ssl_ctx struct if not supported. This
is pointless, as these ones have all been supported for about a decade,
and including this file comes with a long dependency chain that impacts
lots of other files. The ctx was made a void*.

Now the build time was significantly reduced, from 9.2 to 8.1 seconds,
thanks to opensslconf.h being included "only" 456 times instead of 2424
previously!

The total number of lines of code compiled was reduced by 15%.

(cherry picked from commit 340ef2502eae2a37781e460d3590982c0e437fbd)
[wt: this is backported to get rid of the painful #ifdef around SSL
 fields that regularly break backports]
Signed-off-by: Willy Tarreau <w@1wt.eu>
---
 include/haproxy/server-t.h | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/include/haproxy/server-t.h b/include/haproxy/server-t.h
index 429195388..32b649bf3 100644
--- include/haproxy/server-t.h
+++ include/haproxy/server-t.h
@@ -35,9 +35,7 @@
 #include <haproxy/freq_ctr-t.h>
 #include <haproxy/listener-t.h>
 #include <haproxy/obj_type-t.h>
-#include <haproxy/openssl-compat.h>
 #include <haproxy/resolvers-t.h>
-#include <haproxy/ssl_sock-t.h>
 #include <haproxy/stats-t.h>
 #include <haproxy/task-t.h>
 #include <haproxy/thread-t.h>
@@ -341,7 +339,7 @@ struct server {
 #ifdef USE_OPENSSL
 	char *sni_expr;             /* Temporary variable to store a sample expression for SNI */
 	struct {
-		SSL_CTX *ctx;
+		void *ctx;
 		struct {
 			unsigned char *ptr;
 			int size;
@@ -353,9 +351,7 @@ struct server {
 		__decl_thread(HA_RWLOCK_T lock); /* lock the cache and SSL_CTX during commit operations */
 
 		char *ciphers;			/* cipher suite to use if non-null */
-#ifdef HAVE_SSL_CTX_SET_CIPHERSUITES
 		char *ciphersuites;			/* TLS 1.3 cipher suite to use if non-null */
-#endif
 		int options;			/* ssl options */
 		int verify;			/* verify method (set of SSL_VERIFY_* flags) */
 		struct tls_version_filter methods;	/* ssl methods */
@@ -363,14 +359,10 @@ struct server {
 		char *ca_file;			/* CAfile to use on verify */
 		char *crl_file;			/* CRLfile to use on verify */
 		struct sample_expr *sni;        /* sample expression for SNI */
-#ifdef OPENSSL_NPN_NEGOTIATED
 		char *npn_str;                  /* NPN protocol string */
 		int npn_len;                    /* NPN protocol string length */
-#endif
-#ifdef TLSEXT_TYPE_application_layer_protocol_negotiation
 		char *alpn_str;                 /* ALPN protocol string */
 		int alpn_len;                   /* ALPN protocol string length */
-#endif
 	} ssl_ctx;
 #ifdef USE_QUIC
 	struct quic_transport_params quic_params; /* QUIC transport parameters */
-- 
2.28.0
Loading