git: b5e6d9cad413 - main - www/nginx-module-zstd: Add New Port

From: Jochen Neumeister <joneum_at_FreeBSD.org>
Date: Sat, 10 Oct 2026 18:02:47 UTC
The branch main has been updated by joneum:

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

commit b5e6d9cad413830f3ae4a1145c8eb2c15ffa0632
Author:     Jochen Neumeister <joneum@FreeBSD.org>
AuthorDate: 2026-10-10 18:00:21 +0000
Commit:     Jochen Neumeister <joneum@FreeBSD.org>
CommitDate: 2026-10-10 18:02:33 +0000

    www/nginx-module-zstd: Add New Port
    
    Sources of the zstd modules for the NGINX ports.  The filter module
    compresses responses on the fly for clients that announce zstd in
    Accept-Encoding, the static module serves a pre-compressed .zst file
    from disk when one sits beside the requested file.
    
    Sponsored by:   Netzkommune GmbH
---
 www/Makefile                               |  1 +
 www/nginx-module-zstd/Makefile             | 41 ++++++++++++++++++++++++++++++
 www/nginx-module-zstd/distinfo             |  3 +++
 www/nginx-module-zstd/files/pkg-message.in | 15 +++++++++++
 www/nginx-module-zstd/pkg-descr            |  8 ++++++
 5 files changed, 68 insertions(+)

diff --git a/www/Makefile b/www/Makefile
index 44f879ebfff1..c5b207da9a42 100644
--- a/www/Makefile
+++ b/www/Makefile
@@ -546,6 +546,7 @@
     SUBDIR += nginx-module-slowfs-cache
     SUBDIR += nginx-module-vod
     SUBDIR += nginx-module-websockify
+    SUBDIR += nginx-module-zstd
     SUBDIR += nginx-naxsi
     SUBDIR += nginx-prometheus-exporter
     SUBDIR += nginx-ultimate-bad-bot-blocker
diff --git a/www/nginx-module-zstd/Makefile b/www/nginx-module-zstd/Makefile
new file mode 100644
index 000000000000..57871144638e
--- /dev/null
+++ b/www/nginx-module-zstd/Makefile
@@ -0,0 +1,41 @@
+PORTNAME=	nginx-module-zstd
+DISTVERSION=	0.1.3
+CATEGORIES=	www
+
+MAINTAINER=	joneum@FreeBSD.org
+COMMENT=	Sources of the zstd modules for the NGINX ports
+WWW=		https://github.com/sysadmin-labs/nginx-zstd-module
+
+LICENSE=	BSD2CLAUSE
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	sysadmin-labs
+GH_PROJECT=	nginx-zstd-module
+
+NO_ARCH=	yes
+NO_BUILD=	yes
+
+SUB_FILES=	pkg-message
+
+_MODDIR=	share/nginx/modules/${PORTNAME}
+MODULESDIR=	${PREFIX}/${_MODDIR}
+
+PLIST_FILES=	${_MODDIR}/config \
+		${_MODDIR}/filter/config \
+		${_MODDIR}/src/ngx_http_zstd_filter_module.c \
+		${_MODDIR}/src/ngx_http_zstd_static_module.c \
+		${_MODDIR}/static/config
+
+do-install:
+	@${MKDIR} ${STAGEDIR}${MODULESDIR}/filter \
+		${STAGEDIR}${MODULESDIR}/src \
+		${STAGEDIR}${MODULESDIR}/static
+	${INSTALL_DATA} ${WRKSRC}/config ${STAGEDIR}${MODULESDIR}
+	${INSTALL_DATA} ${WRKSRC}/filter/config ${STAGEDIR}${MODULESDIR}/filter
+	${INSTALL_DATA} ${WRKSRC}/static/config ${STAGEDIR}${MODULESDIR}/static
+	${INSTALL_DATA} ${WRKSRC}/src/ngx_http_zstd_filter_module.c \
+		${WRKSRC}/src/ngx_http_zstd_static_module.c \
+		${STAGEDIR}${MODULESDIR}/src
+
+.include <bsd.port.mk>
diff --git a/www/nginx-module-zstd/distinfo b/www/nginx-module-zstd/distinfo
new file mode 100644
index 000000000000..0e01e324135f
--- /dev/null
+++ b/www/nginx-module-zstd/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1791650839
+SHA256 (sysadmin-labs-nginx-zstd-module-0.1.3_GH0.tar.gz) = 9d379dfd10b2d12966930f6f254565ae2cef756a66fd3e0c17b73274827452fa
+SIZE (sysadmin-labs-nginx-zstd-module-0.1.3_GH0.tar.gz) = 75854
diff --git a/www/nginx-module-zstd/files/pkg-message.in b/www/nginx-module-zstd/files/pkg-message.in
new file mode 100644
index 000000000000..190a8703a4e3
--- /dev/null
+++ b/www/nginx-module-zstd/files/pkg-message.in
@@ -0,0 +1,15 @@
+[
+{ type: install
+  message: <<EOM
+This package contains the sources of the zstd modules only.  It does
+not install loadable modules.
+
+The modules themselves are built by the nginx ports.  To use zstd,
+build www/nginx, www/nginx-devel or www/freenginx with the ZSTD
+option enabled.  Those ports pick the sources up from
+%%PREFIX%%/share/nginx/modules/nginx-module-zstd and produce
+ngx_http_zstd_filter_module.so and
+ngx_http_zstd_static_module.so.
+EOM
+}
+]
diff --git a/www/nginx-module-zstd/pkg-descr b/www/nginx-module-zstd/pkg-descr
new file mode 100644
index 000000000000..95583afa3309
--- /dev/null
+++ b/www/nginx-module-zstd/pkg-descr
@@ -0,0 +1,8 @@
+Two modules for ZStandard compression.  The filter module compresses
+responses on the fly for clients that announce zstd in Accept-Encoding,
+the way the gzip filter does.  The static module serves a pre-compressed
+.zst file from disk when one sits beside the requested file, and never
+calls into libzstd at all.
+
+This port only installs the module sources.  The modules themselves are
+built by the nginx ports when their ZSTD option is enabled.