git: 41d2ade1eb63 - main - www/angie-module-brotli: Angie Brotli dynamic module

From: Robert Clausecker <fuz_at_FreeBSD.org>
Date: Wed, 09 Aug 2023 13:04:33 UTC
The branch main has been updated by fuz:

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

commit 41d2ade1eb634232d92ab60d4c5e0904ddced9db
Author:     Oleg A. Mamontov <oleg@mamontov.net>
AuthorDate: 2023-08-07 18:24:32 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2023-08-09 13:01:15 +0000

    www/angie-module-brotli: Angie Brotli dynamic module
    
    Module adds Brotli compression support to Angie.
    Brotli is a generic-purpose lossless compression algorithm that compresses
    data using a combination of a modern variant of the LZ77 algorithm, Huffman
    coding and 2nd order context modeling, with a compression ratio comparable
    to the best currently available general-purpose compression methods.
    
    It is similar in speed with deflate but offers more dense compression.
    
    PR:             272999
---
 www/Makefile                                 |  1 +
 www/angie-module-brotli/Makefile             | 28 ++++++++++++++++++++++++++++
 www/angie-module-brotli/files/pkg-message.in | 17 +++++++++++++++++
 www/angie-module-brotli/pkg-descr            |  5 +++++
 www/angie-module-brotli/pkg-plist            |  6 ++++++
 5 files changed, 57 insertions(+)

diff --git a/www/Makefile b/www/Makefile
index a419f6d8811c..1c8c6400140a 100644
--- a/www/Makefile
+++ b/www/Makefile
@@ -28,6 +28,7 @@
     SUBDIR += analog
     SUBDIR += angie
     SUBDIR += angie-module-auth-jwt
+    SUBDIR += angie-module-brotli
     SUBDIR += angie-module-geoip2
     SUBDIR += anyremote2html
     SUBDIR += apache-mode.el
diff --git a/www/angie-module-brotli/Makefile b/www/angie-module-brotli/Makefile
new file mode 100644
index 000000000000..2ec4cb655895
--- /dev/null
+++ b/www/angie-module-brotli/Makefile
@@ -0,0 +1,28 @@
+PORTNAME=	angie-module-brotli
+GH_TUPLE=	google:ngx_brotli:v1.0.0rc:module
+
+COMMENT=	Angie Brotli dynamic module
+
+LIB_DEPENDS=	libbrotlienc.so:archivers/brotli
+
+MASTERDIR=	${.CURDIR}/../../www/angie
+
+do-install:
+	${MKDIR} ${STAGEDIR}${DOCSDIR}
+	${MKDIR} ${STAGEDIR}${MODDIR}
+
+.for i in ngx_http_brotli_filter_module ngx_http_brotli_static_module
+	${INSTALL_LIB} ${WRKSRC}/objs/${i}.so ${STAGEDIR}${MODDIR}
+.endfor
+
+.for i in CONTRIBUTING README
+	${INSTALL_MAN} ${WRKSRC_module}/${i}.md ${STAGEDIR}${DOCSDIR}
+.endfor
+
+do-install-DEBUG-on:
+.for i in ngx_http_brotli_filter_module ngx_http_brotli_static_module
+	${INSTALL} ${COPY} -m ${_SHAREMODE} ${WRKSRC_DEBUG}/objs/${i}.so \
+	    ${STAGEDIR}${MODDIR}/${i}-debug.so
+.endfor
+
+.include "${MASTERDIR}/Makefile"
diff --git a/www/angie-module-brotli/files/pkg-message.in b/www/angie-module-brotli/files/pkg-message.in
new file mode 100644
index 000000000000..8860feaf7fc4
--- /dev/null
+++ b/www/angie-module-brotli/files/pkg-message.in
@@ -0,0 +1,17 @@
+[
+{ type: install
+  message: <<EOM
+
+The Brotli dynamic module for Angie has been installed.
+To enable this module, add the following to %%PREFIX%%/etc/angie/angie.conf
+and reload angie:
+
+    load_module modules/ngx_http_brotli_filter_module.so;
+or:
+    load_module modules/ngx_http_brotli_static_module.so;
+
+Please refer to the module documentation for further details:
+https://github.com/google/ngx_brotli
+EOM
+}
+]
diff --git a/www/angie-module-brotli/pkg-descr b/www/angie-module-brotli/pkg-descr
new file mode 100644
index 000000000000..c8907016ff74
--- /dev/null
+++ b/www/angie-module-brotli/pkg-descr
@@ -0,0 +1,5 @@
+Module adds Brotli compression support to Angie.
+Brotli is a generic-purpose lossless compression algorithm that compresses
+data using a combination of a modern variant of the LZ77 algorithm, Huffman
+coding and 2nd order context modeling, with a compression ratio comparable
+to the best currently available general-purpose compression methods.
diff --git a/www/angie-module-brotli/pkg-plist b/www/angie-module-brotli/pkg-plist
new file mode 100644
index 000000000000..8be7a2abce45
--- /dev/null
+++ b/www/angie-module-brotli/pkg-plist
@@ -0,0 +1,6 @@
+%%DOCSDIR%%/CONTRIBUTING.md
+%%DOCSDIR%%/README.md
+%%MODDIR%%/ngx_http_brotli_filter_module.so
+%%MODDIR%%/ngx_http_brotli_static_module.so
+%%DEBUG%%%%MODDIR%%/ngx_http_brotli_filter_module-debug.so
+%%DEBUG%%%%MODDIR%%/ngx_http_brotli_static_module-debug.so