From: Zurab Kvachadze <zurabid2016@gmail.com>
To: gentoo-dev@lists.gentoo.org
Cc: conikost@gentoo.org, Zurab Kvachadze <zurabid2016@gmail.com>
Subject: [gentoo-dev] [RFC PATCH v2 20/20] www-nginx/ngx-set-misc: new package, add 0.33
Date: Tue, 30 Jul 2024 00:52:36 +0300 [thread overview]
Message-ID: <20240729215241.13243-21-zurabid2016@gmail.com> (raw)
In-Reply-To: <20240729215241.13243-1-zurabid2016@gmail.com>
The build system of this package automagically enables HMAC support
based on SSL functionality being enabled in the installed NGINX.
In order to enable this support independently, via a USE flag, a "hack"
is applied: only if GENTOO_USE_HMAC environmental variable and
preprocessor definition are defined, HMAC support is enabled.
Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
---
www-nginx/ngx-set-misc/Manifest | 1 +
.../ngx-set-misc}/metadata.xml | 9 ++--
.../ngx-set-misc/ngx-set-misc-0.33.ebuild | 50 +++++++++++++++++++
3 files changed, 55 insertions(+), 5 deletions(-)
create mode 100644 www-nginx/ngx-set-misc/Manifest
copy {app-containers/apptainer => www-nginx/ngx-set-misc}/metadata.xml (54%)
create mode 100644 www-nginx/ngx-set-misc/ngx-set-misc-0.33.ebuild
diff --git a/www-nginx/ngx-set-misc/Manifest b/www-nginx/ngx-set-misc/Manifest
new file mode 100644
index 000000000000..34be9e483747
--- /dev/null
+++ b/www-nginx/ngx-set-misc/Manifest
@@ -0,0 +1 @@
+DIST ngx-set-misc-0.33.tar.gz 30084 BLAKE2B 1aabf47e86946054d128a10290c36829152d427cf415378f5042e00e428baaf94a91e1d8ee1037b8a40197637c721492b01a82c800064decb9471149ad47bcff SHA512 1ff4c947538a5bd5f9d6adcd87b37f2702f5cc90e3342bc08359cbe8f290b705a3a2daa3dedfb1df3ce4bc19478c8fcac07081c4a53a804fc2862d50078278dc
diff --git a/app-containers/apptainer/metadata.xml b/www-nginx/ngx-set-misc/metadata.xml
similarity index 54%
copy from app-containers/apptainer/metadata.xml
copy to www-nginx/ngx-set-misc/metadata.xml
index c461d956342a..4a396a61a564 100644
--- a/app-containers/apptainer/metadata.xml
+++ b/www-nginx/ngx-set-misc/metadata.xml
@@ -2,11 +2,10 @@
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<!-- maintainer-needed -->
- <use>
- <flag name="network">Install network plug-ins</flag>
- <flag name="suid">Install SUID helper binary</flag>
- </use>
<upstream>
- <remote-id type="github">apptainer/apptainer</remote-id>
+ <remote-id type="github">openresty/set-misc-nginx-module</remote-id>
</upstream>
+ <use>
+ <flag name="hmac">Enable support for generating HMAC digests using <pkg>dev-libs/openssl</pkg></flag>
+ </use>
</pkgmetadata>
diff --git a/www-nginx/ngx-set-misc/ngx-set-misc-0.33.ebuild b/www-nginx/ngx-set-misc/ngx-set-misc-0.33.ebuild
new file mode 100644
index 000000000000..9869cf207c11
--- /dev/null
+++ b/www-nginx/ngx-set-misc/ngx-set-misc-0.33.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+DESCRIPTION="An NGINX module that adds various set_xxx directives to NGINX's rewrite module"
+HOMEPAGE="https://github.com/openresty/set-misc-nginx-module"
+
+SRC_URI="
+ https://github.com/openresty/set-misc-nginx-module/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
+"
+LICENSE="BSD-2"
+
+SLOT=0
+
+MY_PN="set-misc-nginx-module"
+
+inherit nginx-module
+
+NGINX_MOD_S="${WORKDIR}/${MY_PN}-${PV}"
+
+IUSE="+hmac"
+
+DEPEND="
+ www-nginx/ngx_devel_kit
+ hmac? ( dev-libs/openssl )
+"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ sed -E -i 's/USE_OPENSSL|MAIL_SSL/GENTOO_USE_HMAC/g' \
+ "${NGINX_MOD_S}/config" || die "sed failed"
+ sed -i 's/NGX_OPENSSL/GENTOO_USE_HMAC/g' \
+ "${NGINX_MOD_S}/src/ngx_http_set_misc_module.c" || die "sed failed"
+ if use hmac; then
+ sed -E -i 's/^(\s*ngx_module_libs)=$/\1=-lcrypto/' \
+ "${NGINX_MOD_S}/config" || die "sed failed"
+ fi
+ nginx-module_src_prepare
+}
+
+src_configure() {
+ append-cflags -DNDK
+ export NDK_SRCS="ndk.c"
+ export GENTOO_USE_HMAC=NO
+ if use hmac; then
+ export GENTOO_USE_HMAC=YES
+ append-cflags -DGENTOO_USE_HMAC=1
+ fi
+ nginx-module_src_configure
+}
--
2.44.2
prev parent reply other threads:[~2024-07-29 21:57 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-29 21:52 [gentoo-dev] [RFC PATCH v2 00/20] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass Zurab Kvachadze
2024-07-29 21:52 ` [gentoo-dev] [RFC PATCH v2 01/20] nginx.eclass: Add new eclass for building the NGINX server Zurab Kvachadze
2024-07-29 21:52 ` [gentoo-dev] [RFC PATCH v2 02/20] nginx-module.eclass: Add new eclass for building NGINX external modules Zurab Kvachadze
2024-07-29 21:52 ` [gentoo-dev] [RFC PATCH v2 03/20] www-servers/nginx: add myself as a proxy maintainer; update metadata.xml Zurab Kvachadze
2024-07-29 21:52 ` [gentoo-dev] [RFC PATCH v2 04/20] www-servers/nginx: add nginx.tmpfiles for managing /var/tmp/nginx Zurab Kvachadze
2024-07-30 7:12 ` Christian Bricart
2024-07-30 8:01 ` Zurab Kvachadze
2024-07-29 21:52 ` [gentoo-dev] [RFC PATCH v2 05/20] www-servers/nginx: add nginx-r5.initd Zurab Kvachadze
2024-07-29 21:52 ` [gentoo-dev] [RFC PATCH v2 06/20] www-servers/nginx: add nginx-r1.confd Zurab Kvachadze
2024-07-29 21:52 ` [gentoo-dev] [RFC PATCH v2 07/20] www-servers/nginx: add nginx-r2.service Zurab Kvachadze
2024-07-29 21:52 ` [gentoo-dev] [RFC PATCH v2 08/20] www-servers/nginx: add nginx-r2.logrotate Zurab Kvachadze
2024-07-29 21:52 ` [gentoo-dev] [RFC PATCH v2 09/20] www-servers/nginx: add nginx-r4.conf Zurab Kvachadze
2024-07-29 21:52 ` [gentoo-dev] [RFC PATCH v2 10/20] profiles/desc: reword and update nginx_modules_http.desc Zurab Kvachadze
2024-07-29 21:52 ` [gentoo-dev] [RFC PATCH v2 11/20] profiles/desc: reword and update nginx_modules_mail.desc Zurab Kvachadze
2024-07-29 21:52 ` [gentoo-dev] [RFC PATCH v2 12/20] profiles/desc: reword and update nginx_modules_stream.desc Zurab Kvachadze
2024-07-29 21:52 ` [gentoo-dev] [RFC PATCH v2 13/20] profiles/categories: Add www-nginx category for external NGINX modules Zurab Kvachadze
2024-07-29 21:52 ` [gentoo-dev] [RFC PATCH v2 14/20] www-servers/nginx: revbump 1.26.1-r1 to 1.26.1-r2, use nginx.eclass Zurab Kvachadze
2024-07-29 21:52 ` [gentoo-dev] [RFC PATCH v2 15/20] www-servers/nginx: revbump 1.27.0-r1 to 1.27.0-r2, " Zurab Kvachadze
2024-07-29 21:52 ` [gentoo-dev] [RFC PATCH v2 16/20] www-servers/nginx: add 9999 live version, " Zurab Kvachadze
2024-07-29 21:52 ` [gentoo-dev] [RFC PATCH v2 17/20] www-nginx/ngx_devel_kit: new package, add 0.3.3 Zurab Kvachadze
2024-07-29 21:52 ` [gentoo-dev] [RFC PATCH v2 18/20] www-nginx/ngx-echo: new package, add 0.63 Zurab Kvachadze
2024-07-29 21:52 ` [gentoo-dev] [RFC PATCH v2 19/20] www-nginx/ngx-encrypted-session: new package, add 0.09 Zurab Kvachadze
2024-07-29 21:52 ` Zurab Kvachadze [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240729215241.13243-21-zurabid2016@gmail.com \
--to=zurabid2016@gmail.com \
--cc=conikost@gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox