git: 08bff538e5c4 - main - www/freenginx-devel: Add new port

From: Jochen Neumeister <joneum_at_FreeBSD.org>
Date: Mon, 01 Jul 2024 08:50:28 UTC
The branch main has been updated by joneum:

URL: https://cgit.FreeBSD.org/ports/commit/?id=08bff538e5c4809dc32ee956da5ffc1c462c3617

commit 08bff538e5c4809dc32ee956da5ffc1c462c3617
Author:     Jochen Neumeister <joneum@FreeBSD.org>
AuthorDate: 2024-07-01 08:48:13 +0000
Commit:     Jochen Neumeister <joneum@FreeBSD.org>
CommitDate: 2024-07-01 08:50:20 +0000

    www/freenginx-devel: Add new port
    
    Freenginx is a fork web Server from Nginx
    
    Sponsored by:   Netzkommune GmbH
---
 www/Makefile                                       |   1 +
 www/freenginx-devel/Makefile                       | 383 +++++++++++++++++
 www/freenginx-devel/Makefile.extmod                | 336 +++++++++++++++
 www/freenginx-devel/Makefile.options.desc          | 118 ++++++
 www/freenginx-devel/distinfo                       |   5 +
 .../extra-patch-calio-iconv-nginx-module-config    |  19 +
 .../files/extra-patch-naxsi-libinjection__sqli_c   |  13 +
 www/freenginx-devel/files/extra-patch-naxsi_config |  26 ++
 .../files/extra-patch-nginx-ct-LibreSSL            |  20 +
 .../extra-patch-nginx-http-footer-filter-config    |  12 +
 .../files/extra-patch-nginx-link-function-config   |  42 ++
 .../files/extra-patch-nginx-notice-config          |  13 +
 .../extra-patch-nginx-thumbextractor-module-config |  25 ++
 .../files/extra-patch-nginx_mogilefs_module-config |  13 +
 .../files/extra-patch-ngx_brotli_filter_config     |  41 ++
 .../files/extra-patch-ngx_http_auth_ldap_module.c  |  10 +
 .../files/extra-patch-ngx_http_dav_ext_module.c    |  15 +
 .../extra-patch-ngx_http_json_status_module-config |  12 +
 .../files/extra-patch-ngx_http_mogilefs_module.c   |  12 +
 .../files/extra-patch-ngx_http_notice_module.c     |  11 +
 .../files/extra-patch-ngx_http_redis_module.c      |  34 ++
 .../files/extra-patch-ngx_http_sflow_config.c      |  10 +
 .../files/extra-patch-ngx_http_sflow_config.h      |  11 +
 .../files/extra-patch-ngx_http_sflow_module.c      |  59 +++
 .../files/extra-patch-ngx_http_tarantool-config    |  24 ++
 .../extra-patch-ngx_http_uploadprogress_module.c   |  73 ++++
 .../files/extra-patch-ngx_link_func_module.c       |  11 +
 .../files/extra-patch-ngx_postgres-config          |  19 +
 .../files/extra-patch-ngx_stream_ssl_ct_module.c   |  14 +
 ...tra-patch-openresty-drizzle-nginx-module-config |  42 ++
 .../files/extra-patch-passenger-build-nginx.rb     |  33 ++
 .../files/extra-patch-passenger-disable-telemetry  |  11 +
 ...tch-passenger_src_nginx__module_Configuration.c |  27 ++
 .../files/extra-patch-rds-csv-nginx-module-config  |  15 +
 .../files/extra-patch-rds-json-nginx-module-config |  15 +
 ...xtra-patch-spnego-http-auth-nginx-module-config |  14 +
 ...rc-http-modules-ngx_http_upstream_hash_module.c |  44 ++
 ...http-modules-ngx_http_upstream_ip_hash_module.c |  28 ++
 ...p-modules-ngx_http_upstream_least_conn_module.c |  46 +++
 ...-patch-src-http-ngx_http_upstream_round_robin.c | 101 +++++
 ...-patch-src-http-ngx_http_upstream_round_robin.h |  14 +
 ...ch-src_http_modules_ngx_http_slice_read_ahead.c | 456 +++++++++++++++++++++
 .../extra-patch-stream-lua-nginx-module_config     |  10 +
 .../files/extra-patch-xss-nginx-module-config      |  15 +
 www/freenginx-devel/files/nginx.in                 | 158 +++++++
 www/freenginx-devel/files/patch-conf-nginx.conf    |  47 +++
 www/freenginx-devel/files/pkg-message.in           |  25 ++
 www/freenginx-devel/pkg-descr                      |   8 +
 www/freenginx-devel/pkg-plist                      | 106 +++++
 49 files changed, 2597 insertions(+)

diff --git a/www/Makefile b/www/Makefile
index f55aaae2d51a..c7fbd6a8d8af 100644
--- a/www/Makefile
+++ b/www/Makefile
@@ -185,6 +185,7 @@
     SUBDIR += foswiki
     SUBDIR += free-sa-devel
     SUBDIR += freenginx
+    SUBDIR += freenginx-devel
     SUBDIR += fswiki
     SUBDIR += fusionpbx
     SUBDIR += g-cows
