git: 7a85e78bd1a8 - main - www/nginx-module-auth-krb5: Add New Port

From: Jochen Neumeister <joneum_at_FreeBSD.org>
Date: Tue, 10 Nov 2026 11:24:11 UTC
The branch main has been updated by joneum:

URL: https://cgit.FreeBSD.org/ports/commit/?id=7a85e78bd1a8725778462018210eb2e038008572

commit 7a85e78bd1a8725778462018210eb2e038008572
Author:     Jochen Neumeister <joneum@FreeBSD.org>
AuthorDate: 2026-11-10 11:23:38 +0000
Commit:     Jochen Neumeister <joneum@FreeBSD.org>
CommitDate: 2026-11-10 11:23:58 +0000

    www/nginx-module-auth-krb5: Add New Port
    
    Sources of the auth_krb5 module, which authenticates HTTP clients with
    SPNEGO/GSSAPI (Kerberos), so a browser that already holds a valid ticket is
    logged in without a password prompt.  The nginx ports build
    ngx_http_auth_spnego_module.so from here when their HTTP_AUTH_KRB5 option is
    enabled.
    
    www: https://github.com/stnoonan/spnego-http-auth-nginx-module
    
    Sponsored by:   Netzkommune GmbH
---
 www/Makefile                                    |  1 +
 www/nginx-module-auth-krb5/Makefile             | 34 +++++++++++++++++++++++++
 www/nginx-module-auth-krb5/distinfo             |  3 +++
 www/nginx-module-auth-krb5/files/patch-config   | 14 ++++++++++
 www/nginx-module-auth-krb5/files/pkg-message.in | 14 ++++++++++
 www/nginx-module-auth-krb5/pkg-descr            | 10 ++++++++
 6 files changed, 76 insertions(+)

diff --git a/www/Makefile b/www/Makefile
index 18a77ba902d2..d0553d325903 100644
--- a/www/Makefile
+++ b/www/Makefile
@@ -543,6 +543,7 @@
     SUBDIR += nginx-module-ajp
     SUBDIR += nginx-module-array-var
     SUBDIR += nginx-module-auth-digest
+    SUBDIR += nginx-module-auth-krb5
     SUBDIR += nginx-module-auth-ldap
     SUBDIR += nginx-module-auth-pam
     SUBDIR += nginx-module-aws-auth
diff --git a/www/nginx-module-auth-krb5/Makefile b/www/nginx-module-auth-krb5/Makefile
new file mode 100644
index 000000000000..bc666285525b
--- /dev/null
+++ b/www/nginx-module-auth-krb5/Makefile
@@ -0,0 +1,34 @@
+PORTNAME=	nginx-module-auth-krb5
+DISTVERSIONPREFIX=	v
+DISTVERSION=	1.1.3
+CATEGORIES=	www
+
+MAINTAINER=	joneum@FreeBSD.org
+COMMENT=	Sources of the auth_krb5 module for the NGINX ports
+WWW=		https://github.com/stnoonan/spnego-http-auth-nginx-module
+
+LICENSE=	BSD2CLAUSE
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	stnoonan
+GH_PROJECT=	spnego-http-auth-nginx-module
+
+NO_ARCH=	yes
+NO_BUILD=	yes
+
+SUB_FILES=	pkg-message
+
+_MODDIR=	share/nginx/modules/${PORTNAME}
+MODULESDIR=	${PREFIX}/${_MODDIR}
+
+PLIST_FILES=	${_MODDIR}/config \
+		${_MODDIR}/ngx_http_auth_spnego_module.c
+
+do-install:
+	@${MKDIR} ${STAGEDIR}${MODULESDIR}
+	${INSTALL_DATA} ${WRKSRC}/config \
+		${WRKSRC}/ngx_http_auth_spnego_module.c \
+		${STAGEDIR}${MODULESDIR}
+
+.include <bsd.port.mk>
diff --git a/www/nginx-module-auth-krb5/distinfo b/www/nginx-module-auth-krb5/distinfo
new file mode 100644
index 000000000000..ee736e0ac851
--- /dev/null
+++ b/www/nginx-module-auth-krb5/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1794303783
+SHA256 (stnoonan-spnego-http-auth-nginx-module-v1.1.3_GH0.tar.gz) = 0e1e54f8ab7d76f922881f13d870edf8b820ef645b19013774c825110d011640
+SIZE (stnoonan-spnego-http-auth-nginx-module-v1.1.3_GH0.tar.gz) = 32975
diff --git a/www/nginx-module-auth-krb5/files/patch-config b/www/nginx-module-auth-krb5/files/patch-config
new file mode 100644
index 000000000000..288fd18324ea
--- /dev/null
+++ b/www/nginx-module-auth-krb5/files/patch-config
@@ -0,0 +1,14 @@
+--- config.orig	2026-11-10 00:00:00 UTC
++++ config
+@@ -1,8 +1,9 @@
+ ngx_addon_name=ngx_http_auth_spnego_module
+-ngx_feature_libs="-lgssapi_krb5 -lkrb5 -lcom_err"
++ngx_feature_libs="-L%%GSSAPILIBDIR%% %%GSSAPILIBS%%"
++ngx_module_incs="%%GSSAPIINCDIR%%"
+
+ if uname -o | grep -q FreeBSD; then
+-    ngx_feature_libs="$ngx_feature_libs -lgssapi"
++    ngx_feature_libs="$ngx_feature_libs"
+ fi
+
+ if uname -a | grep -q NetBSD; then
diff --git a/www/nginx-module-auth-krb5/files/pkg-message.in b/www/nginx-module-auth-krb5/files/pkg-message.in
new file mode 100644
index 000000000000..1ed5e510389e
--- /dev/null
+++ b/www/nginx-module-auth-krb5/files/pkg-message.in
@@ -0,0 +1,14 @@
+[
+{ type: install
+  message: <<EOM
+This package contains the sources of the auth_krb5 module only.  It does not
+install a loadable module.
+
+The module itself is built by the nginx ports.  To use auth_krb5, build
+www/nginx, www/nginx-devel or www/freenginx with the HTTP_AUTH_KRB5 option
+enabled.  Those ports pick the sources up from
+%%PREFIX%%/share/nginx/modules/nginx-module-auth-krb5 and produce
+ngx_http_auth_spnego_module.so.
+EOM
+}
+]
diff --git a/www/nginx-module-auth-krb5/pkg-descr b/www/nginx-module-auth-krb5/pkg-descr
new file mode 100644
index 000000000000..8159eec006c4
--- /dev/null
+++ b/www/nginx-module-auth-krb5/pkg-descr
@@ -0,0 +1,10 @@
+Sources of the auth_krb5 module for the NGINX ports.
+
+This port installs the sources only.  It does not build a loadable module by
+itself; www/nginx, www/nginx-devel and www/freenginx pick the sources up and
+build ngx_http_auth_spnego_module.so when their HTTP_AUTH_KRB5 option is
+enabled.
+
+The module authenticates HTTP clients with SPNEGO/GSSAPI (Kerberos), so a
+browser that already holds a valid ticket is logged in without a password
+prompt.