git: 427a28cd6ad0 - main - www/nginx: Add STREAM_REALIP knob for the ngx_stream_realip module.

From: Jochen Neumeister <joneum_at_FreeBSD.org>
Date: Sun, 26 Mar 2023 16:07:52 UTC
The branch main has been updated by joneum:

URL: https://cgit.FreeBSD.org/ports/commit/?id=427a28cd6ad02fd22de2d8ebaf509c397030a72a

commit 427a28cd6ad02fd22de2d8ebaf509c397030a72a
Author:     Jochen Neumeister <joneum@FreeBSD.org>
AuthorDate: 2023-03-26 16:05:31 +0000
Commit:     Jochen Neumeister <joneum@FreeBSD.org>
CommitDate: 2023-03-26 16:07:46 +0000

    www/nginx: Add STREAM_REALIP knob for the ngx_stream_realip module.
    
    Also, create STREAMGRP group for stream-specific modules.
    
    PR:     267112
    Sponsored by:   Netzkommune GmbH
---
 www/nginx/Makefile              | 24 ++++++++++++++++++------
 www/nginx/Makefile.options.desc |  1 +
 2 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/www/nginx/Makefile b/www/nginx/Makefile
index 97184dba0eeb..2160a3c4b195 100644
--- a/www/nginx/Makefile
+++ b/www/nginx/Makefile
@@ -69,14 +69,14 @@ GROUPS?=${WWWGRP}
 
 NO_OPTIONS_SORT=	yes
 
-OPTIONS_GROUP=	MAILGRP HTTPGRP
+OPTIONS_GROUP=	MAILGRP HTTPGRP STREAMGRP
 # Modules that are part of the base nginx distribution
 OPTIONS_GROUP_HTTPGRP=	GOOGLE_PERFTOOLS HTTP HTTP_ADDITION HTTP_AUTH_REQ \
 	HTTP_CACHE HTTP_DAV HTTP_FLV HTTP_GUNZIP_FILTER HTTP_GZIP_STATIC \
 	HTTP_IMAGE_FILTER HTTP_MP4 HTTP_PERL HTTP_RANDOM_INDEX HTTP_REALIP \
 	HTTP_SECURE_LINK HTTP_SLICE HTTP_SLICE_AHEAD \
-	HTTP_SSL HTTP_STATUS HTTP_SUB HTTP_XSLT HTTPV2 HTTPV2_AUTOTUNE \
-	STREAM STREAM_SSL STREAM_SSL_PREREAD
+	HTTP_SSL HTTP_STATUS HTTP_SUB HTTP_XSLT HTTPV2 HTTPV2_AUTOTUNE
+
 # External modules (arrayvar MUST appear after devel_kit for build-dep)
 OPTIONS_GROUP_HTTPGRP+=	AJP AWS_AUTH BROTLI CACHE_PURGE CLOJURE CT DEVEL_KIT \
 	ARRAYVAR DRIZZLE DYNAMIC_TLS DYNAMIC_HC DYNAMIC_UPSTREAM ECHO ENCRYPTSESSION \
@@ -91,14 +91,20 @@ OPTIONS_GROUP_HTTPGRP+=	AJP AWS_AUTH BROTLI CACHE_PURGE CLOJURE CT DEVEL_KIT \
 	MEMC MODSECURITY3 NAXSI OPENTRACING PASSENGER POSTGRES RDS_CSV \
 	RDS_JSON REDIS2 RTMP SET_MISC SFLOW SHIBBOLETH SLOWFS_CACHE \
 	SMALL_LIGHT SRCACHE VOD VTS XSS WEBSOCKIFY
+
 OPTIONS_GROUP_MAILGRP=	MAIL MAIL_IMAP MAIL_POP3 MAIL_SMTP MAIL_SSL
+
+OPTIONS_GROUP_STREAMGRP=	STREAM STREAM_REALIP STREAM_SSL \
+	STREAM_SSL_PREREAD
+
 OPTIONS_DEFINE=	DEBUG DEBUGLOG DSO FILE_AIO IPV6 NJS THREADS WWW
+
 OPTIONS_DEFAULT?=	DSO FILE_AIO HTTP HTTP_ADDITION HTTP_AUTH_REQ HTTP_CACHE \
 		HTTP_DAV HTTP_FLV HTTP_GZIP_STATIC HTTP_GUNZIP_FILTER \
 		HTTP_MP4 HTTP_RANDOM_INDEX HTTP_REALIP HTTP_SECURE_LINK \
 		HTTP_SLICE HTTP_REWRITE HTTP_SSL HTTP_STATUS HTTP_SUB \
-		HTTPV2 MAIL MAIL_SSL PCRE_ONE STREAM STREAM_SSL STREAM_SSL_PREREAD \
-		THREADS WWW
+		HTTPV2 MAIL MAIL_SSL PCRE_ONE STREAM STREAM_SSL STREAM_REALIP \
+		STREAM_SSL_PREREAD THREADS WWW
 
 OPTIONS_RADIO+=		PCRE
 OPTIONS_RADIO_PCRE=	PCRE_ONE PCRE_TWO
@@ -118,9 +124,14 @@ ${opt}_IMPLIES=	MAIL
 ${opt}_IMPLIES=	HTTP
 .endfor
 
+.for opt in ${OPTIONS_GROUP_STREAMGRP:NSTREAM}
+${opt}_IMPLIES=	STREAM
+.endfor
+
 # If the target is makesum, make sure that every distfile is fetched.
 .if ${.TARGETS:Mmakesum}
-OPTIONS_DEFAULT=	${OPTIONS_DEFINE} ${OPTIONS_GROUP_HTTP} ${OPTIONS_GROUP_MAIL}
+OPTIONS_DEFAULT=	${OPTIONS_DEFINE} ${OPTIONS_GROUP_HTTP} \
+	${OPTIONS_GROUP_MAIL} ${OPTIONS_GROUP_STREAM}
 .endif
 
 # Non-module options handling
@@ -176,6 +187,7 @@ MAIL_SMTP_CONFIGURE_OFF=	--without-mail_smtp_module
 MAIL_SSL_USES=			ssl
 MAIL_SSL_CONFIGURE_ON=		--with-mail_ssl_module
 STREAM_VARS=			DSO_BASEMODS+=stream
+TREAM_REALIP_CONFIGURE_ON=	--with-stream_realip_module
 STREAM_SSL_IMPLIES=		HTTP_SSL
 STREAM_SSL_CONFIGURE_ON=	--with-stream_ssl_module
 STREAM_SSL_PREREAD_CONFIGURE_ON=	--with-stream_ssl_preread_module
diff --git a/www/nginx/Makefile.options.desc b/www/nginx/Makefile.options.desc
index 2e654046e5de..dc62dde971b6 100644
--- a/www/nginx/Makefile.options.desc
+++ b/www/nginx/Makefile.options.desc
@@ -105,6 +105,7 @@ SLOWFS_CACHE_DESC=		3rd party slowfs_cache module
 SMALL_LIGHT_DESC=		3rd party small_light module
 SRCACHE_DESC=			3rd party srcache module
 STREAM_DESC=			Enable stream module
+STREAM_REALIP_DESC=		Enable stream_realip module
 STREAM_SSL_DESC=		Enable stream_ssl module (SSL req.)
 STREAM_SSL_PREREAD_DESC=	Enable stream_ssl_preread module (SSL req.)
 THREADS_DESC=			Enable threads support