diff --git a/www/freenginx-devel/Makefile b/www/freenginx-devel/Makefile
new file mode 100644
index 000000000000..533f7a605ed8
--- /dev/null
+++ b/www/freenginx-devel/Makefile
@@ -0,0 +1,383 @@
+PORTNAME=	freenginx
+PORTVERSION=	1.27.1
+PORTREVISION?=	0
+CATEGORIES=	www
+MASTER_SITES=	https://freenginx.org/download/ \
+		LOCAL/joneum
+PKGNAMESUFFIX=	-devel
+DISTFILES=	${DISTNAME}${EXTRACT_SUFX}
+
+MAINTAINER?=	joneum@FreeBSD.org
+COMMENT?=	Robust and small WWW server
+WWW=		https://nginx.com/
+
+LICENSE?=	BSD2CLAUSE
+LICENSE_FILE?=	${WRKSRC}/LICENSE
+
+CONFLICTS_INSTALL=	nginx
+
+PORTSCOUT=	limit:^1\.2[7-8]\.[0-9]*
+
+USES=		cpe
+
+CPE_VENDOR=	freenginx
+CPE_PRODUCT=	freenginx
+USE_GITHUB=	nodefault
+
+NGINX_VARDIR?=	/var
+NGINX_LOGDIR?=	${NGINX_VARDIR}/log/nginx
+NGINX_RUNDIR?=	${NGINX_VARDIR}/run
+NGINX_TMPDIR?=	${NGINX_VARDIR}/tmp/nginx
+HTTP_PORT?=	80
+
+NGINX_ACCESSLOG?=	${NGINX_LOGDIR}/access.log
+NGINX_ERRORLOG?=	${NGINX_LOGDIR}/error.log
+
+CONFLICTS?=	nginx-1.* \
+		nginx-full-1.* \
+		nginx-lite-1.* \
+		nginx-naxsi-1.*
+USE_RC_SUBR?=	nginx
+SUB_FILES?=	pkg-message
+SUB_LIST+=	WWWOWN=${WWWOWN} \
+		WWWGRP=${WWWGRP} \
+		NGINX_RUNDIR=${NGINX_RUNDIR} \
+		NGINX_TMPDIR=${NGINX_TMPDIR} \
+		PREFIX=${PREFIX}
+
+HAS_CONFIGURE=	yes
+CONFIGURE_ARGS+=--prefix=${ETCDIR} \
+		--with-cc-opt="-I ${LOCALBASE}/include" \
+		--conf-path=${ETCDIR}/nginx.conf \
+		--sbin-path=${PREFIX}/sbin/nginx \
+		--pid-path=${NGINX_RUNDIR}/nginx.pid \
+		--error-log-path=${NGINX_ERRORLOG} \
+		--user=${WWWOWN} --group=${WWWGRP} \
+		--with-compat \
+		--with-pcre
+ALL_TARGET=
+
+PLIST_SUB+=	NGINX_TMPDIR=${NGINX_TMPDIR} NGINX_LOGDIR=${NGINX_LOGDIR} WWWOWN=${WWWOWN} WWWGRP=${WWWGRP}
+
+USERS?=	${WWWOWN}
+GROUPS?=${WWWGRP}
+
+NO_OPTIONS_SORT=	yes
+
+OPTIONS_GROUP=	HTTPGRP MAILGRP 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_DEGRADATION 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_SSL \
+	HTTP_STATUS HTTP_SUB HTTP_XSLT HTTPV2 HTTPV3 HTTPV3_BORING HTTPV3_LSSL \
+	HTTPV3_QTLS
+
+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 NJS_XML OTEL THREADS WWW
+OPTIONS_DEFAULT?=	DSO FILE_AIO HTTP HTTP_ADDITION HTTP_AUTH_REQ HTTP_CACHE \
+		HTTP_DAV HTTP_FLV HTTP_GUNZIP_FILTER HTTP_GZIP_STATIC HTTP_MP4 \
+		HTTP_RANDOM_INDEX HTTP_REALIP HTTP_SECURE_LINK HTTP_SLICE HTTP_SSL \
+		HTTP_STATUS HTTP_SUB HTTPV2 HTTPV3 MAIL MAIL_SSL STREAM \
+		STREAM_REALIP STREAM_SSL STREAM_SSL_PREREAD THREADS WWW
+
+LIB_DEPENDS+=	libpcre2-8.so:devel/pcre2
+
+OPTIONS_RADIO+=		GSSAPI
+OPTIONS_RADIO_GSSAPI=	GSSAPI_HEIMDAL GSSAPI_MIT
+GSSAPI_HEIMDAL_USES=	gssapi:heimdal,flags
+GSSAPI_MIT_USES=	gssapi:mit
+
+OPTIONS_SUB=	yes
+
+.include "Makefile.options.desc"
+
+.for opt in ${OPTIONS_GROUP_MAILGRP:NMAIL}
+${opt}_IMPLIES=	MAIL
+.endfor
+
+.for opt in ${OPTIONS_GROUP_HTTPGRP:NHTTP} WWW
+${opt}_IMPLIES=	HTTP
+.endfor
+
+.for opt in ${OPTIONS_GROUP_STREAMGRP:NSTREAM}
+${opt}_IMPLIES=	STREAM
+.endfor
+
+GSSAPI_HEIMDAL_IMPLIES=	HTTP_AUTH_KRB5
+GSSAPI_MIT_IMPLIES=	HTTP_AUTH_KRB5
+
+# If the target is makesum, make sure that every distfile is fetched.
+.if ${.TARGETS:Mmakesum}
+OPTIONS_DEFAULT=	${OPTIONS_DEFINE} ${OPTIONS_GROUP_HTTPGRP} \
+	${OPTIONS_GROUP_MAILGRP} ${OPTIONS_GROUP_STREAMGRP} \
+	${OPTIONS_GROUP_THIRDPARTYGRP}
+.endif
+
+# Non-module options handling
+DEBUG_CFLAGS=		-g
+DEBUG_VARS=		STRIP=#do not strip if nginx with debug information
+DEBUGLOG_CONFIGURE_ON=	--with-debug
+DSO_CONFIGURE_ON=	--modules-path=${MODULESDIR}
+DSO_VARS=		MODULESDIR=${PREFIX}/libexec/${PORTNAME}
+FILE_AIO_CONFIGURE_ON=	--with-file-aio
+IPV6_CONFIGURE_OFF=	--with-cc-opt="-DNGX_HAVE_INET6=0 -I ${LOCALBASE}/include"
+THREADS_CONFIGURE_ON=	--with-threads
+
+# Bundled modules
+GOOGLE_PERFTOOLS_LIB_DEPENDS=	libprofiler.so:devel/google-perftools
+GOOGLE_PERFTOOLS_CONFIGURE_ON=	--with-google_perftools_module
+HTTP_CONFIGURE_ON=		--http-client-body-temp-path=${NGINX_TMPDIR}/client_body_temp \
+				--http-fastcgi-temp-path=${NGINX_TMPDIR}/fastcgi_temp \
+				--http-proxy-temp-path=${NGINX_TMPDIR}/proxy_temp \
+				--http-scgi-temp-path=${NGINX_TMPDIR}/scgi_temp \
+				--http-uwsgi-temp-path=${NGINX_TMPDIR}/uwsgi_temp \
+				--http-log-path=${NGINX_ACCESSLOG}
+HTTP_CONFIGURE_OFF=		--without-http
+HTTP_ADDITION_CONFIGURE_ON=	--with-http_addition_module
+HTTP_AUTH_REQ_CONFIGURE_ON=	--with-http_auth_request_module
+HTTP_CACHE_CONFIGURE_OFF=	--without-http-cache
+HTTP_DAV_CONFIGURE_ON=		--with-http_dav_module
+HTTP_DEGRADATION_CONFIGURE_ON=	--with-http_degradation_module
+HTTP_FLV_CONFIGURE_ON=		--with-http_flv_module
+HTTP_GZIP_STATIC_CONFIGURE_ON=	--with-http_gzip_static_module
+HTTP_GUNZIP_FILTER_CONFIGURE_ON=--with-http_gunzip_module
+HTTP_IMAGE_FILTER_LIB_DEPENDS=	libgd.so:graphics/gd
+HTTP_IMAGE_FILTER_VARS=		DSO_BASEMODS+=http_image_filter_module
+HTTP_MP4_CONFIGURE_ON=		--with-http_mp4_module
+HTTP_PERL_CATEGORIES=		perl5
+HTTP_PERL_USES=			perl5
+# Fix build failure on clang >= 12
+HTTP_PERL_CFLAGS=		-Wno-compound-token-split-by-macro
+HTTP_PERL_VARS=			DSO_BASEMODS+=http_perl_module
+HTTP_RANDOM_INDEX_CONFIGURE_ON=	--with-http_random_index_module
+HTTP_REALIP_CONFIGURE_ON=	--with-http_realip_module
+HTTP_SECURE_LINK_CONFIGURE_ON=	--with-http_secure_link_module
+HTTP_SLICE_CONFIGURE_ON=	--with-http_slice_module
+HTTP_SSL_CONFIGURE_ON=		--with-http_ssl_module
+HTTP_SSL_USES=			ssl
+HTTP_STATUS_CONFIGURE_ON=	--with-http_stub_status_module
+HTTP_SUB_CONFIGURE_ON=		--with-http_sub_module
+HTTP_XSLT_CONFIGURE_ON=		--with-http_xslt_module
+HTTP_XSLT_LIB_DEPENDS=		libxml2.so:textproc/libxml2 \
+				libxslt.so:textproc/libxslt
+HTTP_XSLT_VARS=			DSO_BASEMODS+=http_xslt_module
+HTTPV2_IMPLIES=			HTTP_SSL
+HTTPV2_CONFIGURE_ON=		--with-http_v2_module
+HTTPV3_CONFIGURE_ON=		--with-http_v3_module
+HTTPV3_BORING_BUILD_DEPENDS=	${LOCALBASE}/bin/bssl:security/boringssl
+HTTPV3_BORING_RUN_DEPENDS=	${LOCALBASE}/bin/bssl:security/boringssl
+HTTPV3_BORING_IMPLIES=		HTTPV3
+HTTPV3_BORING_PREVENTS=		HTTPV3_LSSL HTTPV3_QTLS
+HTTPV3_LSSL_BUILD_DEPENDS=	${LOCALBASE}/include/tls.h:security/libressl-devel
+HTTPV3_LSSL_BUILD_DEPENDS=	${LOCALBASE}/include/tls.h:security/libressl-devel
+HTTPV3_LSSL_IMPLIES=		HTTPV3
+HTTPV3_LSSL_PREVENTS=		HTTPV3_BORING HTTPV3_QTLS
+HTTPV3_QTLS_BUILD_DEPENDS=	${LOCALBASE}/include/openssl/quic.h:security/openssl-quictls
+HTTPV3_QTLS_RUN_DEPENDS=	${LOCALBASE}/include/openssl/quic.h:security/openssl-quictls
+HTTPV3_QTLS_IMPLIES=		HTTPV3
+HTTPV3_QTLS_PREVENTS=		HTTPV3_BORING HTTPV3_LSSL
+MAIL_VARS=			DSO_BASEMODS+=mail
+MAIL_IMAP_CONFIGURE_OFF=	--without-mail_imap_module
+MAIL_POP3_CONFIGURE_OFF=	--without-mail_pop3_module
+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
+STREAM_CONFIGURE_ON=		--with-stream
+STREAM_REALIP_CONFIGURE_ON=	--with-stream_realip_module
+STREAM_SSL_USES=		ssl
+STREAM_SSL_CONFIGURE_ON=	--with-stream_ssl_module
+STREAM_SSL_PREREAD_CONFIGURE_ON=--with-stream_ssl_preread_module
+
+### External modules
+.include "Makefile.extmod"
+
+.include <bsd.port.pre.mk>
+
+.if ${PORT_OPTIONS:MDSO}
+_addbasemod=	=dynamic
+_addextmod=	add-dynamic-module
+.else
+_addextmod=	add-module
+.endif
+
+.for mod in ${DSO_BASEMODS}
+CONFIGURE_ARGS+=	--with-${mod}${_addbasemod}
+.endfor
+
+# Some modules depend on other being there before, for example, devel_kit needs
+# to be there before a few other.
+.for mod in ${FIRST_DSO_EXTMODS}
+CONFIGURE_ARGS+=	--${_addextmod}=${WRKSRC_${mod}}${${mod:tu}_SUBDIR}
+.endfor
+
+.for mod in ${DSO_EXTMODS}
+CONFIGURE_ARGS+=	--${_addextmod}=${WRKSRC_${mod}}${${mod:tu}_SUBDIR}
+.endfor
+# For non-GitHub hosted modules
+.for moddir in ${DSO_EXTDIRS}
+CONFIGURE_ARGS+=	--${_addextmod}=${WRKDIR}/${moddir}
+.endfor
+
+.if empty(PORT_OPTIONS:MHTTP) && empty(PORT_OPTIONS:MMAIL)
+IGNORE=		requires at least HTTP or MAIL to \
+		be defined.  Please do 'make config' again
+.endif
+
+.if ${PORT_OPTIONS:MHTTP_AUTH_KRB5} && (empty(PORT_OPTIONS:MGSSAPI_HEIMDAL) && empty(PORT_OPTIONS:MGSSAPI_MIT))
+IGNORE=		required at least GSSAPI_HEIMDAL or \
+		GSSAPI_MIT to be defined. Please do \
+		'make config' again
+.endif
+
+.if ${PORT_OPTIONS:MPASSENGER} && empty(PORT_OPTIONS:MDEBUG)
+CONFIGURE_ENV+=	OPTIMIZE="yes"
+CFLAGS+=	-DNDEBUG
+.endif
+
+.if ${PORT_OPTIONS:MPASSENGER}
+CONFIGURE_ENV+=	EXTRA_PRE_CXXFLAGS="-std=c++14"
+.endif
+
+.if empty(PORT_OPTIONS:MMODSECURITY3)
+CONFIGURE_ARGS+=	--with-ld-opt="-L ${LOCALBASE}/lib"
+.else
+CONFIGURE_ARGS+=	--with-ld-opt="-L ${LOCALBASE}/lib -lpcre"
+LIB_DEPENDS+=		libpcre.so:devel/pcre
+.endif
+
+.if ${PORT_OPTIONS:MNJS} && empty(PORT_OPTIONS:MNJS_XML)
+CONFIGURE_ENV+=		NJS_LIBXSLT=NO
+NJS_CONFIGURE_ARGS=	--no-libxml2
+.endif
+
+pre-everything::
+	@${ECHO_MSG}
+.if ${PORT_OPTIONS:MHTTP_UPSTREAM_FAIR}
+	@${ECHO_MSG} "Enable http_ssl module to build upstream_fair with SSL support"
+.endif
+.if ${PORT_OPTIONS:MPASSENGER}
+	@${ECHO_MSG} "This port install Passenger module only"
+.endif
+	@${ECHO_MSG}
+
+post-extract-NAXSI-on:
+	@${RMDIR} ${WRKSRC_naxsi}/naxsi_src/libinjection
+	@${LN} -s ${WRKSRC_libinjection} ${WRKSRC_naxsi}/naxsi_src/libinjection
+
+pre-patch-HTTPV3-on:
+	@${MV} ${WRKSRC}/README ${WRKSRC}/README.1st
+
+post-patch:
+	@${REINPLACE_CMD} 's!%%HTTP_PORT%%!${HTTP_PORT}!; \
+		s!%%PREFIX%%!${PREFIX}!; \
+		s!%%NGINX_ERRORLOG%%!${NGINX_ERRORLOG}!' \
+		${WRKSRC}/conf/nginx.conf
+
+post-patch-BROTLI-on:
+	@${REINPLACE_CMD} 's!%%PREFIX%%!${LOCALBASE}!g' ${WRKSRC_brotli}/filter/config
+
+post-patch-DRIZZLE-on:
+	@${REINPLACE_CMD} 's!%%PREFIX%%!${LOCALBASE}!g' ${WRKSRC_drizzle}/config
+
+post-patch-FASTDFS-on:
+	@${REINPLACE_CMD} \
+		's!%%PREFIX%%!${PREFIX}!g;s!%%LOCALBASE%%!${LOCALBASE}!g' \
+		${WRKSRC_fastdfs}/src/config
+
+post-patch-GRIDFS-on:
+	@${REINPLACE_CMD} 's!\/usr!${LOCALBASE}!g' \
+		${WRKSRC_gridfs}/nginx-gridfs/config
+
+post-patch-HTTP_AUTH_KRB5-on:
+	@${REINPLACE_CMD} 's!%%GSSAPILIBS%%!${GSSAPILIBS}!g; \
+		s!%%GSSAPIINCDIR%%!${GSSAPIINCDIR}!g; \
+		s!%%GSSAPILIBDIR%%!${GSSAPILIBDIR}!g' ${WRKSRC_auth_krb5}/config
+
+post-patch-HTTP_TARANTOOL-on:
+	@${REINPLACE_CMD} 's!%%PREFIX%%!${LOCALBASE}!g' ${WRKSRC_nginx_tarantool}/config
+
+post-patch-ICONV-on:
+	@${REINPLACE_CMD} 's!%%PREFIX%%!${LOCALBASE}!g' ${WRKSRC_iconv}/config
+
+post-patch-PASSENGER-on:
+	@${REINPLACE_CMD} \
+		'168,170s!true!false!' \
+		${WRKSRC_PASSENGER}/build/basics.rb
+	@${REINPLACE_CMD} \
+		's!-I/usr/include/libev!!; \
+		s!-lev!!; \
+		s!-Iext/libev!!; \
+		s!-I/usr/include/libeio!!; \
+		s!-leio!!; \
+		s!-Iext/libeio!!' \
+		${WRKSRC_PASSENGER}/build/common_library.rb
+
+post-patch-POSTGRES-on:
+	@${REINPLACE_CMD} 's!%%PREFIX%%!${LOCALBASE}!g' ${WRKSRC_postgres}/config
+
+post-patch-SFLOW-on:
+	@${REINPLACE_CMD} \
+		's!%%PREFIX%%!${LOCALBASE}!g' \
+		${WRKSRC_sflow}/ngx_http_sflow_config.h
+
+pre-configure-SMALL_LIGHT-on:
+	( cd ${WRKSRC_small_light} && ./setup )
+
+do-configure-NJS-on:
+	( cd ${WRKSRC_njs} && ${SETENV} ${CONFIGURE_ENV} ${CONFIGURE_CMD} ${NJS_CONFIGURE_ARGS} )
+
+.if !target(do-install)
+do-install:
+	${MKDIR} ${STAGEDIR}${ETCDIR}
+	${MKDIR} ${STAGEDIR}${NGINX_TMPDIR}
+	${MKDIR} ${STAGEDIR}${NGINX_LOGDIR}
+	${INSTALL_PROGRAM} ${WRKSRC}/objs/nginx ${STAGEDIR}${PREFIX}/sbin
+.for i in koi-utf koi-win win-utf
+	${INSTALL_DATA} ${WRKSRC}/conf/${i} ${STAGEDIR}${ETCDIR}
+.endfor
+.for i in fastcgi_params mime.types scgi_params uwsgi_params
+	${INSTALL_DATA} ${WRKSRC}/conf/${i} ${STAGEDIR}${ETCDIR}/${i}-dist
+.endfor
+
+do-install-HTTP_PERL-on:
+	${MKDIR} ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/auto/nginx
+	${INSTALL_PROGRAM} ${WRKSRC}/objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.so \
+		${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/auto/nginx
+	${INSTALL_DATA} ${WRKSRC}/objs/src/http/modules/perl/blib/lib/nginx.pm \
+		${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/
+
+# Install dynamic modules
+do-install-DSO-on:
+	${MKDIR} ${STAGEDIR}${MODULESDIR}
+	(cd ${WRKSRC}/objs/ && ${FIND} . -name '*.so' -maxdepth 1 -type f \
+		-exec ${INSTALL_PROGRAM} {} ${STAGEDIR}${MODULESDIR} \;)
+
+do-install-LINK-on:
+	${INSTALL_DATA} ${WRKSRC_link}/src/ngx_link_func_module.h ${STAGEDIR}${PREFIX}/include
+
+do-install-NAXSI-on:
+	${INSTALL_DATA} \
+	${WRKDIR}/naxsi-${NAXSI_NGINX_VER}/naxsi_rules/naxsi_core.rules \
+	${STAGEDIR}${ETCDIR}
+.endif
+
+.if !target(post-install)
+post-install:
+	${MKDIR} ${STAGEDIR}${PREFIX}/share/vim/vimfiles
+	cd ${WRKSRC}/contrib/vim && ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/share/vim/vimfiles
+	${INSTALL_MAN} ${WRKSRC}/objs/nginx.8 ${STAGEDIR}${PREFIX}/share/man/man8
+	${CAT} ${WRKSRC}/conf/nginx.conf >> ${STAGEDIR}${ETCDIR}/nginx.conf-dist
+
+post-install-WWW-on:
+	${MKDIR} ${STAGEDIR}${PREFIX}/www/nginx-dist
+	(cd ${WRKSRC}/html && ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/www/nginx-dist && \
+	${TOUCH} ${STAGEDIR}${PREFIX}/www/nginx-dist/EXAMPLE_DIRECTORY-DONT_ADD_OR_TOUCH_ANYTHING)
+.endif
+
+.include <bsd.port.post.mk>
diff --git a/www/freenginx-devel/Makefile.extmod b/www/freenginx-devel/Makefile.extmod
new file mode 100644
index 000000000000..5ef8e27b7226
--- /dev/null
+++ b/www/freenginx-devel/Makefile.extmod
@@ -0,0 +1,336 @@
+### External modules
+
+OPTIONS_GROUP+=	THIRDPARTYGRP
+# External modules (arrayvar MUST appear after devel_kit for build-dep)
+OPTIONS_GROUP_THIRDPARTYGRP=	AJP AWS_AUTH BROTLI CACHE_PURGE CT \
+	DEVEL_KIT ARRAYVAR DRIZZLE DYNAMIC_UPSTREAM ECHO ENCRYPTSESSION \
+	FIPS_CHECK FORMINPUT GRIDFS HEADERS_MORE HTTP_ACCEPT_LANGUAGE HTTP_AUTH_DIGEST \
+	HTTP_AUTH_KRB5 HTTP_AUTH_LDAP HTTP_AUTH_PAM HTTP_DAV_EXT HTTP_EVAL \
+	HTTP_FANCYINDEX HTTP_FOOTER HTTP_GEOIP2 HTTP_IP2LOCATION HTTP_IP2PROXY \
+	HTTP_JSON_STATUS HTTP_MOGILEFS HTTP_NOTICE HTTP_PUSH \
+	HTTP_PUSH_STREAM HTTP_REDIS HTTP_SLICE_AHEAD HTTP_SUBS_FILTER HTTP_TARANTOOL \
+	HTTP_UPLOAD HTTP_UPLOAD_PROGRESS HTTP_UPSTREAM_CHECK HTTP_UPSTREAM_FAIR \
+	HTTP_UPSTREAM_STICKY HTTP_VIDEO_THUMBEXTRACTOR HTTP_ZIP ICONV LET LINK LUA \
+	LUASTREAM MEMC MODSECURITY3 NAXSI PASSENGER POSTGRES RDS_CSV RDS_JSON \
+	REDIS2 RTMP SET_MISC SFLOW SHIBBOLETH SLOWFS_CACHE SRCACHE STS \
+	VOD VTS XSS WEBSOCKIFY ZSTD
+
+AJP_GH_TUPLE=		msva:nginx_ajp_module:fcbb2cc:ajp
+AJP_VARS=		DSO_EXTMODS+=ajp
+
+ARRAYVAR_IMPLIES=	DEVEL_KIT
+ARRAYVAR_GH_TUPLE=	openresty:array-var-nginx-module:v0.05:arrayvar
+ARRAYVAR_VARS=		DSO_EXTMODS+=arrayvar
+
+AWS_AUTH_GH_TUPLE=	anomalizer:ngx_aws_auth:21931b2:aws_auth
+AWS_AUTH_VARS=		DSO_EXTMODS+=aws_auth
+
+BROTLI_LIB_DEPENDS=	libbrotlicommon.so:archivers/brotli
+BROTLI_GH_TUPLE=	google:ngx_brotli:a71f931:brotli
+BROTLI_VARS=		DSO_EXTMODS+=brotli
+BROTLI_EXTRA_PATCHES=	${PATCHDIR}/extra-patch-ngx_brotli_filter_config
+
+CACHE_PURGE_GH_TUPLE=	nginx-modules:ngx_cache_purge:a84b0f3:cache_purge
+CACHE_PURGE_VARS=	DSO_EXTMODS+=cache_purge
+
+CT_IMPLIES=		HTTP_SSL
+CT_GH_TUPLE=		grahamedgecombe:nginx-ct:93e9884:ct
+CT_VARS=		DSO_EXTMODS+=ct
+CT_EXTRA_PATCHES=	${PATCHDIR}/extra-patch-nginx-ct-LibreSSL \
+			${PATCHDIR}/extra-patch-ngx_stream_ssl_ct_module.c
+
+ECHO_GH_TUPLE=		openresty:echo-nginx-module:5a402aa:echo
+ECHO_VARS=		DSO_EXTMODS+=echo
+
+DRIZZLE_LIB_DEPENDS=	libdrizzle.so:databases/libdrizzle
+DRIZZLE_CONFIGURE_ENV=	LIBDRIZZLE_INC=${LOCALBASE}/include \
+			LIBDRIZZLE_LIB=${LOCALBASE}/lib
+DRIZZLE_GH_TUPLE=	openresty:drizzle-nginx-module:3504fc6:drizzle
+DRIZZLE_EXTRA_PATCHES=	${PATCHDIR}/extra-patch-openresty-drizzle-nginx-module-config
+DRIZZLE_VARS=		DSO_EXTMODS+=drizzle
+
+DYNAMIC_UPSTREAM_IMPLIES=	STREAM
+DYNAMIC_UPSTREAM_GH_TUPLE=	ZigzagAK:ngx_dynamic_upstream:960eef2:dynamic_upstream
+DYNAMIC_UPSTREAM_VARS=		DSO_EXTMODS+=dynamic_upstream
+
+DEVEL_KIT_GH_TUPLE=		vision5:ngx_devel_kit:v0.3.3:devel_kit
+DEVEL_KIT_VARS=			FIRST_DSO_EXTMODS+=devel_kit
+
+ENCRYPTSESSION_IMPLIES=		DEVEL_KIT
+ENCRYPTSESSION_GH_TUPLE=	openresty:encrypted-session-nginx-module:v0.09:encryptsession
+ENCRYPTSESSION_VARS=		DSO_EXTMODS+=encryptsession
+
+FIPS_CHECK_GH_TUPLE=	ogarrett:nginx-fips-check-module:6cb4270:fipscheck
+FIPS_CHECK_VARS=	DSO_EXTMODS+=fipscheck
+
+FORMINPUT_IMPLIES=	DEVEL_KIT
+FORMINPUT_GH_TUPLE=	calio:form-input-nginx-module:v0.12:forminput
+FORMINPUT_VARS=		DSO_EXTMODS+=forminput
+
+GRIDFS_GH_TUPLE=	nieoding:nginx-gridfs:059bdc3:gridfs
+GRIDFS_LIB_DEPENDS=	libbson-1.0.so:devel/libbson \
+			libmongoc-1.0.so:devel/mongo-c-driver
+GRIDFS_VARS=		DSO_EXTMODS+=gridfs GRIDFS_SUBDIR=/nginx-gridfs
+
+HEADERS_MORE_GH_TUPLE=		openresty:headers-more-nginx-module:06dc0be:headers_more
+HEADERS_MORE_VARS=		DSO_EXTMODS+=headers_more
+
+HTTP_ACCEPT_LANGUAGE_GH_TUPLE=	dvershinin:nginx_accept_language_module:5683967:accept_language
+HTTP_ACCEPT_LANGUAGE_VARS=	DSO_EXTMODS+=accept_language
+
+HTTP_AUTH_DIGEST_GH_TUPLE=	atomx:nginx-http-auth-digest:274490c:auth_digest
+HTTP_AUTH_DIGEST_VARS=		DSO_EXTMODS+=auth_digest
+
+HTTP_AUTH_KRB5_GH_TUPLE=	stnoonan:spnego-http-auth-nginx-module:3575542:auth_krb5
+HTTP_AUTH_KRB5_VARS=		DSO_EXTMODS+=auth_krb5
+HTTP_AUTH_KRB5_EXTRA_PATCHES=	${PATCHDIR}/extra-patch-spnego-http-auth-nginx-module-config
+
+HTTP_AUTH_LDAP_GH_TUPLE=	kvspb:nginx-auth-ldap:83c059b:http_auth_ldap
+HTTP_AUTH_LDAP_EXTRA_PATCHES=	${PATCHDIR}/extra-patch-ngx_http_auth_ldap_module.c
+HTTP_AUTH_LDAP_VARS=		DSO_EXTMODS+=http_auth_ldap
+HTTP_AUTH_LDAP_USES=		ldap
+
+HTTP_AUTH_PAM_GH_TUPLE=		sto:ngx_http_auth_pam_module:v1.5.3:auth_pam
+HTTP_AUTH_PAM_VARS=		DSO_EXTMODS+=auth_pam
+
+HTTP_DAV_EXT_IMPLIES=		HTTP_DAV
+HTTP_DAV_EXT_LIB_DEPENDS=	libxml2.so:textproc/libxml2 \
+				libxslt.so:textproc/libxslt
+HTTP_DAV_EXT_GH_TUPLE=		arut:nginx-dav-ext-module:v3.0.0:dav_ext
+HTTP_DAV_EXT_VARS=		DSO_EXTMODS+=dav_ext
+HTTP_DAV_EXT_EXTRA_PATCHES=	${PATCHDIR}/extra-patch-ngx_http_dav_ext_module.c
+
+HTTP_EVAL_GH_TUPLE=		openresty:nginx-eval-module:582bd25:eval
+HTTP_EVAL_VARS=			DSO_EXTMODS+=eval
+
+HTTP_FANCYINDEX_GH_TUPLE=	aperezdc:ngx-fancyindex:v0.5.2:fancyindex
+HTTP_FANCYINDEX_VARS=		DSO_EXTMODS+=fancyindex
+
+HTTP_FOOTER_GH_TUPLE=		alibaba:nginx-http-footer-filter:1.2.2:footer
+HTTP_FOOTER_VARS=		DSO_EXTMODS+=footer
+HTTP_FOOTER_EXTRA_PATCHES=	${PATCHDIR}/extra-patch-nginx-http-footer-filter-config
+
+HTTP_GEOIP2_GH_TUPLE=		leev:ngx_http_geoip2_module:3.4:geoip2
+HTTP_GEOIP2_CFLAGS=		-I${LOCALBASE}/include
+HTTP_GEOIP2_VARS=		DSO_EXTMODS+=geoip2
+HTTP_GEOIP2_LIB_DEPENDS=	libmaxminddb.so:net/libmaxminddb
+
+HTTP_IP2LOCATION_GH_TUPLE=	ip2location:ip2location-nginx:2df35fb:ip2location
+HTTP_IP2LOCATION_LIB_DEPENDS=	libIP2Location.so:net/ip2location
+HTTP_IP2LOCATION_VARS=		DSO_EXTMODS+=ip2location
+
+HTTP_IP2PROXY_GH_TUPLE=		ip2location:ip2proxy-nginx:02ce447:ip2proxy
+HTTP_IP2PROXY_LIB_DEPENDS=	libIP2Proxy.so:net/ip2proxy
+HTTP_IP2PROXY_VARS=		DSO_EXTMODS+=ip2proxy
+
+HTTP_JSON_STATUS_GH_TUPLE=	nginx-modules:ngx_http_json_status_module:1d2f303:json_status
+HTTP_JSON_STATUS_VARS=		DSO_EXTMODS+=json_status
+HTTP_JSON_STATUS_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-ngx_http_json_status_module-config
+
+HTTP_MOGILEFS_MASTER_SITES=	http://www.grid.net.ru/nginx/download/:mogilefs
+HTTP_MOGILEFS_DISTFILES=	nginx_mogilefs_module-1.0.4.tar.gz:mogilefs
+HTTP_MOGILEFS_EXTRA_PATCHES=	${PATCHDIR}/extra-patch-ngx_http_mogilefs_module.c \
+				${PATCHDIR}/extra-patch-nginx_mogilefs_module-config
+HTTP_MOGILEFS_VARS=		DSO_EXTDIRS+=nginx_mogilefs_module-1.0.4
+
+HTTP_NOTICE_GH_TUPLE=		kr:nginx-notice:3c95966:notice
+HTTP_NOTICE_EXTRA_PATCHES=	${PATCHDIR}/extra-patch-ngx_http_notice_module.c \
+				${PATCHDIR}/extra-patch-nginx-notice-config
+HTTP_NOTICE_VARS=		DSO_EXTMODS+=notice
+
+HTTP_PUSH_GH_TUPLE=		slact:nchan:v1.3.6:push
+HTTP_PUSH_VARS=			DSO_EXTMODS+=push
+
+HTTP_PUSH_STREAM_GH_TUPLE=	wandenberg:nginx-push-stream-module:8c02220:pushstream
+HTTP_PUSH_STREAM_VARS=		DSO_EXTMODS+=pushstream
+
+HTTP_REDIS_MASTER_SITES=	LOCAL/osa:redis
+HTTP_REDIS_DISTFILES=		ngx_http_redis-0.3.9.tar.gz:redis
+HTTP_REDIS_VARS=		DSO_EXTDIRS+=ngx_http_redis-0.3.9
+HTTP_REDIS_EXTRA_PATCHES=	${PATCHDIR}/extra-patch-ngx_http_redis_module.c
+
+HTTP_SLICE_AHEAD_EXTRA_PATCHES=	${PATCHDIR}/extra-patch-src_http_modules_ngx_http_slice_read_ahead.c
+
+HTTP_SUBS_FILTER_GH_TUPLE=	yaoweibin:ngx_http_substitutions_filter_module:c6f825f:subs_filter
+HTTP_SUBS_FILTER_VARS=		DSO_EXTMODS+=subs_filter
+
+HTTP_TARANTOOL_LIB_DEPENDS=	libmsgpuck.so:devel/msgpuck \
+				libyajl.so:devel/yajl
+HTTP_TARANTOOL_GH_TUPLE=	tarantool:nginx_upstream_module:aeb8696:nginx_tarantool
+HTTP_TARANTOOL_VARS=		DSO_EXTMODS+=nginx_tarantool
+HTTP_TARANTOOL_EXTRA_PATCHES=	${PATCHDIR}/extra-patch-ngx_http_tarantool-config
+
+HTTP_UPLOAD_GH_TUPLE=		fdintino:nginx-upload-module:643b4c1:upload
+HTTP_UPLOAD_VARS=		DSO_EXTMODS+=upload
+
+HTTP_UPLOAD_PROGRESS_GH_TUPLE=		masterzen:nginx-upload-progress-module:68b3ab3:uploadprogress
+HTTP_UPLOAD_PROGRESS_VARS=		DSO_EXTMODS+=uploadprogress
+HTTP_UPLOAD_PROGRESS_EXTRA_PATCHES=	${PATCHDIR}/extra-patch-ngx_http_uploadprogress_module.c
+
+HTTP_UPSTREAM_CHECK_GH_TUPLE=		yaoweibin:nginx_upstream_check_module:9aecf15:upstreamcheck
+HTTP_UPSTREAM_CHECK_CONFIGURE_ON=	--add-module=${WRKSRC_upstreamcheck}
+HTTP_UPSTREAM_CHECK_EXTRA_PATCHES=	${PATCHDIR}/extra-patch-src-http-modules-ngx_http_upstream_hash_module.c \
+					${PATCHDIR}/extra-patch-src-http-modules-ngx_http_upstream_ip_hash_module.c \
+					${PATCHDIR}/extra-patch-src-http-modules-ngx_http_upstream_least_conn_module.c \
+					${PATCHDIR}/extra-patch-src-http-ngx_http_upstream_round_robin.c \
+					${PATCHDIR}/extra-patch-src-http-ngx_http_upstream_round_robin.h
+
+HTTP_UPSTREAM_FAIR_GH_TUPLE=		jaygooby:nginx-upstream-fair:10ecdcf:upstreamfair
+HTTP_UPSTREAM_FAIR_VARS=		DSO_EXTMODS+=upstreamfair
+
+HTTP_UPSTREAM_STICKY_IMPLIES=		HTTP_SSL
+HTTP_UPSTREAM_STICKY_GH_TUPLE=		dvershinin:nginx-sticky-module-ng:2753211:upstreamsticky
+HTTP_UPSTREAM_STICKY_VARS=		DSO_EXTMODS+=upstreamsticky
+
+HTTP_VIDEO_THUMBEXTRACTOR_LIB_DEPENDS=	libavformat.so:multimedia/ffmpeg \
+					libavcodec.so:multimedia/ffmpeg \
+					libavutil.so:multimedia/ffmpeg \
+					libswscale.so:multimedia/ffmpeg
+HTTP_VIDEO_THUMBEXTRACTOR_USES=		jpeg
+HTTP_VIDEO_THUMBEXTRACTOR_GH_TUPLE=	wandenberg:nginx-video-thumbextractor-module:e81f850:vte
+HTTP_VIDEO_THUMBEXTRACTOR_VARS=		DSO_EXTMODS+=vte
+HTTP_VIDEO_THUMBEXTRACTOR_EXTRA_PATCHES=${PATCHDIR}/extra-patch-nginx-thumbextractor-module-config
+
+HTTP_ZIP_GH_TUPLE=	vince2678:mod_zip:5b2604b:mod_zip
+HTTP_ZIP_VARS=		DSO_EXTMODS+=mod_zip
+
+ICONV_IMPLIES=		DEVEL_KIT
+ICONV_USES=		iconv
+ICONV_GH_TUPLE=		calio:iconv-nginx-module:v0.14:iconv
+ICONV_VARS=		DSO_EXTMODS+=iconv
+ICONV_EXTRA_PATCHES=	${PATCHDIR}/extra-patch-calio-iconv-nginx-module-config
+
+LET_GH_TUPLE=		baysao:nginx-let-module:c1f23aa:let
+LET_VARS=		DSO_EXTMODS+=let
+
+LUA_IMPLIES=		DEVEL_KIT
+LUA_LIB_DEPENDS=	libluajit-5.1.so:lang/luajit-openresty
+LUA_RUN_DEPENDS=	lua-resty-core>0:www/lua-resty-core
+LUA_CONFIGURE_ENV=	LUAJIT_INC=${LOCALBASE}/include/luajit-2.1 \
+			LUAJIT_LIB=${LOCALBASE}/lib
+LUA_GH_TUPLE=		openresty:lua-nginx-module:v0.10.26:lua
+LUA_VARS=		DSO_EXTMODS+=lua
+
+LUASTREAM_IMPLIES=	DEVEL_KIT
+LUASTREAM_LIB_DEPENDS=	libluajit-5.1.so:lang/luajit-openresty
+LUASTREAM_RUN_DEPENDS=	lua-resty-core>0:www/lua-resty-core
+LUASTREAM_CONFIGURE_ENV=LUAJIT_INC=${LOCALBASE}/include/luajit-2.1 \
+			LUAJIT_LIB=${LOCALBASE}/lib
+LUASTREAM_GH_TUPLE=	openresty:stream-lua-nginx-module:bea8a0c:luastream
+LUASTREAM_VARS=		DSO_EXTMODS+=luastream
+LUASTREAM_EXTRA_PATCHES=${PATCHDIR}/extra-patch-stream-lua-nginx-module_config
+
+LINK_GH_TUPLE=		Taymindis:nginx-link-function:3.2.4:link
+LINK_EXTRA_PATCHES=	${PATCHDIR}/extra-patch-nginx-link-function-config \
+			${PATCHDIR}/extra-patch-ngx_link_func_module.c
+LINK_VARS=		DSO_EXTMODS+=link
+
+MEMC_GH_TUPLE=		openresty:memc-nginx-module:v0.19:memc
+MEMC_VARS=		DSO_EXTMODS+=memc
+
+MODSECURITY3_IMPLIES=		HTTP_ADDITION HTTP_IMAGE_FILTER HTTP_GUNZIP_FILTER HTTP_XSLT
+MODSECURITY3_LIB_DEPENDS=	libmodsecurity.so:security/modsecurity3
+MODSECURITY3_GH_TUPLE=		SpiderLabs:ModSecurity-nginx:v1.0.3:modsecurity3
+MODSECURITY3_VARS=		DSO_EXTMODS+=modsecurity3
+
+NAXSI_NGINX_VER=	1.6
+NAXSI_GH_TUPLE=		wargio:naxsi:${NAXSI_NGINX_VER}:naxsi \
+			libinjection:libinjection:4aa3894:libinjection
+NAXSI_VARS=		DSO_EXTMODS+=naxsi NAXSI_SUBDIR=/naxsi_src
+NAXSI_EXTRA_PATCHES=	${PATCHDIR}/extra-patch-naxsi-libinjection__sqli_c \
+			${PATCHDIR}/extra-patch-naxsi_config
+
+NJS_GH_TUPLE=		nginx:njs:0.8.4:njs
+NJS_VARS=		DSO_EXTMODS+=njs NJS_SUBDIR=/nginx
+NJS_IMPLIES=		STREAM
+
+NJS_XML_IMPLIES=	HTTP NJS
+NJS_XML_LIB_DEPENDS=	libxml2.so:textproc/libxml2 \
+			libxslt.so:textproc/libxslt
+
+OTEL_GH_TUPLE=		osokin:nginx-otel:8f0857d:otel
+OTEL_VARS=		DSO_EXTMODS+=otel OTEL_SUBDIR=/
+OTEL_LIB_DEPENDS=	libabsl_base.so:devel/abseil \
+			libcares.so:dns/c-ares \
+			libgrpc.so:devel/grpc \
+			libopentelemetry_common.so:devel/opentelemetry-cpp \
+			libprotobuf.so:devel/protobuf \
+			libre2.so:devel/re2
+OTEL_BUILD_DEPENDS=	${LOCALBASE}/include/opentelemetry/proto/common/v1/common.proto:devel/opentelemetry-proto
+OTEL_CONFIGURE_ENV+=	NGX_OTEL_PROTO_DIR=${PREFIX}/include
+
+PASSENGER_NGINX_VER=	6.0.22
+PASSENGER_CATEGORIES=	ruby
+PASSENGER_USES=		ruby
+PASSENGER_BUILD_DEPENDS=${LOCALBASE}/bin/rake:devel/rubygem-rake
+PASSENGER_RAKE_BIN=	${LOCALBASE}/bin/rake
+PASSENGER_MASTER_SITES=	https://s3.amazonaws.com/phusion-passenger/releases/:passenger
+PASSENGER_DISTFILES=	passenger-${PASSENGER_NGINX_VER}.tar.gz:passenger
+PASSENGER_VARS=		WRKSRC_passenger=${WRKDIR}/passenger-${PASSENGER_NGINX_VER} \
+			DSO_EXTDIRS+=passenger-${PASSENGER_NGINX_VER}/src/nginx_module
+PASSENGER_EXTRA_PATCHES=${PATCHDIR}/extra-patch-passenger-build-nginx.rb \
+			${PATCHDIR}/extra-patch-passenger-disable-telemetry \
+			${PATCHDIR}/extra-patch-passenger_src_nginx__module_Configuration.c
+
+POSTGRES_USES=		pgsql
+POSTGRES_GH_TUPLE=	konstruxi:ngx_postgres:8aa7359:postgres
+POSTGRES_EXTRA_PATCHES=	${PATCHDIR}/extra-patch-ngx_postgres-config
+POSTGRES_VARS=		DSO_EXTMODS+=postgres
+
+RDS_CSV_GH_TUPLE=	openresty:rds-csv-nginx-module:v0.09:rdscsv
+RDS_CSV_EXTRA_PATCHES=	${PATCHDIR}/extra-patch-rds-csv-nginx-module-config
+RDS_CSV_VARS=		DSO_EXTMODS+=rdscsv
+
+RDS_JSON_GH_TUPLE=	openresty:rds-json-nginx-module:v0.15:rdsjson
+RDS_JSON_EXTRA_PATCHES=	${PATCHDIR}/extra-patch-rds-json-nginx-module-config
+RDS_JSON_VARS=		DSO_EXTMODS+=rdsjson
+
+REDIS2_GH_TUPLE=	openresty:redis2-nginx-module:v0.15:redis2
+REDIS2_VARS=		DSO_EXTMODS+=redis2
+
+RTMP_GH_TUPLE=		arut:nginx-rtmp-module:v1.2.2:rtmp
+RTMP_VARS=		DSO_EXTMODS+=rtmp
+
+SET_MISC_IMPLIES=	DEVEL_KIT
+SET_MISC_GH_TUPLE=	openresty:set-misc-nginx-module:3937e7b:setmisc
+SET_MISC_VARS=		DSO_EXTMODS+=setmisc
+
+SFLOW_GH_TUPLE=		sflow:nginx-sflow-module:543c72a:sflow
+SFLOW_EXTRA_PATCHES=	${PATCHDIR}/extra-patch-ngx_http_sflow_config.c \
+			${PATCHDIR}/extra-patch-ngx_http_sflow_config.h \
+			${PATCHDIR}/extra-patch-ngx_http_sflow_module.c
+
+SHIBBOLETH_GH_TUPLE=	nginx-shib:nginx-http-shibboleth:be12df5:shibboleth
+SHIBBOLETH_VARS=	DSO_EXTMODS+=shibboleth
+
+SLOWFS_CACHE_GH_TUPLE=	baysao:ngx_slowfs_cache:d011a18:slowfs_cache
+SLOWFS_CACHE_VARS=	DSO_EXTMODS+=slowfs_cache
+
+SRCACHE_GH_TUPLE=	openresty:srcache-nginx-module:be22ac0:srcache
+SRCACHE_VARS=		DSO_EXTMODS+=srcache
+
+STS_IMPLIES=		STREAM
+STS_GH_TUPLE=		vozlt:nginx-module-sts:3c10d42:sts
+STS_VARS=		DSO_EXTMODS+=sts
+
+VOD_GH_TUPLE=		kaltura:nginx-vod-module:1.31:vod
+VOD_LIB_DEPENDS=	libxml2.so:textproc/libxml2 \
+			libavutil.so:multimedia/ffmpeg
+VOD_USES=		iconv
+VOD_VARS=		DSO_EXTMODS+=vod
+
+VTS_GH_TUPLE=		vozlt:nginx-module-vts:bf64dbf:vts
+VTS_VARS=		DSO_EXTMODS+=vts
+
+XSS_GH_TUPLE=		openresty:xss-nginx-module:v0.06:xss
+XSS_VARS=		DSO_EXTMODS+=xss
+XSS_EXTRA_PATCHES=	${PATCHDIR}/extra-patch-xss-nginx-module-config
+
+WEBSOCKIFY_GH_TUPLE=	tg123:websockify-nginx-module:c11bc9a:websockify
+WEBSOCKIFY_VARS=	DSO_EXTMODS+=websockify
+
+ZSTD_LIB_DEPENDS=	libzstd.so:archivers/zstd
+ZSTD_CONFIGURE_ENV=	ZSTD_INC=${LOCALBASE}/include \
+			ZSTD_LIB=${LOCALBASE}/lib
+ZSTD_GH_TUPLE=		tokers:zstd-nginx-module:f4ba115:zstd
+ZSTD_VARS=		DSO_EXTMODS+=zstd
diff --git a/www/freenginx-devel/Makefile.options.desc b/www/freenginx-devel/Makefile.options.desc
new file mode 100644
index 000000000000..f2b3924b69f8
--- /dev/null
+++ b/www/freenginx-devel/Makefile.options.desc
@@ -0,0 +1,118 @@
+AJP_DESC=			3rd party ajp module
+ARRAYVAR_DESC=			3rd party array_var module
+AWS_AUTH_DESC=			3rd party aws auth module
+BROTLI_DESC=			3rd party brotli module
+CACHE_PURGE_DESC=		3rd party cache_purge module
+CT_DESC=			3rd party cert_transparency module (SSL req.)
+DEBUGLOG_DESC=			Enable debug log (--with-debug)
+DEVEL_KIT_DESC=			3rd party Nginx Development Kit module
+DRIZZLE_DESC=			3rd party drizzle module
+DSO_DESC=			Enable dynamic modules support
+DYNAMIC_UPSTREAM_DESC=		3rd party dynamic_upstream module
+ECHO_DESC=			3rd party echo module
+ENCRYPTSESSION_DESC=		3rd party encrypted_session module
+FILE_AIO_DESC=			Enable file aio
+FIPS_CHECK_DESC=		3rd party fips_check module
+FORMINPUT_DESC=			3rd party form_input module
+GOOGLE_PERFTOOLS_DESC=		Enable google perftools module
+GRIDFS_DESC=			3rd party gridfs module
+GSSAPI_DESC=			GSSAPI implementation (imply HTTP_AUTH_KRB5)
+HEADERS_MORE_DESC=		3rd party headers_more module
+HTTPGRP_DESC=			Modules that require HTTP module
+HTTPV2_DESC=			Enable HTTP/2 protocol support (SSL req.)
+HTTPV3_DESC=			Enable HTTP/3 protocol support
+HTTPV3_BORING_DESC=		Use security/boringssl
+HTTPV3_LSSL_DESC=		Use security/libressl-devel
+HTTPV3_QTLS_DESC=		Use security/openssl-quictls
+HTTP_ACCEPT_LANGUAGE_DESC=	3rd party accept_language module
+HTTP_ADDITION_DESC=		Enable http_addition module
+HTTP_AUTH_DIGEST_DESC=		3rd party http_authdigest module
+HTTP_AUTH_KRB5_DESC=		3rd party http_auth_gss module
+HTTP_AUTH_LDAP_DESC=		3rd party http_auth_ldap module
+HTTP_AUTH_PAM_DESC=		3rd party http_auth_pam module
+HTTP_AUTH_REQ_DESC=		Enable http_auth_request module
+HTTP_CACHE_DESC=		Enable http_cache module
+HTTP_DAV_DESC=			Enable http_webdav module
+HTTP_DAV_EXT_DESC=		3rd party webdav_ext module
+HTTP_DEGRADATION_DESC=		Enable http_degradation module
+HTTP_DESC=			Enable HTTP module
+HTTP_EVAL_DESC=			3rd party eval module
+HTTP_FANCYINDEX_DESC=		3rd party http_fancyindex module
+HTTP_FLV_DESC=			Enable http_flv module
+HTTP_FOOTER_DESC=		3rd party http_footer module
+HTTP_GEOIP2_DESC=		3rd party geoip2 module
+HTTP_GUNZIP_FILTER_DESC=	Enable http_gunzip_filter module
+HTTP_GZIP_STATIC_DESC=		Enable http_gzip_static module
+HTTP_IMAGE_FILTER_DESC=		Enable http_image_filter module
+HTTP_IP2LOCATION_DESC=		3rd party ip2location-nginx module
+HTTP_IP2PROXY_DESC=		3rd party ip2proxy-nginx module
+HTTP_JSON_STATUS_DESC=		3rd party http_json_status module
+HTTP_MOGILEFS_DESC=		3rd party mogilefs module
+HTTP_MP4_DESC=			Enable http_mp4 module
+HTTP_NOTICE_DESC=		3rd party notice module
+HTTP_PERL_DESC=			Enable http_perl module
+HTTP_PUSH_DESC=			3rd party push module
+HTTP_PUSH_STREAM_DESC=		3rd party push stream module
+HTTP_RANDOM_INDEX_DESC=		Enable http_random_index module
+HTTP_REALIP_DESC=		Enable http_realip module
+HTTP_REDIS_DESC=		3rd party http_redis module
+HTTP_SECURE_LINK_DESC=		Enable http_secure_link module
+HTTP_SLICE_DESC=		Enable http_slice module
+HTTP_SLICE_AHEAD_DESC=		3rd party http_slice_ahead module
+HTTP_SSL_DESC=			Enable http_ssl module
+HTTP_STATUS_DESC=		Enable http_stub_status module
+HTTP_SUBS_FILTER_DESC=		3rd party subs filter module
+HTTP_SUB_DESC=			Enable http_sub module
+HTTP_TARANTOOL_DESC=		3rd party tarantool upstream module
+HTTP_UPLOAD_DESC=		3rd party upload module
+HTTP_UPLOAD_PROGRESS_DESC=	3rd party uploadprogress module
+HTTP_UPSTREAM_CHECK_DESC=	3rd party upstream check module
+HTTP_UPSTREAM_FAIR_DESC=	3rd party upstream fair module
+HTTP_UPSTREAM_STICKY_DESC=	3rd party upstream sticky module
+HTTP_VIDEO_DESC=		3rd party video module support
+HTTP_VIDEO_THUMBEXTRACTOR_DESC=	3rd party video_thumbextractor module
+HTTP_XSLT_DESC=			Enable http_xslt module
+HTTP_ZIP_DESC=			3rd party http_zip module
+ICONV_DESC=			3rd party iconv module
+IPV6_DESC=			Enable IPv6 support
+LET_DESC=			3rd party let module
+LINK_DESC=			3rd party link function module
+LUA_DESC=			3rd party lua module
+LUASTREAM_DESC=			3rd party lua stream module
+MAILGRP_DESC=			Modules that require MAIL module
+MAIL_DESC=			Enable IMAP4/POP3/SMTP proxy module
+MAIL_IMAP_DESC=			Enable IMAP4 proxy module
+MAIL_POP3_DESC=			Enable POP3 proxy module
+MAIL_SMTP_DESC=			Enable SMTP proxy module
+MAIL_SSL_DESC=			Enable mail_ssl module
+MEMC_DESC=			3rd party memc (memcached) module
+MODSECURITY3_DESC=		3rd party modsecurity3 module
+NAXSI_DESC=			3rd party naxsi module
+NJS_DESC=			Enable javascript (NJS) module
+NJS_XML_DESC=			Enable XML functionality in NJS module
+OTEL_DESC=			Enable OpenTELemetry module
+PASSENGER_DESC=			3rd party passenger module
+POSTGRES_DESC=			3rd party postgres module
+RDS_CSV_DESC=			3rd party rds_csv module
+RDS_JSON_DESC=			3rd party rds_json module
+REDIS2_DESC=			3rd party redis2 module
+RTMP_DESC=			3rd party rtmp module
+SET_MISC_DESC=			3rd party set_misc module
+SFLOW_DESC=			3rd party sflow module
+SHIBBOLETH_DESC=		3rd party shibboleth module
+SLOWFS_CACHE_DESC=		3rd party slowfs_cache module
+SRCACHE_DESC=			3rd party srcache module
+STREAMGRP_DESC=			Modules that require STREAM 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.)
+STS_DESC=			3rd party sts module
+THREADS_DESC=			Enable threads support
+THIRDPARTYGRP_DESC=		Third-party modules
+VOD_DESC=			3rd party vod module
+VTS_DESC=			3rd party vts module
+WWW_DESC=			Enable html sample files
+XSS_DESC=			3rd party xss module
+WEBSOCKIFY_DESC=		3rd party websockify module
+ZSTD_DESC=			3rd party zstd module
diff --git a/www/freenginx-devel/distinfo b/www/freenginx-devel/distinfo
new file mode 100644
index 000000000000..88aca04f7723
--- /dev/null
+++ b/www/freenginx-devel/distinfo
@@ -0,0 +1,5 @@
+TIMESTAMP = 1718897832
+SHA256 (freenginx-1.27.1.tar.gz) = 9570603b19f29566261bbbca67cc01343987de03a2ea7354fcbdef94f0eda439
+SIZE (freenginx-1.27.1.tar.gz) = 1223681
+SHA256 (stnoonan-spnego-http-auth-nginx-module-3575542_GH0.tar.gz) = 6d710f97bef58b2d5dc54445c0e48103786425f6d4ab18cf30a2168904d0ba62
+SIZE (stnoonan-spnego-http-auth-nginx-module-3575542_GH0.tar.gz) = 24680
diff --git a/www/freenginx-devel/files/extra-patch-calio-iconv-nginx-module-config b/www/freenginx-devel/files/extra-patch-calio-iconv-nginx-module-config
new file mode 100644
index 000000000000..fe9b12dc7747
--- /dev/null
+++ b/www/freenginx-devel/files/extra-patch-calio-iconv-nginx-module-config
@@ -0,0 +1,19 @@
+--- ../iconv-nginx-module-0.14/config.orig	2013-04-16 17:57:17.000000000 -0700
++++ ../iconv-nginx-module-0.14/config	2013-05-01 17:16:28.134624745 -0700
+@@ -39,12 +39,12 @@
+     fi
+ 
+     if [ $ngx_found = no ]; then
+-        ngx_feature="libiconv in /usr/local/"
+-        ngx_feature_path="/usr/local/include"
++        ngx_feature="libiconv in %%PREFIX%%/"
++        ngx_feature_path="%%PREFIX%%/include"
+         if [ $NGX_RPATH = YES ]; then
+-            ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -liconv"
++            ngx_feature_libs="-R%%PREFIX%%/lib -L%%PREFIX%%/lib -liconv"
+         else
+-            ngx_feature_libs="-L/usr/local/lib -liconv"
++            ngx_feature_libs="-L%%PREFIX%%/lib -liconv"
+         fi
+         . auto/feature
+     fi
diff --git a/www/freenginx-devel/files/extra-patch-naxsi-libinjection__sqli_c b/www/freenginx-devel/files/extra-patch-naxsi-libinjection__sqli_c
new file mode 100644
index 000000000000..bdd074b620dd
--- /dev/null
+++ b/www/freenginx-devel/files/extra-patch-naxsi-libinjection__sqli_c
@@ -0,0 +1,13 @@
+--- ../libinjection-4aa3894/src/libinjection_sqli.c.orig	2023-05-30 15:47:57.333208000 -0400
++++ ../libinjection-4aa3894/src/libinjection_sqli.c	2023-05-30 15:49:52.273873000 -0400
+@@ -305,8 +303,8 @@
+ static void st_assign(stoken_t * st, const char stype,
+                       size_t pos, size_t len, const char* value)
+ {
+-    const size_t MSIZE = LIBINJECTION_SQLI_TOKEN_SIZE;
+-    size_t last = len < MSIZE ? len : (MSIZE - 1);
++    const size_t NAXSI_MSIZE = LIBINJECTION_SQLI_TOKEN_SIZE;
++    size_t last = len < NAXSI_MSIZE ? len : (NAXSI_MSIZE - 1);
*** 1977 LINES SKIPPED ***