* [gentoo-dev] [PATCH v3 01/40] nginx.eclass: Add new eclass for building the NGINX server
2025-02-21 16:07 [gentoo-dev] [PATCH v3 00/40] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass Zurab Kvachadze
@ 2025-02-21 16:07 ` Zurab Kvachadze
2025-02-21 16:07 ` [gentoo-dev] [PATCH v3 02/40] dev-perl/Test-Nginx: new package, add 0.30 Zurab Kvachadze
` (39 subsequent siblings)
40 siblings, 0 replies; 42+ messages in thread
From: Zurab Kvachadze @ 2025-02-21 16:07 UTC (permalink / raw
To: gentoo-dev; +Cc: Zurab Kvachadze
This adds a generic eclass for building, testing and installing NGINX
distributions (F5's NGINX, freenginx, etc).
This is a complete revamp of the way NGINX is packaged in Gentoo.
The problem
===========
NGINX has not been maintained for almost 2 years, since June 5 2022
(commit 9061b2f2318: "*/*: reassign whissi's packages"). In its current
state, NGINX has 16 open bugs, with the oldest being reported more than
10 years ago (471106, 496318 and a few more). Moreover, each NGINX
ebuild is over 1100 lines of code and 40 kilobytes in size, with
enormous amounts of code being copied over with each version bump.
Currently, these are some of the most obvious issues.
There is another major problem: the www-servers/nginx package bundles
25 third party modules. This inflexible approach has its own issues:
* version pinning (of the external modules).
* no trivial way to add other external modules (for the end user).
The actual code is very old, has inconsistent USE flag choices
(http{2,3} being USE flags on their own rather than NGINX_MODULES_HTTP
USE_EXPAND flags, the same goes for the ssl USE flag, etc.), outright
useless USE flags that do nothing at all (pcre-jit and ktls), outdated
dependencies (libpcre instead of libpcre2 by default), mixed shell
constructs ('[' somewhere and '[[' elsewhere). The ebuild adds the
default include paths to CFLAGS and LDFLAGS for no reason and has
warnings about the versions as old as 1.10 (released in January
2017); the ebuild configures NGINX to store its temporary files in
/var/lib, instead of /var/tmp and so on...
Although this does not intend to cover all the flaws of the current
state of NGINX in the Gentoo tree, it is blatant that the quality of the
NGINX ebuilds are quite poor and that they are overall particularly
messy and clunky.
So, I deemed "repackaging" NGINX from the ground up an easier task (than
fixing the current NGINX ebuild in-place) and went on with it.
The solution
============
This eclass aims to fully cover as much of what is in common between
different NGINX versions and distributions as possible, which by itself
requires a high degree of flexibility in an eclass. The nginx.eclass
does not intend to move the aforementioned complexity to a one place,
but rather to *get rid* of it entirely. It achieves this by requiring
the inheriting ebuilds to provide the "specification" of their version.
The specification is really simple and is comprised of 4 variables:
* NGINX_MODULES, that defines available modules, i.e "http_perl",
"http_geoip", "http_ssl", "http_v3", "mail_imap", etc.
* NGINX_SUBSYSTEMS, that defines individual available NGINX servers:
"http", "stream" and "mail".
* NGINX_TESTS_COMMIT, that defines a partcular commit of NGINX
tests.
* NGINX_UPDATE_STREAM, that corresponds to the NGINX version type as
defined upstream. Currently, it is either "mainline", "stable" or
"live" for the Git version. SLOT is derived from this
variable.
And 1 optional variable:
* NGINX_MISC_FILES, that specifies files in FILESDIR, e.g. NGINX
main configuration file, NGINX systemd service file, etc. They are
installed into specific locations based on their file extension.
The nginx.eclass takes care of all the other aspects. This eclass:
1. Sets the default value for DESCRITPION, HOMEPAGE, LICENSE,
SRC_URI. SLOT is set to ${NGINX_UPDATE_STREAM}/${PV}.
2. Populates IUSE, based on the NGINX_MODULES and NGINX_SUBSYSTEMS
variables.
3. Fills BDEPEND, DEPEND and RDEPEND with general NGINX
dependencies.
4. Sets blocks on all possible update streams (that are expressed as
SLOT) apart from the current one, in order to disallow installing
multiple NGINX versions at once.
5. Sets REQUIRED_USE for inter-module dependencies, unless
OVERRIDE_NGINX_MOD_REQUIRED_USE is set.
6. Sets BDEPEND, DEPEND and RDEPEND for external module
dependencies, unless OVERRIDE_NGINX_MOD_DEPEND is set.
7. Sets BDEPEND for module test dependencies, unless
OVERRIDE_NGINX_MOD_TEST_DEPEND is set.
(points 5-7: the nginx.eclass comes with a default list for such
dependencies; the REQUIRED_USE and *DEPEND variables are only set
for the modules that are present in NGINX_MODULES).
8. Unpacks the sources or clones the Git repository.
9. Configures NGINX, obviously.
10. Compiles NGINX.
11. Tests the compiled binary. The test dependencies have also been
brought in line with what tests actually depend on.
12. Installs NGINX, complying with the FHS. The files specified in
NGINX_MISC_FILES are installed in their respective directories.
If "modules" use flag is enabled, indicating dynamic modules
support, NGINX build system is installed into /usr/src/nginx and
NGINX headers are installed into /usr/include/nginx.
The nginx.eclass also installs Portage set
@nginx-modules-rebuild. It groups all the NGINX dynamic modules
and is mainly of use for those who install the "live" version.
A considerable part of the eclass parses the ebuild variables, the
actual phase function code constitues roughly 240 LoC (out of 790
total). Every part of the eclass is thoroughly annotated and documented.
The nginx.eclass sets up the infrastructure for resolving the following
bugs:
* 886537 - "drop support for obsolete dev-libs/libpcre":
_ngx_set_mod_depend() makes the http_rewrite module depend only
on dev-libs/libpcre2.
* 578658 - "silently ignoring USE=http":
nginx.eclass introduces the "http" USE flag, which is a master
switch for the whole http subsystem.
* 573710 - "Add support for external 3rd party modules":
nginx.eclass acts as a foundation for such support. The actual
support for building dynamic modules will be in a separate
eclass - nginx-module.eclass.
* 735020 - "missing a USE flag for building --with-stream only":
nginx.eclass adds the "stream" flag to IUSE, allowing the
subsystem to be enabled without requiring to alter the
NGINX_MODULES_STREAM variable.
* 700866 - "use default log names":
this eclass uses the default {access,error}.log filenames,
instead of {access,error}_log.
* 925098 - "www-servers/freenginx - new package":
with this eclass, adding freenginx to the Gentoo tree is as
simple as setting the aforementioned NGINX_* variables,
inheriting nginx.eclass and setting the proper HOMEPAGE,
DESCRITPION and SRC_URI. It is crucial to also add block on
www-servers/nginx, so that the two packages are not installed
simultaneously. Nonetheless, the procedure desribed above is not
comprehensive; freenginx will not be regarded by the package
manager as a drop-in replacement of F5's NGINX for external
modules. To achieve this, a separate virtual/nginx ebuild must
be created.
Bug: https://bugs.gentoo.org/886537
Bug: https://bugs.gentoo.org/578658
Bug: https://bugs.gentoo.org/573710
Bug: https://bugs.gentoo.org/735020
Bug: https://bugs.gentoo.org/700866
Bug: https://bugs.gentoo.org/925098
Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
---
eclass/nginx.eclass | 950 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 950 insertions(+)
create mode 100644 eclass/nginx.eclass
diff --git a/eclass/nginx.eclass b/eclass/nginx.eclass
new file mode 100644
index 000000000000..c5b18d97f2f5
--- /dev/null
+++ b/eclass/nginx.eclass
@@ -0,0 +1,950 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# @ECLASS: nginx.eclass
+# @MAINTAINER:
+# Zurab Kvachadze <zurabid2016@gmail.com>
+# @AUTHOR:
+# Zurab Kvachadze <zurabid2016@gmail.com>
+# @SUPPORTED_EAPIS: 8
+# @BLURB: Provides a common set of functions for building the NGINX server
+# @DESCRIPTION:
+# This eclass automates building, testing and installation of the NGINX server.
+# Essentially, apart from the advanced usage, the ebuild must only define 4
+# variables prior to inheriting the eclass, everything else is handled by the
+# nginx.eclass.
+# Refer to the individual variable descriptions for documentation. The required
+# variables are:
+# - NGINX_SUBSYSTEMS
+# - NGINX_MODULES
+# - NGINX_UPDATE_STREAM
+# - NGINX_TESTS_COMMIT
+# And 1 optional variable (see description):
+# - NGINX_MISC_FILES
+
+case ${EAPI} in
+ 8) ;;
+ *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
+esac
+
+if [[ -z ${_NGINX_ECLASS} ]]; then
+_NGINX_ECLASS=1
+
+# The 60tmpfiles-paths install check produces QA warning if it does not detect
+# tmpfiles_process() in pkg_postinst(). Even though the tmpfiles_process() is
+# clearly called in nginx_pkg_postinst(), the QA check can not deal with
+# exported functions.
+# Nonetheless, it is possible to opt out from the QA check by setting the
+# TMPFILES_OPTIONAL variable.
+TMPFILES_OPTIONAL=1
+inherit edo multiprocessing perl-functions systemd toolchain-funcs tmpfiles
+
+#-----> ebuild-defined variables <-----
+
+# @ECLASS_VARIABLE: NGINX_SUBSYSTEMS
+# @PRE_INHERIT
+# @REQUIRED
+# @DESCRIPTION:
+# An array of individual NGINX "servers" or, as they are called in this eclass,
+# subsystems. An optional '+' prefix represents a default-enabled state.
+# The variable must be an exact representation of the upstream policy, i.e. the
+# subsystems that are enabled-by-default upstream must be prefixed with a '+' in
+# this array and the subsystems that are disabled-by-default must not be
+# prefixed with a '+'. Not following this rule will break NGINX build system. As
+# of the time of writing, there are 3 subsystems: "http", "stream", and "mail".
+# The naming is the exact representation of ./configure's '--with' and
+# '--without' options with the mentioned parts stripped and '+' appended where
+# relevant: '--without-http' -> '+http' (means 'http' is enabled by default),
+# '--with-stream' -> 'stream', etc.
+#
+# Example usage:
+# @CODE
+# NGINX_SUBSYSTEMS=( +http stream mail )
+# @CODE
+[[ ${#NGINX_SUBSYSTEMS[@]} -eq 0 ]] &&
+ die "The required NGINX_SUBSYSTEMS variable is unset or empty"
+
+# @ECLASS_VARIABLE: _NGX_SUBSYSTEMS
+# @INTERNAL
+# @DESCRIPTION:
+# Internal, read-only copy of NGINX_SUBSYSTEMS, used in various places in the
+# eclass.
+readonly _NGX_SUBSYSTEMS=( "${NGINX_SUBSYSTEMS[@]}" )
+
+# @ECLASS_VARIABLE: NGINX_MODULES
+# @PRE_INHERIT
+# @REQUIRED
+# @DESCRIPTION:
+# An array of bundled NGINX modules names with optional '+' prefix
+# representing a default-enabled state.
+# The variable must be an exact representation of the upstream policy, i.e. the
+# modules that are enabled-by-default upstream must be prefixed with a '+' in
+# this array and the modules that are disabled-by-default must not be prefixed
+# with a '+'. Not following this rule will break NGINX build system.
+# The naming scheme is exactly the same as used by the ./configure script with
+# '--with(out)' and '_module' parts stripped and the '+' prefix applied where
+# necessary: '--with-http_v2_module' -> 'http_v2',
+# '--without-http_autoindex_module' -> '+http_autoindex',
+# '--without-stream_limit_conn_module' -> '+stream_limit_conn', etc.
+#
+# Example usage:
+# @CODE
+# NGINX_MODULES=(
+# +http_rewrite http_ssl +http_gzip
+# +stream_access
+# +mail_imap
+# http_{geoip,perl}
+# )
+# @CODE
+[[ ${#NGINX_MODULES[@]} -eq 0 ]] &&
+ die "The required NGINX_MODULES variable is unset or empty"
+
+# @ECLASS_VARIABLE: _NGX_MODULES
+# @INTERNAL
+# @DESCRIPTION:
+# Internal, read-only copy of NGINX_MODULES, used in various places in the
+# nginx.eclass.
+readonly _NGX_MODULES=( "${NGINX_MODULES[@]}" )
+
+# @ECLASS_VARIABLE: NGINX_UPDATE_STREAM
+# @PRE_INHERIT
+# @REQUIRED
+# @DESCRIPTION:
+# This variable must contain the update stream of NGINX. The list of all
+# possible update streams is set by the NGX_UPDATE_STREAMS_LIST variable. An
+# ebuild must not set SLOT manually. The eclass will automatically set SLOT and
+# add blocks on other update streams into RDEPEND variable, based on this
+# variable.
+# NGINX_UPDATE_STREAM might be set to a special value: 'live'. Doing this makes
+# the eclass fetch the live (latest) version of NGINX from its Git repository.
+# This behaviour can be further configured by setting the following variables
+# (refer to each variable description for documentation):
+# - NGINX_GIT_URI
+# - NGINX_GIT_TESTS_URI
+#
+# Example usage:
+# @CODE
+# NGINX_UPDATE_STREAM=mainline
+# @CODE
+
+# @ECLASS_VARIABLE: NGX_UPDATE_STREAMS_LIST
+# @DESCRIPTION:
+# Read-only array that contains all the possible NGINX update streams.
+readonly NGX_UPDATE_STREAMS_LIST=( stable mainline live )
+
+[[ -z ${NGINX_UPDATE_STREAM} ]] &&
+ die "The required NGINX_UPDATE_STREAM variable is unset or empty"
+has "${NGINX_UPDATE_STREAM}" "${NGX_UPDATE_STREAMS_LIST[@]}" ||
+ die "Unknown update stream set in the NGINX_UPDATE_STREAM variable"
+
+[[ ${NGINX_UPDATE_STREAM} == live ]] && inherit git-r3
+
+# @ECLASS_VARIABLE: NGINX_TESTS_COMMIT
+# @PRE_INHERIT
+# @REQUIRED
+# @DESCRIPTION:
+# This variable must contain a valid commit hash of nginx-tests[1] repository. The
+# tests for NGINX are unversioned, therefore their snapshot is obtained from the
+# specified commit.
+# Only in case NGINX_UPDATE_STREAM is set to 'live', this variable might also be
+# set exactly to 'live' in order to fetch the latest version of the
+# nginx-tests[1] repository.
+# [1]: https://github.com/nginx/nginx-tests/
+#
+# Example usage:
+# @CODE
+# NGINX_TESTS_COMMIT=345f9b74cd296695b188937b9ade246033476071
+# @CODE
+[[ -z ${NGINX_TESTS_COMMIT} ]] &&
+ die "The required NGINX_TESTS_COMMIT variable is unset or empty"
+[[ ${NGINX_TESTS_COMMIT} == live && ${NGINX_UPDATE_STREAM} != live ]] &&
+ die "Live tests can not be used with a non-live version of NGINX"
+
+# @ECLASS_VARIABLE: NGINX_GIT_URI
+# @DESCRIPTION:
+# May be set to an alternative URI of NGINX Git repository for the live
+# version to be fetched from. Defaults to "https://github.com/nginx/nginx".
+: "${NGINX_GIT_URI=https://github.com/nginx/nginx}"
+
+# @ECLASS_VARIABLE: NGINX_GIT_TESTS_URI
+# @DESCRIPTION:
+# May be set to an alternative URI of NGINX tests Git repository for the
+# live version to be fetched from. Defaults to "https://github.com/nginx/nginx-tests".
+: "${NGINX_GIT_TESTS_URI=https://github.com/nginx/nginx-tests}"
+
+# @ECLASS_VARIABLE: NGINX_MISC_FILES
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# This array holds filenames of miscellaneous files in FILESDIR. The files that
+# are specified in this array are installed to various locations, based on their
+# file extension. The "file extension <-> path" mappings are as follows:
+# '.conf' -> '/etc/nginx'
+# '.service' -> systemd unit directory
+# '.initd' -> '/etc/init.d'
+# '.confd' -> '/etc/conf.d'
+# '.logrotate' -> '/etc/logrotate.d'
+# '.tmpfiles' -> '/usr/lib/tmpfiles.d'
+# This variable exists to avoid (1) hardcoding specific versions of the files
+# that may change due to revisions (the revisions happen rather frequently in
+# case of NGINX), (2) repeating the code which installs the files in every
+# ebuild, and (3) requiring these miscellaneous files to exist at all.
+#
+# Example usage:
+# @CODE
+# NGINX_MISC_FILES=(
+# nginx-r5.initd nginx-r4.conf nginx-r1.confd nginx-{r2.logrotate,r2.service}
+# )
+# @CODE
+
+# @ECLASS_VARIABLE: OVERRIDE_NGINX_MOD_REQUIRED_USE
+# @DEFAULT_UNSET
+# @PRE_INHERIT
+# @DESCRIPTION:
+# Set this to a non-empty value prior to inheriting the eclass to NOT
+# automatically fill the REQUIRED_USE variable with inter-module dependencies.
+# For details, see _ngx_set_mod_required_use() function description below.
+
+# @ECLASS_VARIABLE: OVERRIDE_NGINX_MOD_DEPEND
+# @DEFAULT_UNSET
+# @PRE_INHERIT
+# @DESCRIPTION:
+# Set this to a non-empty value prior to inheriting the eclass to NOT
+# automatically fill the BDEPEND, DEPEND, and RDEPEND variables with module
+# dependencies.
+# For details, see _ngx_set_mod_depend() function description below.
+
+# @ECLASS_VARIABLE: OVERRIDE_NGINX_MOD_TEST_DEPEND
+# @DEFAULT_UNSET
+# @PRE_INHERIT
+# @DESCRIPTION:
+# Set this to a non-empty value prior to inheriting the eclass to NOT
+# automatically fill the BDEPEND variable with module test dependencies.
+# For details, see _ngx_set_mod_test_depend() function description below.
+
+#-----> ebuild setup <-----
+
+# NGINX does not guarantee ABI stability (required by dynamic modules), SLOT is
+# set to reflect this.
+SLOT="${NGINX_UPDATE_STREAM}/${PV}"
+: "${DESCRIPTION=Robust, small and high performance HTTP and reverse proxy server}"
+: "${HOMEPAGE=https://nginx.org https://github.com/nginx/nginx}"
+if [[ -z ${SRC_URI} ]]; then
+ if [[ ${NGINX_UPDATE_STREAM} != live ]]; then
+ SRC_URI="https://nginx.org/download/${P}.tar.gz"
+ fi
+ if [[ ${NGINX_TESTS_COMMIT} != live ]]; then
+ SRC_URI+="
+ test? (
+ https://github.com/nginx/nginx-tests/archive/${NGINX_TESTS_COMMIT}.tar.gz ->
+ nginx-tests-${NGINX_TESTS_COMMIT}.tar.gz
+ )
+ "
+ fi
+fi
+: "${LICENSE=BSD-2}"
+
+# @ECLASS_VARIABLE: NGX_TESTS_S
+# @OUTPUT_VARIABLE
+# @DESCRIPTION:
+# Variable set to the work directory of the NGINX tests.
+NGX_TESTS_S="${WORKDIR}/nginx-tests-${NGINX_TESTS_COMMIT}"
+
+#-----> Generic helper functions <-----
+
+# @FUNCTION: econf_ngx
+# @USAGE: [<args>...]
+# @DESCRIPTION:
+# Call ./configure, passing the supplied arguments.
+# The NGINX build system consists of many helper scripts, which are executed
+# relative to the working directory. Therefore, the function only supports
+# executing the ./configure script from the current working directory. This
+# function also checks whether the script is executable. If any of the above
+# conditions are not satisfied, the function aborts the build process with
+# 'die'. It also 'die's if the script itself exits with a non-zero exit code,
+# unless the function is called with 'nonfatal'.
+# If running ./configure is required, this function should be called.
+econf_ngx() {
+ debug-print-function "${FUNCNAME[0]}" "$@"
+ [[ -x ./configure ]] ||
+ die "./configure is not present in the current working directory or is not executable"
+ # We do not use edo here, as it does not quote its arguments when outputting
+ # to stderr. This makes it harder to differentiate boundaries between
+ # options that are supplied an argument containing whitespace.
+ #
+ # For example, if edo was used, the following Bash line:
+ # econf_ngx --with-cpp="gcc -E" --builddir=build
+ # would be printed to stderr as
+ # ./configure --with-cpp=gcc -E --builddir=build
+ # whilst the Bash's "${variable@Q}" syntax automatically quotes `variable`,
+ # producing the following result:
+ # ./configure '--with-cpp=gcc -E' '--builddir=build'
+ printf "%s\n" "./configure ${*@Q}" >&2
+ ./configure "$@"
+ # For some reason, NGINX ./configure returns 1 if it is used with the
+ # '--help' argument.
+ if [[ $? -ne 0 && $1 != --help ]]; then
+ die -n "./configure ${*@Q} failed"
+ fi
+}
+
+#-----> USE logic <-----
+
+# @FUNCTION: _ngx_populate_iuse
+# @INTERNAL
+# @DESCRIPTION:
+# Populates IUSE with parsed entries from NGINX_SUBSYSTEMS and NGINX_MODULES.
+_ngx_populate_iuse() {
+ local mod state
+ IUSE+=" ${_NGX_SUBSYSTEMS[*]}"
+ for mod in "${_NGX_MODULES[@]}"; do
+ # SSL should be enabled by default in 2025.
+ if [[ ${mod:0:1} == + || ${mod} == *_ssl ]]; then
+ state=+
+ else
+ state=''
+ fi
+ IUSE+=" ${state}nginx_modules_${mod#+}"
+ done
+}
+
+IUSE="aio debug libatomic +modules selinux test"
+REQUIRED_USE="|| ( ${_NGX_SUBSYSTEMS[*]#+} )"
+RESTRICT="!test? ( test )"
+
+_ngx_populate_iuse
+
+unset -f _ngx_populate_iuse
+
+#-----> *DEPEND stuff <-----
+
+BDEPEND="
+ test? (
+ dev-lang/perl
+ virtual/perl-IO-Compress
+ virtual/perl-Test-Simple
+ virtual/perl-Test-Harness
+ )
+"
+
+DEPEND="
+ acct-group/nginx
+ acct-user/nginx
+ virtual/libcrypt:=
+ libatomic? ( dev-libs/libatomic_ops )
+"
+
+RDEPEND="
+ ${DEPEND}
+ app-misc/mime-types[nginx]
+ selinux? ( sec-policy/selinux-nginx )
+ !app-vim/nginx-syntax
+"
+
+IDEPEND="virtual/tmpfiles"
+
+
+# @FUNCTION: _ngx_set_blocks
+# @INTERNAL
+# @USAGE: <chosen_update_stream> <possible_upd_stream1> [<possible_upd_stream2>...]
+# @DESCRIPTION:
+# Set blocks on all the supplied update streams apart from the chosen one.
+_ngx_set_blocks() {
+ debug-print-function "${FUNCNAME[0]}" "$@"
+ [[ $# -ge 2 ]] || die "${FUNCNAME[0]} must receive at least two arguments"
+ local chosen candidate
+ chosen="$1"
+ shift
+ for candidate; do
+ [[ ${candidate} != "${chosen}" ]] &&
+ RDEPEND+=" !${CATEGORY}/${PN}:${candidate}"
+ done
+}
+
+# Null at the end makes the function also block the legacy unslotted NGINX versions.
+_ngx_set_blocks "${NGINX_UPDATE_STREAM}" "${NGX_UPDATE_STREAMS_LIST[@]}" 0
+
+
+# @FUNCTION: _ngx_set_mod_required_use
+# @INTERNAL
+# @DESCRIPTION:
+# Sets the REQUIRED_USE variable for inter-modules dependencies. The subscript
+# specifies the target module and the value is a comma separated list of the
+# modules the subscript depends on.
+# This function comes with a predefined associative array of dependencies (that
+# should be updated, in case they change, i.e. get added/removed), for each
+# ebuild to not redundantly specify these.
+# The function adds dependencies only if the corresponding module is specified
+# in the NGINX_MODULES variable, defined by the ebuild. Therefore, it is safe to
+# add new modules to the default list, since the respective dependencies will
+# not be set for the NGINX versions that do come with the modules in question.
+# This function is always executed, unless OVERRIDE_NGINX_MOD_REQUIRED_USE is
+# set to a non-empty value (see the variable description).
+_ngx_set_mod_required_use() {
+ local -A _NGX_DEP_TABLE=(
+ [http_v3]=http_ssl
+ )
+
+ local mod dep_list dep result
+ # Iterate over all the indices.
+ for mod in "${!_NGX_DEP_TABLE[@]}"; do
+ if has "${mod}" "${_NGX_MODULES[@]#+}"; then
+ result=''
+ # Feed comma-delimited dependencies into the dep_list array.
+ IFS=, read -ra dep_list <<< "${_NGX_DEP_TABLE[${mod}]}"
+ for dep in "${dep_list[@]}"; do
+ has "${dep}" "${_NGX_MODULES[@]#+}" &&
+ result+=" nginx_modules_${dep}"
+ done
+ [[ -n ${result} ]] &&
+ REQUIRED_USE+="
+ nginx_modules_${mod}? ( ${result} )
+ "
+ fi
+ done
+}
+
+[[ -z ${OVERRIDE_NGINX_MOD_REQUIRED_USE} ]] &&
+ _ngx_set_mod_required_use
+
+# @FUNCTION: _ngx_set_mod_depend
+# @INTERNAL
+# @DESCRIPTION:
+# Fills the {,B,R}DEPEND variables with external module dependencies.
+# This function comes with a predefined associative array of dependencies (that
+# should be updated, in case they change, get added/removed), for each ebuild to
+# not redundantly specify these.
+# The function adds dependencies only if the corresponding module is specified
+# in the NGINX_MODULES variable, defined by the ebuild. Therefore, it is safe to
+# add new modules to the default list, since they will not propagate to the
+# NGINX versions that do not have the modules in question.
+# This function is always executed, unless OVERRIDE_NGINX_MOD_DEPEND is set to a
+# non-empty value (see the variable description).
+_ngx_set_mod_depend() {
+ # The highest common denominator of module dependencies.
+ local -A COMMON_DEPEND=(
+ [http_image_filter]="media-libs/gd:="
+ [http_geoip]="dev-libs/geoip"
+ [http_gunzip]="sys-libs/zlib:="
+ [http_gzip]="sys-libs/zlib:="
+ [http_rewrite]="dev-libs/libpcre2:="
+ [http_ssl]="dev-libs/openssl:="
+ # http_v3 requires NGINX QUIC compatibility layer that uses
+ # SSL_CTX_add_custom_ext OpenSSL interface, which was introduced in
+ # OpenSSL 1.1.1.
+ [http_v3]=">=dev-libs/openssl-1.1.1:="
+ [http_xslt]="
+ dev-libs/libxml2:=
+ dev-libs/libxslt
+ "
+ [mail_ssl]="dev-libs/openssl:="
+ [stream_geoip]="dev-libs/geoip"
+ [stream_ssl]="dev-libs/openssl:="
+ )
+ local COMMON_DEPEND_DEF
+ # Bash does not have an easy way to copy an associative array, so its value
+ # is obtained using the 'declare' builtin.
+ COMMON_DEPEND_DEF="$(declare -p COMMON_DEPEND)"
+
+ local -A _NGX_MOD_BDEPEND=(
+ [http_perl]="dev-lang/perl"
+ )
+ local -A _NGX_MOD_DEPEND="${COMMON_DEPEND_DEF#*=}"
+ _NGX_MOD_DEPEND+=(
+ [http_perl]="dev-lang/perl"
+ )
+ local -A _NGX_MOD_RDEPEND="${COMMON_DEPEND_DEF#*=}"
+ _NGX_MOD_RDEPEND+=(
+ [http_perl]="dev-lang/perl:="
+ )
+
+ local mod dep_type dep_table
+ # Make dep_table a reference to one of the _NGX_MOD_* variables defined
+ # above, then make dep_type itself a reference to the dependency variable.
+ for dep_type in {,B,R}DEPEND; do
+ declare -n dep_table="_NGX_MOD_${dep_type}"
+ declare -n dep_type
+ # Iterate over all the indexes (i.e., module names) of the referenced variable.
+ for mod in "${!dep_table[@]}"; do
+ # If the the module currently being processed is available in the
+ # current version of NGINX, add the corresponding dependency line to
+ # the respective *DEPEND variable.
+ if has "${mod}" "${_NGX_MODULES[@]#+}"; then
+ dep_type+=" nginx_modules_${mod}? ( ${dep_table[${mod}]} )"
+ fi
+ done
+ # Reset the 'name reference' attribute.
+ declare +n dep_table dep_type
+ done
+}
+
+[[ -z ${OVERRIDE_NGINX_MOD_DEPEND} ]] &&
+ _ngx_set_mod_depend
+
+# @FUNCTION: _ngx_set_mod_test_depend
+# @INTERNAL
+# @DESCRIPTION:
+# Fills the BDEPEND variable with module test dependencies.
+# This function comes with a predefined associative array of dependencies (that
+# should be updated, in case they change, get added/removed), for each ebuild to
+# not redundantly specify these.
+# The function adds dependencies only if the corresponding module is specified
+# in the NGINX_MODULES variable, defined by the ebuild. Therefore, it is safe to
+# add new modules to the default list, since they will not propagate to the
+# NGINX versions that do not have the modules in question.
+# This function is always executed, unless OVERRIDE_NGINX_MOD_TEST_DEPEND is set
+# to a non-empty value (see the variable description).
+_ngx_set_mod_test_depend() {
+ # A few notes:
+ # - http_scgi needs SCGI Perl module, which is not packaged by Gentoo,
+ # - http_proxy needs Protocol::Websocket, not packaged by Gentoo.
+ local -A _NGX_MOD_TEST_DEP=(
+ [http_fastcgi]="dev-perl/FCGI"
+ [http_image_filter]="dev-perl/GD"
+ [http_memcached]="
+ dev-perl/Cache-Memcached
+ dev-perl/Cache-Memcached-Fast
+ net-misc/memcached
+ "
+ [http_ssl]="
+ dev-perl/IO-Socket-SSL
+ dev-perl/Net-SSLeay
+ "
+ [http_uwsgi]="www-servers/uwsgi[python(-)]"
+ [http_v3]="dev-perl/CryptX"
+ [mail_ssl]="dev-perl/IO-Socket-SSL"
+ [stream_ssl]="dev-perl/IO-Socket-SSL"
+ )
+ local mod result=
+ for mod in "${!_NGX_MOD_TEST_DEP[@]}"; do
+ if has "${mod}" "${_NGX_MODULES[@]#+}"; then
+ result+=" nginx_modules_${mod}? ( ${_NGX_MOD_TEST_DEP[${mod}]} )"
+ fi
+ done
+ [[ -n ${result} ]] &&
+ BDEPEND+=" test? ( ${result} )"
+}
+
+[[ -z ${OVERRIDE_NGINX_MOD_TEST_DEPEND} ]] &&
+ _ngx_set_mod_test_depend
+
+unset -f _ngx_set_blocks _ngx_set_mod_required_use _ngx_set_mod_depend \
+ _ngx_set_mod_test_depend
+
+#-----> Phase functions <-----
+
+# @FUNCTION: nginx_pkg_setup
+# @DESCRIPTION:
+# Shows important information that a user should pay attention to.
+nginx_pkg_setup() {
+ local prefix="nginx_modules_http"
+ if in_iuse "${prefix}_grpc" && in_iuse "${prefix}_v2" &&
+ use "${prefix}_grpc" && ! use "${prefix}_v2";
+ then
+ ewarn "http_grpc is enabled when http_v2 is disabled."
+ ewarn "The http_grpc module will not be built if http_v2 is not enabled."
+ ewarn "Please enable the ${prefix}_v2 USE flag on ${CATEGORY}/${PN}"
+ ewarn "to use the http_grpc NGINX module. Refer to the Gentoo Handbook for"
+ ewarn "instructions on how to change USE flags."
+ fi
+}
+
+# @FUNCTION: nginx_src_unpack
+# @DESCRIPTION:
+# Unpacks the NGINX sources. For the live version of NGINX, fetches the tip of
+# the Git repository.
+nginx_src_unpack() {
+ debug-print-function "${FUNCNAME[0]}" "$@"
+ if [[ ${NGINX_UPDATE_STREAM} == live ]]; then
+ EGIT_REPO_URI="${NGINX_GIT_URI}" git-r3_src_unpack
+ # In the Git repo, ./configure script is located in auto/ folder.
+ mv "${S}/auto/configure" "${S}/configure" || die "mv failed"
+ # Non-live tests for any update stream are taken care of in SRC_URI.
+ if use test && [[ ${NGINX_TESTS_COMMIT} == live ]]; then
+ EGIT_REPO_URI="${NGINX_GIT_TESTS_URI}" \
+ EGIT_CHECKOUT_DIR="${NGX_TESTS_S}" \
+ git-r3_src_unpack
+ fi
+ fi
+
+ default_src_unpack
+}
+
+# @FUNCTION: nginx_src_configure
+# @DESCRIPTION:
+# Configures NGINX. The function initialises the default set of configure
+# flags, coupled with the USE-conditional ones. The function also automatically
+# disables and enables NGINX modules and subsystems listed in NGINX_MODULES and
+# NGINX_SUBSYSTEMS respectively.
+# Custom flags can be supplied via the 'myconf' array, taking precedence over
+# the eclass flags.
+nginx_src_configure() {
+ debug-print-function "${FUNCNAME[0]}" "$@"
+ local nginx_flags
+ nginx_flags=(
+ --with-cc="$(tc-getCC)"
+ --with-cpp="$(tc-getCPP)"
+ --with-ld-opt="${LDFLAGS}"
+ --builddir=build
+ # NGINX loads modules relative to the prefix, not modules-path
+ --prefix="${EPREFIX}/usr/$(get_libdir)/nginx"
+ --sbin-path="${EPREFIX}/usr/sbin/nginx"
+ --modules-path="${EPREFIX}/usr/$(get_libdir)/nginx/modules"
+ --conf-path="${EPREFIX}/etc/nginx/nginx.conf"
+ --error-log-path="${EPREFIX}/var/log/nginx/error.log"
+ --http-log-path="${EPREFIX}/var/log/nginx/access.log"
+ --pid-path="${EPREFIX}/run/nginx.pid"
+ --lock-path="${EPREFIX}/run/lock/nginx.lock"
+ --user=nginx
+ --group=nginx
+ --with-threads
+ )
+
+ use aio && nginx_flags+=( --with-file-aio )
+ use debug && nginx_flags+=( --with-debug )
+ use libatomic && nginx_flags+=( --with-libatomic )
+ use modules && nginx_flags+=( --with-compat )
+
+ # Fix paths for various temporary files.
+ local conf _txt
+ while read -r conf _txt; do
+ conf="${conf%%-temp-path*}"
+ conf="${conf#--http-}"
+ nginx_flags+=(
+ "--http-${conf}-temp-path=${EPREFIX}/var/tmp/nginx/${conf//-/_}_temp"
+ )
+ done < <(econf_ngx --help 2>/dev/null | grep -E -- '--http-([A-Za-z]+-?)+-temp-path')
+ unset conf _txt
+
+ # For each subsystem and module we check if they diverge from their default
+ # state and, if that is the case, we pass the corresponding flag to the
+ # ./configure script.
+ # This is done this way because NGINX build system does not understand
+ # arguments that set options to their default state, e.g. ./configure does
+ # not recognise argument '--with-http_rewrite_module', it understands only
+ # '--without-http_rewrite_module', as http_rewrite module is enabled by
+ # default.
+ local subsys mod def_state use_state
+ for subsys in "${_NGX_SUBSYSTEMS[@]}"; do
+ use "${subsys#+}"; use_state=$?
+ # If the first character is '+' which means the subsystem is
+ # enabled-by-default, the default state is 0. If the first character is
+ # not '+', the default state is 1 - the subsystem is
+ # disabled-by-default.
+ [[ ${subsys:0:1} == + ]]; def_state=$?
+ # If the USE flag does not correspond to the default value of the
+ # subsystem (e.g. a subsystem is default-enabled, but the corresponding
+ # USE flag is disabled), we add the respective flag to the list of
+ # flags. An example:
+ #
+ # - subsystem 'http' is enabled by default. The user does not want the
+ # HTTP server, so they disable the 'http' USE flag. The use_state will
+ # contain '1' and def_state will be equal to '0'. Since these numbers
+ # differ, the flag '--without-http' will be passed to the configure
+ # script.
+ if [[ ${use_state} -ne ${def_state} ]]; then
+ nginx_flags+=( "$(use_with "${subsys#+}")" )
+ fi
+ done
+ # The same as the above, but for modules.
+ for mod in "${_NGX_MODULES[@]}"; do
+ use "nginx_modules_${mod#+}"; use_state=$?
+ [[ ${mod:0:1} == + ]]; def_state=$?
+ # A few more examples, this time with modules:
+ #
+ # - Sadly, module 'http_v2' is not enabled by default. A user has
+ # absolutely no need for HTTP/2, and, logically, does not enable the
+ # corresponding 'nginx_modules_http_v2' USE flag. As such,
+ # use_state will be '1' and so will be def_state. The former yields
+ # '1', as the USE flag is disabled and the latter equals to '1' as the
+ # 'http_v2' module does not have a '+' in front of it in _NGX_MODULES
+ # array, signifying its default-disabled state. Due to default state
+ # being equal to the USE state, no flag will be passed to ./configure
+ # and the 'http_v2' module is not built.
+ #
+ # - Module 'http_ssl' providing SSL/TLS is disabled by default. But,
+ # fortunately, the corresponding 'nginx_modules_http_ssl' USE flag is
+ # appended to IUSE as a default enabled one, since everyone should be
+ # using TLS in 2024 (I guess it will be 2025 by the time this is
+ # merged! Merry Christmas, everybody)! The user decides to leave the
+ # USE flag on to leverage the immense possibilities that encryption
+ # offers. Therefore, use_state will contain 0, meaning that the USE
+ # flag is, in fact, enabled. def_state, on the other hand, will be
+ # '1', as no '+' is present in front of 'http_ssl' in the _NGX_MODULES
+ # array. This denotes the fact that 'http_ssl' is disabled by default
+ # upstream, but the corresponding USE flag is enabled by default in
+ # Gentoo. Since use_state and def_state are not equal, which means
+ # that the default and the actual state are different,
+ # '--with-http_ssl_module' is passed to the ./configure script.
+ if [[ ${use_state} -ne ${def_state} ]]; then
+ nginx_flags+=( "$(use_with "nginx_modules_${mod#+}" "${mod#+}_module")" )
+ fi
+ done
+ unset subsys mod def_state use_state
+
+ # Handle arguments containing quoted whitespace.
+ eval "local -a EXTRA_ECONF=( ${EXTRA_ECONF} )"
+
+ # You never know when bug #286772 may get you.
+ LC_ALL=C LANG=C econf_ngx \
+ "${nginx_flags[@]}" \
+ "${myconf[@]}" \
+ "${EXTRA_ECONF[@]}"
+
+ sed -E -i \
+ -e 's|\$\(LINK\)|$(LINK) $(CFLAGS)|' \
+ -e '/^\s*LIB= \\$/ d' \
+ -e '/^\s*INSTALLSITEMAN3DIR= \\$/ d' \
+ build/Makefile || die "sed failed"
+}
+
+# @FUNCTION: nginx_src_compile
+# @DESCRIPTION:
+# Compiles NGINX, setting the correct installation directories for the
+# Perl-related files.
+nginx_src_compile() {
+ debug-print-function "${FUNCNAME[0]}" "$@"
+ PERL_MM_OPT='INSTALLDIRS=vendor' emake
+}
+
+# @FUNCTION: nginx_src_test
+# @DESCRIPTION:
+# Performs tests on the compiled NGINX binary, using Perl's prove.
+nginx_src_test() {
+ debug-print-function "${FUNCNAME[0]}" "$@"
+ pushd "${NGX_TESTS_S}" >/dev/null || die "pushd failed"
+ # For uwsgi tests, NGINX needs uwsgi's Python plugin. uwsgi installs Python
+ # plugins concatenated with a Python version, for example "python312".
+ #
+ # These plugins must be loaded manually via a command line argument
+ # '--plugin PLUGIN_NAME'. NGINX tries '--plugin python' and '--plugin
+ # python3', both fail, as the installed uwsgi plugins contain a *full*
+ # Python version.
+ #
+ # To circumvent this issue, we create a temporary fake binary directory with
+ # a shell script that executes "uwsgi_python${PYTHON_VERSION}". Upon
+ # execution, uwsgi_python* automatically loads the corresponding Python
+ # plugin, working around the problem.
+
+ # The old PATH is saved to be restored later, after the tests have finished.
+ local old_PATH="${PATH}"
+
+ if in_iuse nginx_modules_http_uwsgi && use nginx_modules_http_uwsgi; then
+ mkdir "${T}/fakebin" || die "mkdir failed"
+ pushd "${T}/fakebin" >/dev/null || die "pushd failed"
+
+ local -a UWSGI_TARGETS
+ # Finds all the "uwsgi_python${PYTHON_VERSION}" in /usr/{,s}bin, which
+ # are symlinks to uwsgi.
+ mapfile -d '' UWSGI_TARGETS < \
+ <(find -H "${BROOT}"/usr/{,s}bin -type l -name 'uwsgi_python*' -print0)
+ # We do not care about the specific Python version, we use the first
+ # one we that is found.
+ [[ ${#UWSGI_TARGETS[@]} -eq 0 ]] &&
+ die "No uwsgi with Python support found"
+ # A small script is created and PATH is mangled, so that the tests use
+ # Python-enabled uwsgi, instead of the default one. The path to uwsgi is
+ # quoted in case it contains interesting characters. The stderr is
+ # redirected to /dev/null, since, by default, uwsgi prints redundant
+ # "Implicit plugin requested" messages.
+ cat > uwsgi <<- EOF || die "cat failed"
+ #!/bin/sh
+ exec ${UWSGI_TARGETS[0]@Q} "\$@" 2>/dev/null
+ EOF
+ chmod +x uwsgi || die "chmod failed"
+
+ # "${T}/fakebin" is prepended to PATH so that our interceptor script is
+ # executed, instead of real uwsgi.
+ PATH="${T}/fakebin:${PATH}"
+ popd >/dev/null || die "popd failed"
+ fi
+
+ TEST_NGINX_BINARY="${S}/build/nginx" \
+ edo prove -j "$(makeopts_jobs)" .
+
+ PATH="${old_PATH}"
+ popd >/dev/null || die "popd failed"
+}
+
+# @FUNCTION: nginx_src_install
+# @DESCRIPTION:
+# Installs NGINX, including miscellaneous directories under '/var' and
+# documentation. Vimfiles from 'contrib/vim' are also installed by this
+# function. All the files specified in the NGINX_MISC_FILES array are installed
+# in their respective directories.
+# If 'modules' USE flag is enabled, the build system (the './configure' script
+# and the scripts in the 'auto/' directory) is installed into '/usr/src/nginx'
+# and NGINX headers into '/usr/include/nginx'.
+nginx_src_install() {
+ debug-print-function "${FUNCNAME[0]}" "$@"
+ emake DESTDIR="${ED}" install
+ keepdir "/usr/$(get_libdir)/nginx/modules"
+
+ keepdir /var/log/nginx
+ # Set the proper permissions on /var/log/nginx to mitigate CVE-2016-1247
+ # (bug #605008).
+ fperms 0750 /var/log/nginx
+ fowners root:nginx /var/log/nginx
+ # NGINX desperately wants to *install* its pidfile (and some web pages).
+ # Unfortunately, we can not let it do this...
+ rm -r "${ED}/run" "${ED}/usr/$(get_libdir)/nginx/html" || die "rm failed"
+ # The default directory for serving web content.
+ keepdir /var/www
+
+ # Clean /etc/nginx from unneeded files and move the directory to
+ # /usr/share/nginx.
+ pushd "${ED}/etc/nginx" >/dev/null || die "pushd failed"
+ # mime-types* are provided by app-misc/mime-types[nginx], .default config
+ # files are redundant due to CONFIG_PROTECT and fastcgi.conf is a copy of
+ # fastcgi_params. As for nginx.conf, we ship our own config file.
+ rm -- *.default mime.types fastcgi.conf nginx.conf || die "rm failed"
+ popd >/dev/null || die "Returning to the previous directory failed"
+
+ dodir /usr/share
+ mv "${ED}/etc/nginx" "${ED}/usr/share/nginx" || die "mv failed"
+
+ insinto /usr/share/nginx
+ if [[ ${NGINX_UPDATE_STREAM} != live ]]; then
+ dodoc CHANGES*
+ doins html/*.html
+ else
+ # The Git version has a slightly different file structure.
+ doins docs/html/*.html
+ fi
+ dodoc LICENSE README*
+ doman build/nginx.8
+
+ # Install miscellaneous files in the proper directories, based on their file
+ # extension (see the description of the NGINX_MISC_FILES variable).
+ local mfile
+ for mfile in "${NGINX_MISC_FILES[@]}"; do
+ case "${mfile}" in
+ *.conf)
+ insinto /etc/nginx
+ newins "${FILESDIR}/${mfile}" nginx.conf
+ ;;
+ *.service)
+ systemd_newunit "${FILESDIR}/${mfile}" nginx.service
+ ;;
+ *.initd)
+ exeinto /etc/init.d
+ newexe "${FILESDIR}/${mfile}" nginx
+ ;;
+ *.confd)
+ insinto /etc/conf.d
+ newins "${FILESDIR}/${mfile}" nginx
+ ;;
+ *.logrotate)
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/${mfile}" nginx
+ ;;
+ *.tmpfiles)
+ newtmpfiles "${FILESDIR}/${mfile}" "${PN}-tmp.conf"
+ ;;
+ *)
+ die "Unknown file in NGINX_MISC_FILES: ${mfile}. Please file a bug"
+ ;;
+ esac
+ done
+
+ # Install vimfiles from 'contrib/vim'.
+ insinto /usr/share/vim/vimfiles
+ doins -r contrib/vim/*
+
+ if in_iuse nginx_modules_http_perl && use nginx_modules_http_perl; then
+ perl_delete_module_manpages
+ perl_delete_localpod
+ perl_fix_packlist
+ fi
+
+ # For the rationale of the following, see nginx-module.eclass.
+ if use modules; then
+ # Install the headers into /usr/include/nginx.
+ insinto /usr/include/nginx
+ doins -r src/*
+ find "${ED}/usr/include/nginx" -type f -not -name '*.h' -delete ||
+ die "find failed"
+ find "${ED}/usr/include/nginx" -type d -empty -delete ||
+ die "find failed"
+ # Install the auto-generated headers with #define's to not handle the
+ # saving and restoration of configuration flags. This is needed for the
+ # compilation of dynamic modules, since NGINX does not guarantee API
+ # stability.
+ insinto /usr/include/nginx
+ doins build/ngx_auto_{config,headers}.h
+ # The directory where third-party modules should save their own headers.
+ keepdir /usr/include/nginx/modules
+
+ # Allow pluging arbitrary libraries (linker flags, more accurately) via
+ # the _NGINX_GENTOO_MOD_LIBS environment variable.
+ sed -i -e '/"$ngx_module_link" = DYNAMIC/ a\' \
+ -e 'ngx_module_libs="$ngx_module_libs ${_NGINX_GENTOO_MOD_LIBS}"' \
+ auto/module || die "sed failed"
+
+ # Copy the build system of NGINX to /usr/src/nginx.
+ insinto /usr/src/nginx
+ doins -r auto
+
+ # Disable several checks if the _NGINX_GENTOO_SKIP_PHASES variable is
+ # set to a non-empty value during the invocation of ./configure script.
+ # This is done since (1) these scripts do not have any effect on the
+ # build process of third-party modules and (2) they considerably
+ # increase configuration time.
+ sed -E -i \
+ 's#^\s*\. auto/(unix|lib/conf|headers|summary)$# \
+ [ -z "${_NGINX_GENTOO_SKIP_PHASES}" ] \&\& &#' \
+ configure || die "sed failed"
+
+ # The last statement in ./configure is [ -z "${_NGINX_GENTOO... ]. If
+ # _NGINX_GENTOO_SKIP_PHASES is non-empty, it evaluates to false and the
+ # whole ./configure script exits with a non-zero exit status. 'exit 0'
+ # is appended to the end of the script to always exit with a zero exit
+ # status, regardless of what the last statement evaluates to.
+ echo 'exit 0' >> configure || die "echo failed"
+ exeinto /usr/src/nginx
+ doexe configure
+
+ # Install the @nginx-module-rebuild set, which groups all the packages
+ # that have NGINX in BDEPEND, i.e. third-party modules.
+ insinto /usr/share/portage/config/sets
+ newins - nginx-modules.conf <<- EOF
+ [nginx-modules-rebuild]
+ class = portage.sets.dbapi.VariableSet
+ variable = BDEPEND
+ includes = ${CATEGORY}/${PN}
+ EOF
+ fi
+}
+
+# @FUNCTION: nginx_pkg_postinst
+# @DESCRIPTION:
+# Shows various warnings and informational messages to a user. Calls
+# tmpfiles_process() to process the installed tmpfiles.
+nginx_pkg_postinst() {
+ debug-print-function "${FUNCNAME[0]}" "$@"
+ if use modules && [[ ${NGINX_UPDATE_STREAM} == live &&
+ ${REPLACING_VERSIONS} == *9999* ]]; then
+ ewarn "The live NGINX package is used with modules enabled."
+ elog "NGINX does not have a stable API or ABI, therefore it is"
+ elog "necessary for the exact version used to compile a module"
+ elog "to match the one used at runtime to load the module."
+ elog "To be able to use NGINX modules compiled against the"
+ elog "previous version of NGINX, they must be rebuilt manually."
+ elog "Run 'emerge @nginx-module-rebuild' to rebuild all NGINX modules."
+ fi
+ local file
+ for file in "${NGINX_MISC_FILES[@]}"; do
+ if [[ ${file} == *.tmpfiles ]]; then
+ # NGINX wrtites to /var/tmp/nginx as root during startup, therefore
+ # we abuse tmpfiles_process to pass the '--remove' option.
+ # This is done in order to clean possibly non-empty /var/tmp/nginx
+ # directory in world-writable /var/tmp.
+ tmpfiles_process --remove "${PN}-tmp.conf"
+ break
+ fi
+ done
+}
+
+fi
+
+EXPORT_FUNCTIONS pkg_setup src_unpack src_configure src_compile src_test \
+ src_install pkg_postinst
--
2.45.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-dev] [PATCH v3 02/40] dev-perl/Test-Nginx: new package, add 0.30
2025-02-21 16:07 [gentoo-dev] [PATCH v3 00/40] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass Zurab Kvachadze
2025-02-21 16:07 ` [gentoo-dev] [PATCH v3 01/40] nginx.eclass: Add new eclass for building the NGINX server Zurab Kvachadze
@ 2025-02-21 16:07 ` Zurab Kvachadze
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 03/40] nginx-module.eclass: Add new eclass for building NGINX external modules Zurab Kvachadze
` (38 subsequent siblings)
40 siblings, 0 replies; 42+ messages in thread
From: Zurab Kvachadze @ 2025-02-21 16:07 UTC (permalink / raw
To: gentoo-dev; +Cc: Zurab Kvachadze
The Test::Nginx Perl module is a testing framework utilised by various
third party NGINX modules, mainly developed by OpenResty.
Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
---
dev-perl/Test-Nginx/Manifest | 1 +
dev-perl/Test-Nginx/Test-Nginx-0.30.ebuild | 36 ++++++++++++++
...inx-0.30-preset-temp_path-directives.patch | 38 +++++++++++++++
...est-Nginx-0.30-set-default-error-log.patch | 48 +++++++++++++++++++
.../Test-Nginx}/metadata.xml | 4 +-
5 files changed, 126 insertions(+), 1 deletion(-)
create mode 100644 dev-perl/Test-Nginx/Manifest
create mode 100644 dev-perl/Test-Nginx/Test-Nginx-0.30.ebuild
create mode 100644 dev-perl/Test-Nginx/files/Test-Nginx-0.30-preset-temp_path-directives.patch
create mode 100644 dev-perl/Test-Nginx/files/Test-Nginx-0.30-set-default-error-log.patch
copy {app-pda/usbmuxd => dev-perl/Test-Nginx}/metadata.xml (72%)
diff --git a/dev-perl/Test-Nginx/Manifest b/dev-perl/Test-Nginx/Manifest
new file mode 100644
index 000000000000..6c3ed06f65c2
--- /dev/null
+++ b/dev-perl/Test-Nginx/Manifest
@@ -0,0 +1 @@
+DIST Test-Nginx-0.30.tar.gz 131437 BLAKE2B 3f1ac14124059ba45d6bbb0f921d2b0c58790a1150f33c23a7dbfaf8ae14118fc7fc42df249362e566c9862ea3a84a58ae75066a041f6e65d36f78a951ecd222 SHA512 3a6727e567a213872f2ec6b0d782f40d867714787811911bf1637e76abcb3511c446b87e8a93106cf1473f2e49ebe375a2382658b8600a65cb8c3940cc0fa178
diff --git a/dev-perl/Test-Nginx/Test-Nginx-0.30.ebuild b/dev-perl/Test-Nginx/Test-Nginx-0.30.ebuild
new file mode 100644
index 000000000000..a8f136f809e6
--- /dev/null
+++ b/dev-perl/Test-Nginx/Test-Nginx-0.30.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DIST_AUTHOR=AGENT
+inherit perl-module
+
+DESCRIPTION="Data-driven test scaffold for NGINX and OpenResty"
+
+LICENSE="BSD"
+
+SLOT="0"
+
+# The following packages in the dev-perl category provide the required Perl
+# modules that Test-Nginx depends on:
+# (1) libwww-perl provides LWP::UserAgent,
+# (2) HTTP-Message provides HTTP::Response,
+# (3) URI provides URI::Escape.
+RDEPEND="
+ dev-perl/HTTP-Message
+ dev-perl/IPC-Run
+ dev-perl/List-MoreUtils
+ dev-perl/Test-Base
+ dev-perl/Test-LongString
+ dev-perl/Text-Diff
+ dev-perl/libwww-perl
+ virtual/perl-ExtUtils-MakeMaker
+ virtual/perl-File-Temp
+ virtual/perl-Time-HiRes
+"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-0.30-preset-temp_path-directives.patch"
+ "${FILESDIR}/${PN}-0.30-set-default-error-log.patch"
+)
diff --git a/dev-perl/Test-Nginx/files/Test-Nginx-0.30-preset-temp_path-directives.patch b/dev-perl/Test-Nginx/files/Test-Nginx-0.30-preset-temp_path-directives.patch
new file mode 100644
index 000000000000..a8a66bb48d67
--- /dev/null
+++ b/dev-perl/Test-Nginx/files/Test-Nginx-0.30-preset-temp_path-directives.patch
@@ -0,0 +1,38 @@
+From 2ab64d371acfed9189656b3fd099c2747209c98f Mon Sep 17 00:00:00 2001
+From: Zurab Kvachadze <zurabid2016@gmail.com>
+Date: Wed, 12 Feb 2025 13:38:44 +0100
+Subject: [PATCH] Util.pm: preset *temp_path directives to subdirectoroes of
+ servroot
+
+This avoids errors when NGINX, launched as non-root, tries writing
+various temporary files into default compiled-in directoroes that is
+only writable by root.
+
+This commit sets the directives that control where the temp files are
+saved, to point to a subdirectory of the temporary testing server root,
+which is writable by the user executing NGINX.
+
+Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
+---
+ lib/Test/Nginx/Util.pm | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/lib/Test/Nginx/Util.pm b/lib/Test/Nginx/Util.pm
+index 1d4aa38..1af9277 100644
+--- a/lib/Test/Nginx/Util.pm
++++ b/lib/Test/Nginx/Util.pm
+@@ -1168,6 +1168,11 @@ _EOC_
+ $main_config
+
+ http {
++ client_body_temp_path $ServRoot/client_body_temp;
++ proxy_temp_path $ServRoot/proxy_temp;
++ fastcgi_temp_path $ServRoot/fastcgi_temp;
++ scgi_temp_path $ServRoot/scgi_temp;
++ uwsgi_temp_path $ServRoot/uwsgi_temp;
+ access_log $AccLogFile;
+ #access_log off;
+
+--
+2.45.3
+
diff --git a/dev-perl/Test-Nginx/files/Test-Nginx-0.30-set-default-error-log.patch b/dev-perl/Test-Nginx/files/Test-Nginx-0.30-set-default-error-log.patch
new file mode 100644
index 000000000000..192ee59b4123
--- /dev/null
+++ b/dev-perl/Test-Nginx/files/Test-Nginx-0.30-set-default-error-log.patch
@@ -0,0 +1,48 @@
+From a105fc2a543d1136c6c747c1c2d1fd905ab9389f Mon Sep 17 00:00:00 2001
+From: Zurab Kvachadze <zurabid2016@gmail.com>
+Date: Thu, 13 Feb 2025 02:29:05 +0100
+Subject: [PATCH] Util.pm: specify error log on command line
+
+When no error log is specified on the command line, NGINX logs errors to
+the compiled-in error log (irrespective of whether the error log is
+specified in the configuration file), which is most often writable only
+by root. When tests are run as unprivileged user, NGINX can not write
+the log file and, therefore, fails to start.
+
+This commit makes Test::Nginx set the error log to standard error no
+configuration file is specified, or to $ServRoot/logs/error.log when the
+configuration file is specified, thus overriding the default path.
+
+Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
+---
+ lib/Test/Nginx/Util.pm | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/lib/Test/Nginx/Util.pm b/lib/Test/Nginx/Util.pm
+index 1af9277..41c6061 100644
+--- a/lib/Test/Nginx/Util.pm
++++ b/lib/Test/Nginx/Util.pm
+@@ -1292,7 +1292,7 @@ sub get_canon_version_for_OpenSSL (@) {
+ }
+
+ sub get_nginx_version () {
+- my $out = `$NginxBinary -V 2>&1`;
++ my $out = `$NginxBinary -e stderr -V 2>&1`;
+ if (!defined $out || $? != 0) {
+ $out //= "";
+ bail_out("Failed to get the version of the Nginx in PATH: $out");
+@@ -2049,9 +2049,9 @@ start_nginx:
+ my $cmd;
+
+ if ($NginxVersion >= 0.007053) {
+- $cmd = "$NginxBinary -p $ServRoot/ -c $ConfFile > /dev/null";
++ $cmd = "$NginxBinary -e $ServRoot/logs/error.log -p $ServRoot/ -c $ConfFile > /dev/null";
+ } else {
+- $cmd = "$NginxBinary -c $ConfFile > /dev/null";
++ $cmd = "$NginxBinary -e $ServRoot/logs/error.log -c $ConfFile > /dev/null";
+ }
+
+ if (defined $block->suppress_stderr) {
+--
+2.45.3
+
diff --git a/app-pda/usbmuxd/metadata.xml b/dev-perl/Test-Nginx/metadata.xml
similarity index 72%
copy from app-pda/usbmuxd/metadata.xml
copy to dev-perl/Test-Nginx/metadata.xml
index d8e789b30263..6ca2fdd412ec 100644
--- a/app-pda/usbmuxd/metadata.xml
+++ b/dev-perl/Test-Nginx/metadata.xml
@@ -10,6 +10,8 @@
<name>Proxy Maintainers</name>
</maintainer>
<upstream>
- <remote-id type="github">libimobiledevice/usbmuxd</remote-id>
+ <remote-id type="github">openresty/test-nginx</remote-id>
+ <remote-id type="cpan">Test-Nginx</remote-id>
+ <remote-id type="cpan-module">Test::Nginx</remote-id>
</upstream>
</pkgmetadata>
--
2.45.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-dev] [PATCH v3 03/40] nginx-module.eclass: Add new eclass for building NGINX external modules
2025-02-21 16:07 [gentoo-dev] [PATCH v3 00/40] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass Zurab Kvachadze
2025-02-21 16:07 ` [gentoo-dev] [PATCH v3 01/40] nginx.eclass: Add new eclass for building the NGINX server Zurab Kvachadze
2025-02-21 16:07 ` [gentoo-dev] [PATCH v3 02/40] dev-perl/Test-Nginx: new package, add 0.30 Zurab Kvachadze
@ 2025-02-21 16:08 ` Zurab Kvachadze
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 04/40] profiles/arch/powerpc/ppc64: mask tests for www-servers/nginx Zurab Kvachadze
` (37 subsequent siblings)
40 siblings, 0 replies; 42+ messages in thread
From: Zurab Kvachadze @ 2025-02-21 16:08 UTC (permalink / raw
To: gentoo-dev; +Cc: Zurab Kvachadze
Currently, it is impossible for NGINX external modules to be packaged
on their own, separately from the NGINX ebuild. The nginx-module.eclass
enables packaging third party NGINX modules as any other software in the
Gentoo tree.
The eclass builds on the foundation provided by nginx.eclass.
NGINX modules are somewhat special in the way they are built. In
addition to (obviously) requiring NGINX headers, their build system is
the one of NGINX. Actually, they are intended to be built and installed
alongside the NGINX server, but, luckily, it is possible to succesfuly
build a module, given (1) the headers, (2) the build system and the
exact same (3) ./configure flags that have been used to configure NGINX
itself are present. The points (1) and (2) are taken for granted here,
as nginx.eclass takes care of them:
* headers are installed into /usr/include/nginx
* build system is installed into /usr/src/nginx
As for the (3) point, the configuration flags are recorder into
ngx_auto_config.h file as preprocessor #define's. The file is also saved
into /usr/include/nginx.
The build process undergoes in the ${WORKDIR}/nginx directory, which
has 3 symlinks:
* src/ -> /usr/include/nginx
* configure -> /usr/src/nginx/configure
* auto/ -> /usr/src/nginx/auto
The build is the exact same as building a module "in-tree": the
./configure script is called with the '--add-dynamic-module' flag. The
rest of the eclass is really simple; src_compile() executes 'make
modules' and src_install() installs the compiled shared objects into
/usr/$(get_libdir)/nginx/modules.
Closes: https://bugs.gentoo.org/573710
Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
---
eclass/nginx-module.eclass | 811 +++++++++++++++++++++++++++++++++++++
1 file changed, 811 insertions(+)
create mode 100644 eclass/nginx-module.eclass
diff --git a/eclass/nginx-module.eclass b/eclass/nginx-module.eclass
new file mode 100644
index 000000000000..e21df3bea28f
--- /dev/null
+++ b/eclass/nginx-module.eclass
@@ -0,0 +1,811 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# @ECLASS: nginx-module.eclass
+# @MAINTAINER:
+# Zurab Kvachadze <zurabid2016@gmail.com>
+# @AUTHOR:
+# Zurab Kvachadze <zurabid2016@gmail.com>
+# @SUPPORTED_EAPIS: 8
+# @BLURB: Provides a common set of functions for building NGINX's dynamic modules
+# @DESCRIPTION:
+# The nginx-module.eclass automates configuring, building and installing NGINX's
+# dynamic modules. Using this eclass is as simple as calling 'inherit nginx-module'.
+# This eclass automatically adds dependencies on www-servers/nginx. Henceforth,
+# the terms 'package' and 'module' will be used interchangeably to refer to a
+# consumer of nginx-module.eclass.
+#
+# If a part of package's functionality depends on NGINX configuration (e.g. HMAC
+# generation support depending on http_ssl module being present), the
+# corresponding module's 'config' code should be changed so that the functionality
+# in question is either (1) unconditionally enabled/disabled or (2) could be
+# toggled by a USE flag. That is, an ebuild author should deduce whether a
+# package actually depends on a particular module or on the underlying
+# libraries/APIs. In the example HMAC case, the module actually requires
+# libcrypto, not the http_ssl module, so the ebuild code reflects this by
+# patching the module's 'config' file and depending on dev-libs/openssl directly
+# using the ngx_mod_append_libs() function.
+#
+# If the module makes use of the ngx_devel_kit (NDK) or any other NGINX
+# module, there are two approaches.
+#
+# If these dependencies are not USE-conditional ones, they should be specified
+# in the NGINX_MOD_LINK_MODULES array before inheriting the eclass. This way,
+# the dependencies added to {,R}DEPEND variables. Additionally, the package is
+# linked to shared objects of the specified dependencies. See the variable
+# description for details.
+#
+# If the dependencies are USE-conditional, they should be specified as
+# usual in the relevant *DEPEND variable(s). Then, before
+# nginx-module_src_configure() is called, the dependencies should be linked to by
+# calling the ngx_mod_link_module() function. See the function description for
+# more information.
+#
+# nginx-module.eclass also supports tests provided by the Test::Nginx Perl
+# module. To enable them, set NGINX_MOD_OPENRESTY_TESTS to a non-empty value
+# prior to inheriting the eclass and, if necessary, populate the
+# NGINX_MOD_TEST_LOAD_ORDER variable. All the packages specified in
+# NGINX_MOD_TEST_LOAD_ORDER are added to BDEPEND.
+#
+# The code below presents one of the ways the nginx-module.eclass might be used.
+#
+# Example usage:
+# @CODE
+# # This module depends on ngx_devel_kit and ngx-lua-module.
+# NGINX_MOD_LINK_MODULES=(
+# www-nginx/ngx_devel_kit www-nginx/ngx-lua-module
+# )
+#
+# # Tests utilise Test::Nginx.
+# NGINX_MOD_OPENRESTY_TESTS=1
+# # We require ngx-lua-module and ngx-echo for tests, but ngx-echo should
+# # be loaded first. Otherwise, some tests break.
+# NGINX_MOD_TEST_LOAD_ORDER=(
+# www-nginx/ngx-echo
+# www-nginx/ngx-lua-module
+# )
+# inherit nginx-module
+#
+# IUSE="iconv"
+#
+# DEPEND="iconv? ( www-nginx/ngx-iconv )"
+# RDEPEND="${DEPEND}"
+#
+# src_configure() {
+# if use iconv; Then
+# ngx_mod_link_module "www-nginx/ngx-iconv"
+# ...
+# fi
+#
+# nginx-module_src_configure
+# }
+# @CODE
+
+case ${EAPI} in
+ 8) ;;
+ *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
+esac
+
+if [[ -z ${_NGINX_MODULE_ECLASS} ]]; then
+_NGINX_MODULE_ECLASS=1
+
+inherit edo flag-o-matic toolchain-funcs
+
+#-----> Generic helper functions <-----
+
+# @FUNCTION: econf_ngx
+# @USAGE: [<args>...]
+# @DESCRIPTION:
+# Call ./configure, passing the supplied arguments.
+# The NGINX's build system consists of many helper scripts, which are executed
+# relative to the working directory. Therefore, the function only supports
+# executing the configure script from the current working directory. This
+# function also checks whether the script is executable. If any of the above
+# conditions are not satisfied, the function aborts the build process with
+# 'die'. It also fails if the script itself exits with a non-zero exit code,
+# unless the function is called with 'nonfatal'.
+# If running ./configure is required, this function should be called.
+econf_ngx() {
+ debug-print-function "${FUNCNAME[0]}" "$@"
+ [[ ! -x ./configure ]] &&
+ die "./configure is not present in the current working directory or is not executable"
+ # We do not use 'edo' here, as it does not quote its arguments when outputting
+ # to stderr. This makes it harder to differentiate boundaries between
+ # options that are supplied an argument containing whitespace.
+ #
+ # For example, if edo was used, the following Bash line:
+ # econf_ngx --with-cpp="gcc -E" --builddir=build
+ # would be printed to stderr as
+ # ./configure --with-cpp=gcc -E --builddir=build
+ # whilst the Bash's "${variable@Q}" syntax automatically quotes `variable`,
+ # producing the following result:
+ # ./configure '--with-cpp=gcc -E' '--builddir=build'
+ printf "%s\n" "./configure ${*@Q}" >&2
+ ./configure "$@"
+ # For some reason, NGINX's ./configure returns 1 if it is used with the
+ # '--help' argument.
+ if [[ $? -ne 0 && "$1" != --help ]]; then
+ die -n "./configure ${*@Q} failed"
+ fi
+}
+
+# @FUNCTION: ngx_mod_pkg_to_sonames
+# @USAGE: <package name>
+# @RETURN: Null-delimited list of basenames of shared objects corresponding to the supplied package.
+# @DESCRIPTION:
+# Takes one argument and prints a null-delimited list of basenames of shared
+# objects corresponding to the supplied package.
+#
+# The mapping between a package and shared objects goes as follows.
+#
+# 1. The package is stripped of category, yielding a plain
+# package name.
+#
+# 2. The plain package name is then used to lookup into the internal
+# associative array NGX_MOD_TO_SONAME. If the lookup fails, the build is
+# aborted with 'die'. 'nonfatal' might be used to make the error to find
+# shared objects non-fatal.
+#
+# 3. The obtained shared objects are printed to the stdout as a
+# null-delimited list.
+#
+# Example usage:
+# @CODE
+# # Obtain shared objects provided by www-nginx/ngx-lua-module.
+# mypkg=www-nginx/ngx-lua-module
+# mapfile -d '' lua-sonames < <(ngx_mod_pkg_to_sonames "${mypkg}")
+# @CODE
+ngx_mod_pkg_to_sonames() {
+ debug-print-function "${FUNCNAME[0]}" "$@"
+ [[ $# -ne 1 ]] && die "${FUNCNAME[0]} must receive exactly one argument"
+
+ local pkg="$1"
+ local dep_sonames
+
+ # Strip '${CATEGORY}/' from '${CATEGORY}/${PN}'.
+ local entry="${pkg#*/}"
+
+ # Obtain the name of the shared object of the package with PN '${entry}' by
+ # looking at the corresponding subscript of the NGX_MOD_TO_SONAME array.
+ #
+ # For example, entry=ngx-lua-module yields
+ # entry="${NGX_MOD_TO_SONAME[ngx-lua-module]}"
+ # which yields
+ # entry="ngx_http_lua_module"
+ entry="${NGX_MOD_TO_SONAME[${entry}]}"
+ [[ -z ${entry} ]] &&
+ die -n "No shared objects found for the dependency ${pkg}. Please file a bug"
+
+ # Read comma-separated shared object names into the 'dep_sonames' array.
+ IFS=, read -ra dep_sonames <<< "${entry}"
+ # Append '.so' to the end of each array member.
+ dep_sonames=( "${dep_sonames[@]/%/.so}" )
+
+ # Print null-delimited list of shared objects' basenames to stdout.
+ printf "%s\0" "${dep_sonames[@]}"
+}
+
+# @FUNCTION: ngx_mod_append_libs
+# @USAGE: [<linker flags>...]
+# @DESCRIPTION:
+# Adds the passed arguments to the list of flags used for the linking the
+# module's shared objects. Flags may be of any form accepted by linker.
+# See the nginx_src_install() function in nginx.eclass for more details.
+#
+# This function has no effect after nginx-module_src_configure() has been
+# called.
+#
+# Example usage:
+# @CODE
+# ngx_mod_append_libs "-L/usr/$(get_libdir)/nginx/modules" \
+# "$("$(tc-getPKG_CONFIG)" --libs luajit)"
+# @CODE
+ngx_mod_append_libs() {
+ debug-print-function "${FUNCNAME[0]}" "$@"
+ [[ $# -eq 0 ]] && return 0
+
+ export _NGINX_GENTOO_MOD_LIBS="${_NGINX_GENTOO_MOD_LIBS} $*"
+}
+
+# @FUNCTION: ngx_mod_setup_link_modules
+# @DESCRIPTION:
+# Adds necessary linker arguments for linking to other NGINX modules' share
+# objects installed in /usr/$(get_libdir)/nginx/modules by calling
+# ngx_mod_append_libs(). This function takes no arguments.
+#
+# This function is called internally by the ngx_mod_link_module() function.
+# ngx_mod_setup_link_modules() keeps track whether it has already been called,
+# doing nothing if it is called again after the first execution.
+ngx_mod_setup_link_modules() {
+ debug-print-function "${FUNCNAME[0]}"
+
+ # Check whether this function has already been called.
+ [[ -n ${_NGX_MOD_SETUP_LINK_CALLED} ]] && return 0
+ readonly _NGX_MOD_SETUP_LINK_CALLED=1
+
+ local moddir
+ moddir="${EPREFIX}/usr/$(get_libdir)/nginx/modules"
+ # Add 'moddir' to the list of directories search by linker.
+ ngx_mod_append_libs "-L${moddir}"
+
+ # The string passed to ngx_mod_append_libs undergoes the following
+ # transformations by NGINX build system (the str variable denotes the
+ # original string and 'modname' represents the name of the current module):
+ # 0. Given the value of 'str':
+ # $ echo "${str}"
+ # -Wl,-rpath,'\''\$\${ORIGIN}'\''
+ #
+ # 1. In auto/module, line 93:
+ # eval ${modname}_libs=\'$str\'.
+ # yields
+ # modname_libs='-Wl,-rpath,'\''\$\${ORIGIN}'\'''
+ # which can be logically separated into
+ # (a) '-Wl,-rpath,'
+ # ^
+ # |
+ # The first original single quote (\'$str\')
+ # ^
+ # |
+ # This one
+ # (b) \' (backslash-escaped semicolon)
+ # (c) '\$\${ORIGIN}'
+ # (d) \'
+ # (e) ''
+ # ^
+ # |
+ # The last original single quote (\'$str\')
+ # ^
+ # |
+ # This one
+ # To preserve the string we add literal ' and \' so that the
+ # ORIGIN part does not get expanded.
+ # - (a) expands to
+ # -Wl,-rpath
+ # - (b) expands to
+ # '
+ # - (c) expands to
+ # \$\${ORIGIN}
+ # - (d) expands to
+ # '
+ # - (e) expands to nothing
+ # Thus, after evaluating, the value of modname_libs is the
+ # following.
+ # $ echo "${modname_libs}"
+ # -Wl,-rpath,'\$\${ORIGIN}'
+ #
+ # 2. In auto/make, line 507:
+ # eval eval ngx_module_libs="\\\"\$${modname}_libs\\\"".
+ # The expansion of parameters and double quotes produces the
+ # following.
+ # \"$modname_libs\"
+ # The first outermost eval obtains the contents of the
+ # ${modname}_libs variable and encloses them in double quotes,
+ # yielding:
+ # eval ngx_module_libs="-Wl,-rpath,'\$\${ORIGIN}'"
+ # The second innermost eval expands the double-quoted string,
+ # produced by the first eval, stripping backslashes from '$'. The
+ # value of 'ngx_module_libs' is therefore:
+ # $ echo "${ngx_module_libs}"
+ # -Wl,-rpath,'$${ORIGIN}'
+ #
+ # 3. ngx_module_libs's contents are added to the Makefile. make
+ # expands $var variable references, double dollar is used to
+ # suppress the expanding. Thus, the following is passed to the
+ # shell:
+ # -Wl,-rpath,'${ORIGIN}'
+ #
+ # 4. Finally, shell expands the single quotes, yielding literal:
+ # -Wl,-rpath,${ORIGIN}
+ ngx_mod_append_libs "-Wl,-rpath,'\''"'\$\${ORIGIN}'"'\''"
+}
+
+# @FUNCTION: ngx_mod_link_module
+# @USAGE: <package name>
+# @DESCRIPTION:
+# Add the required linker flags to link to the shared objects provided by the
+# package passed as the argument. This function automatically calls
+# ngx_mod_setup_link_modules(), if it has not been called. If the specified
+# package provides more than one shared object, all of the shared objects are
+# linked to. As ngx_mod_append_libs(), this function has no effect after
+# nginx-module_src_configure has been called.
+#
+# This function uses the ngx_mod_pkg_to_sonames() function under the hood to map
+# package names to shared objects.
+#
+# This function might be used to implement USE-conditional dependency on another
+# NGINX module. See the code snipped below for an example of such usage.
+#
+# Example usage:
+# @CODE
+# inherit nginx-module
+#
+# DEPEND="iconv? ( www-nginx/ngx-iconv )"
+# RDEPEND="${DEPEND}"
+#
+# src_configure() {
+# if use iconv; then
+# ngx_mod_link_module "www-nginx/ngx-iconv"
+# ...
+# fi
+#
+# nginx-module_src_configure
+# }
+# @CODE
+ngx_mod_link_module() {
+ debug-print-function "${FUNCNAME[0]}" "$@"
+ [[ $# -ne 1 ]] && die "${FUNCNAME[0]} must receive exactly one argument"
+
+ [[ -z ${_NGX_MOD_SETUP_LINK_CALLED} ]] && ngx_mod_setup_link_modules
+
+ # Obtain the shared objects names of the module we want to link to (yes,
+ # there might be more than one shared object for a given NGINX module).
+ local -a sonames
+ mapfile -d '' sonames < <(ngx_mod_pkg_to_sonames "$1")
+
+ # Prepend '-l:' to each shared object name. The colon instructs the linker
+ # to link to the given name literally; i.e. '-lmylib' will look for
+ # 'libmylib.so', while '-l:mylib' will look for 'mylib'.
+ ngx_mod_append_libs "${sonames[@]/#/-l:}"
+}
+
+#-----> ebuild-defined variables <-----
+
+# @ECLASS_VARIABLE: NGINX_MOD_S
+# @DESCRIPTION:
+# Holds the path to the module sources directory, used in the
+# nginx-module_src_configure() phase function. If unset at the time of inherit,
+# defaults to ${S}.
+: "${NGINX_MOD_S=${S}}"
+
+# The ${S} variable is set to the path of the directory where the actual build
+# will be performed. In this directory, symbolic links to NGINX's build system
+# and NGINX's headers are created by the nginx-module_src_unpack() phase
+# function.
+S="${WORKDIR}/nginx"
+
+# @ECLASS_VARIABLE: NGINX_MOD_SHARED_OBJECTS
+# @OUTPUT_VARIABLE
+# @DESCRIPTION:
+# An array containing the basenames of all compiled shared objects (with the
+# extension ".so"). For some modules, may consist of more than one shared
+# object.
+#
+# This variable is set in the nginx-module_src_compile() function. Its contents
+# are undefined before that.
+#
+# Example value:
+# @CODE
+# ngx_http_lua_module.so
+# @CODE
+
+# @ECLASS_VARIABLE: NGX_MOD_TO_SONAME
+# @DESCRIPTION:
+# An associative array that maps NGINX module package names to their shared
+# object names. For example, 'ngx-lua-module' is mapped to
+# 'ngx_http_lua_module'. The shared objects are specified without the '.so'
+# suffix. May be changed/appended to at any time by an ebuild to override/add
+# shared object mappings.
+declare -A NGX_MOD_TO_SONAME+=(
+ [ngx_devel_kit]=ndk_http_module
+ [ngx-lua-module]=ngx_http_lua_module
+ [ngx-xss]=ngx_http_xss_filter_module
+ [ngx-echo]=ngx_http_echo_module
+ [ngx-memc]=ngx_http_memc_module
+ [ngx-eval]=ngx_http_eval_module
+ [ngx-set-misc]=ngx_http_set_misc_module
+ [ngx-headers-more]=ngx_http_headers_more_filter_module
+ [ngx-iconv]=ngx_http_iconv_module
+ [ngx-srcache]=ngx_http_srcache_filter_module
+ [ngx-lua-upstream]=ngx_http_lua_upstream_module
+)
+
+# @ECLASS_VARIABLE: NGINX_MOD_LINK_MODULES
+# @PRE_INHERIT
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Set to package names of the NGINX module dependencies of this module. This
+# array must be set prior to inheriting the eclass.
+#
+# All the modules specified in this array are added to DEPEND and RDEPEND. This
+# might be disabled by setting NGINX_MOD_OVERRIDE_LINK_DEPEND to a non-empty
+# value. Additionally, the listed modules are added to the NEEDED sections of
+# the current module's shared objects, i.e. the current module is dynamically
+# linked to the shared objects corresponding to packages specified in
+# NGINX_MOD_LINK_MODULES.
+#
+# Each element of the array specifies a dependency of an ebuild. An entry
+# consists of a category followed by a package name: ${CATEGORY}/${PN}.
+#
+# To determine the shared object corresponding to an entry, the eclass looks up
+# the respective mapping, specified in the NGX_MOD_TO_SONAME array (see the
+# array description for more information). If no match is found, the build is
+# aborted with 'die'.
+#
+# Example usage:
+# @CODE
+# # This module depends on both NDK and ngx-lua-module.
+# NGINX_MOD_LINK_MODULES=(
+# www-nginx/ngx_devel_kit
+# www-nginx/ngx-lua-module
+# )
+# inherit nginx-module
+# @CODE
+
+# @ECLASS_VARIABLE: NGINX_MOD_OVERRIDE_LINK_DEPEND
+# @PRE_INHERIT
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Set to a non-empty value prior to inheriting the eclass so that the modules
+# listed in NGINX_MOD_LINK_MODULES are not automatically added to DEPEND and
+# RDEPEND.
+
+# @ECLASS_VARIABLE: NGINX_MOD_OPENRESTY_TESTS
+# @PRE_INHERIT
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Set to non-empty value to enable prior to inheriting the eclass to enable the
+# tests via the Test::Nginx (dev-perl/Test-Nginx) testing scaffold. See the
+# description of the NGINX_MOD_TEST_LOAD_ORDER variable for more details.
+
+# @ECLASS_VARIABLE: NGINX_MOD_TEST_DIR
+# @DESCRIPTION:
+# Set to directory containing tests relative to NGINX_MOD_S. If
+# NGINX_MOD_OPENRESTY_TESTS is not set, has no effect. Defaults to "t".
+: "${NGINX_MOD_TEST_DIR:=t}"
+
+# @ECLASS_VARIABLE: NGINX_MOD_TEST_LOAD_ORDER
+# @PRE_INHERIT
+# @DESCRIPTION:
+# If NGINX_MOD_OPENRESTY_TESTS is set to a non-empty value, this array specifies
+# simultaneously the test dependencies of the current module and, since NGINX is
+# sensitive to the order of module loading, their load order. As a special
+# workaround, the current module could also be specified as an entry in order to
+# force a specific load order. If the current module is not listed in this
+# array, it is loaded first, before its test dependencies.
+#
+# All the modules specified in this array, barring the current module, are added
+# to test BDEPEND. This behaviour may be disabled by setting the
+# NGINX_MOD_OVERRIDE_TEST_BDEPEND variable to a non-empty value.
+#
+# The format of each entry is the same as in the NGINX_MOD_LINK_MODULES
+# variable. See its description for details.
+#
+# The shared object names obtained from each entry are then used to populate the
+# TEST_NGINX_LOAD_MODULES environment variable. TEST_NGINX_LOAD_MODULES
+# instructs Test::Nginx in what order and which shared objects should be loaded
+# during tests.
+#
+# This array must be set prior to inheriting the eclass. If
+# NGINX_MOD_OPENRESTY_TESTS is not set, this variable has no effect.
+#
+# Example:
+# @CODE
+# NGINX_MOD_OPENRESTY_TESTS=1
+# NGINX_MOD_TEST_LOAD_ORDER=(
+# www-nginx/ngx-lua-module www-nginx/ngx-eval
+# www-nginx/{my-cool-module,my-another-module}
+# )
+# @CODE
+
+# @ECLASS_VARIABLE: NGINX_MOD_OVERRIDE_TEST_BDEPEND
+# @PRE_INHERIT
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Set to a non-empty value prior to inheriting the eclass so that the modules
+# listed in NGINX_MOD_TEST_LOAD_ORDER are not automatically added to BDEPEND.
+# Has no effect if either NGINX_MOD_OPENRESTY_TESTS or NGINX_MOD_TEST_LOAD_ORDER
+# are not set.
+
+#-----> *DEPEND stuff <-----
+
+# As per upstream documentation, modules must be rebuilt with each NGINX
+# upgrade.
+DEPEND="
+ www-servers/nginx:=[modules(-)]
+"
+BDEPEND="${DEPEND}"
+RDEPEND="${DEPEND}"
+
+if [[ -z ${NGINX_MOD_OVERRIDE_LINK_DEPEND} &&
+ ${#NGINX_MOD_LINK_MODULES[@]} -gt 0 ]];
+then
+ DEPEND+=" ${NGINX_MOD_LINK_MODULES[*]}"
+ RDEPEND+=" ${NGINX_MOD_LINK_MODULES[*]}"
+fi
+
+#-----> Tests setup <-----
+
+# @FUNCTION: _ngx_mod_set_test_env
+# @INTERNAL
+# @DESCRIPTION:
+# Sets global variables like IUSE and BDEPEND for tests.
+_ngx_mod_set_test_env() {
+ IUSE="test"
+ RESTRICT="!test? ( test )"
+ BDEPEND+=" test? (
+ dev-perl/Test-Nginx
+ virtual/perl-Test-Harness
+ )
+ "
+
+ if [[ -z ${NGINX_MOD_OVERRIDE_TEST_BDEPEND} &&
+ ${#NGINX_MOD_TEST_LOAD_ORDER[@]} -gt 0 ]];
+ then
+ local entry
+ local -a moddep=
+ for entry in "${NGINX_MOD_TEST_LOAD_ORDER[@]}"; do
+ # If the current entry is equal to the current package, do not add
+ # it to BDEPEND.
+ [[ ${entry} == "${CATEGORY}/${PN}" ]] && continue
+
+ moddep+=( "${entry}" )
+ done
+ if [[ ${#moddep[@]} -gt 0 ]]; then
+ BDEPEND+="
+ test? (
+ ${moddep[*]}
+ )
+ "
+ fi
+ fi
+}
+
+[[ -n ${NGINX_MOD_OPENRESTY_TESTS} ]] && _ngx_mod_set_test_env
+
+unset -f _ngx_mod_set_test_env
+
+#-----> Phase functions <-----
+
+# @FUNCTION: nginx-module_src_unpack
+# @DESCRIPTION:
+# Unpacks the sources and sets up the build directory in S=${WORKDIR}/nginx.
+# Creates the following symbolic links (to not copy the files over):
+# - '${S}/src' -> '/usr/include/nginx',
+# - '${S}/auto' -> '/usr/src/nginx/auto',
+# - '${S}/configure' -> '/usr/src/nginx/configure'.
+# For additional information, see the nginx.eclass source, namely the
+# nginx_src_install() function.
+nginx-module_src_unpack() {
+ debug-print-function "${FUNCNAME[0]}" "$@"
+ default_src_unpack
+ mkdir nginx || die "mkdir failed"
+ ln -s "${BROOT}/usr/src/nginx/configure" nginx/configure || die "ln failed"
+ ln -s "${BROOT}/usr/src/nginx/auto" nginx/auto || die "ln failed"
+ ln -s "${ESYSROOT}/usr/include/nginx" nginx/src || die "ln failed"
+}
+
+# @FUNCTION: nginx-module_src_prepare
+# @DESCRIPTION:
+# Patches module's initialisation code so that any module's preprocessor
+# definitions appear in the separate '__ngx_gentoo_mod_config.h' file inside the
+# 'build' directory. This function also makes module's "config" script clear
+# whatever content build/ngx_auto_config.h may have at the time of invocation.
+# Then, default_src_prepare() is called.
+nginx-module_src_prepare() {
+ debug-print-function "${FUNCNAME[0]}" "$@"
+ pushd "${NGINX_MOD_S}" >/dev/null || die "pushd failed"
+ # Since NGINX does not guarantee ABI or API stability, we utilise
+ # preprocessor macros that were used to compile NGINX itself, to build third
+ # party modules. As such, we do not want for the dummy preprocessor macros
+ # produced by NGINX build system during module compilation to leak into the
+ # building environment. However, we do need to "capture" preprocessor macros
+ # set by the module itself, so we are required to somehow get these
+ # separately.
+ #
+ # To achieve that, the following sed script inserts ': >
+ # build/ngx_auto_config.h' line at the start of a module's 'config' shell
+ # script which gets sourced by NGINX build system midway during
+ # configuration. It has an effect of truncating the file containing NGINX
+ # preprocessor macros. This results in the file containing only module's
+ # macros at the end of the module's configuration.
+ #
+ # The following command renames the file with module's preprocessor macros
+ # to __ngx_gentoo_mod_config.h to be later merged with the system NGINX
+ # header into the actual header used during compilation. Due to the fact
+ # that executing the config shell script is not the last thing that NGINX
+ # build system does during configuration, we can not simply rename the
+ # header after the whole configuration, as it may contain other preprocessor
+ # macros than only the module's ones.
+ sed -i -e '1i\' -e ': > build/ngx_auto_config.h' config ||
+ die "sed failed"
+ echo 'mv build/ngx_auto_config.h build/__ngx_gentoo_mod_config.h' \
+ >> config || die "echo failed"
+ default_src_prepare
+ popd >/dev/null || die "popd failed"
+}
+
+# @FUNCTION: nginx-module_src_configure
+# @DESCRIPTION:
+# Configures the dynamic module by calling NGINX's ./configure script.
+# Custom flags can be supplied via the 'myconf' array, taking precedence over
+# eclass's flags.
+# This assembles ngx_auto_config.h from the system ngx_auto_config.h and
+# __ngx_gentoo_mod_config.h (see nginx-module_src_prepare()), and
+# ngx_auto_headers.h from the system ngx_auto_headers.h.
+# Also, sets environment variables and appends necessary libraries if
+# NGINX_MOD_LINK_MODULES is set.
+nginx-module_src_configure() {
+ debug-print-function "${FUNCNAME[0]}" "$@"
+ local ngx_mod_flags
+ ngx_mod_flags=(
+ --with-cc="$(tc-getCC)"
+ --with-cpp="$(tc-getCPP)"
+ # The '-isystem' flag is used instead of '-I', so as for the installed
+ # (system) modules' headers to be of lower priority than the headers of
+ # the currently built module. This only affects the modules that both
+ # come with and install their own headers, e.g. ngx_devel_kit.
+ --with-cc-opt="-isystem src/modules"
+ --with-ld-opt="${LDFLAGS}"
+ --builddir=build
+ --add-dynamic-module="${NGINX_MOD_S}"
+ )
+
+ # NGINX build system adds directories under src/ to the include path based
+ # on the specified configuration flags. Since nginx.eclass does not
+ # save/restore the configuration flags, we have to add the directories to
+ # the include path manually.
+ # The src/os is added automatically by the auto/unix script and the
+ # src/modules directory is included by the '--with-cc-opt' configuration
+ # flag.
+ append-cflags "$(find -H src -mindepth 1 -type d \! \( \( -path 'src/os' -o \
+ -path 'src/modules' \) -prune \) -printf '-I %p ')"
+
+ # Some NGINX modules that depend on ngx_devel_kit (NDK) check whether the
+ # NDK_SRCS variable is non-empty and error out if it is empty or not
+ # defined. ngx_devel_kit sets this variable during its build but due to the
+ # fact that we build modules separately, i.e. the dependant module is not
+ # build alongside NDK, the variable is not exported in the environment and
+ # the module halts the build.
+ #
+ # For all the modules that I have seen, the ones that inspect this variable
+ # only check whether NDK_SRCS is non-empty, they do not compare its contents
+ # nor alter the variable in any way. Therefore, setting NDK_SRCS to a dummy
+ # value works around the build failures for the plugins that do check the
+ # variable and, subsequently, has no effect on the modules that do not
+ # depend on NDK at all or do not check the variable.
+ #
+ # This variable is mainly checked by modules developed by OpenResty.
+ export NDK_SRCS="ndk.c"
+
+ # Add the required linking flags required for the modules specified in the
+ # NGINX_MOD_LINK_MODULES array.
+ if [[ ${#NGINX_MOD_LINK_MODULES[@]} -gt 0 ]]; then
+ local mod
+ for mod in "${NGINX_MOD_LINK_MODULES[@]}"; do
+ ngx_mod_link_module "${mod}"
+ done
+ fi
+
+ eval "local -a EXTRA_ECONF=( ${EXTRA_ECONF} )"
+
+ # Setting the required environment variable to skip the unnecessary
+ # execution of certain scripts (see nginx_src_install() in nginx.eclass).
+ _NGINX_GENTOO_SKIP_PHASES=1 econf_ngx \
+ "${ngx_mod_flags[@]}" \
+ "${myconf[@]}" \
+ "${EXTRA_ECONF[@]}"
+
+ cat "${ESYSROOT}/usr/include/nginx/ngx_auto_config.h" \
+ build/__ngx_gentoo_mod_config.h > build/ngx_auto_config.h ||
+ die "cat failed"
+ cp "${ESYSROOT}/usr/include/nginx/ngx_auto_headers.h" build ||
+ die "cp failed"
+}
+
+# @FUNCTION: nginx-module_src_compile
+# @DESCRIPTION:
+# Compiles the module(s) by calling "make modules" and fills the
+# NGINX_MOD_SHARED_OBJECTS array.
+nginx-module_src_compile() {
+ debug-print-function "${FUNCNAME[0]}" "$@"
+ emake modules
+ # Save the basenames of all the compiled modules into the
+ # NGINX_MOD_SHARED_OBJECTS array.
+ mapfile -d '' NGINX_MOD_SHARED_OBJECTS < \
+ <(find -H "${S}/build" -maxdepth 1 -type f -name '*.so' -printf '%P\0')
+}
+
+# @FUNCTION: nginx-module_src_test
+# @DESCRIPTION:
+# If NGINX_MOD_OPENRESTY_TESTS is set to a non-empty value, tests the compiled
+# module using Test::Nginx (dev-perl/Test-Nginx).
+nginx-module_src_test() {
+ debug-print-function "${FUNCNAME[0]}" "$@"
+ [[ -z ${NGINX_MOD_OPENRESTY_TESTS} ]] && return 0
+
+ # The TEST_NGINX_LOAD_MODULES variable holds the space-separated paths of
+ # modules that should be loaded during testing. The variable is set (in
+ # order) to the shared object names of the built modules and, then, to
+ # shared objects of the dependant modules. Doing this the other way around
+ # introduces some test failures for modules like ngx-eval.
+ local -x TEST_NGINX_LOAD_MODULES=
+ local -a dep_sonames pkg_sonames
+ local cur_pkg_in_load_order=
+
+ # The system module directory.
+ local moddir
+ moddir="${BROOT}/usr/$(get_libdir)/nginx/modules"
+
+ [[ ${#NGINX_MOD_SHARED_OBJECTS[@]} -eq 0 ]] &&
+ die "No shared objects found for the currently built module"
+ # Prepend each member of the NGINX_MOD_SHARED_OBJECTS array with
+ # '${S}/build/' and save the array into pkg_sonames.
+ pkg_sonames=( "${NGINX_MOD_SHARED_OBJECTS[@]/#/${S}/build/}" )
+
+ local pkg
+ for pkg in "${NGINX_MOD_TEST_LOAD_ORDER[@]}"; do
+ # If the entry is the current package, use the shared objects saved in
+ # '${pkg_sonames[@]}' and set the 'cur_pkg_in_load_order' variable.
+ if [[ ${pkg} == "${CATEGORY}/${PN}" ]]; then
+ TEST_NGINX_LOAD_MODULES+=" ${pkg_sonames[*]}"
+ cur_pkg_in_load_order=1
+ continue
+ fi
+
+ # Save the shared objects names into the dep_sonames array.
+ mapfile -d '' dep_sonames < <(ngx_mod_pkg_to_sonames "${pkg}")
+
+ # Prepend each array member with '${moddir}/' (see above) to obtain the
+ # absolute path to the shared object.
+ dep_sonames=( "${dep_sonames[@]/#/${moddir}/}" )
+
+ # Add the shared objects' paths to the TEST_NGINX_LOAD_MODULES
+ # environment variable.
+ TEST_NGINX_LOAD_MODULES+=" ${dep_sonames[*]}"
+ done
+ unset pkg
+
+ # If the current package is not specified in NGINX_MOD_TEST_LOAD_ORDER, load
+ # it before its test dependencies.
+ if [[ -z ${cur_pkg_in_load_order} ]]; then
+ TEST_NGINX_LOAD_MODULES="${pkg_sonames[*]} ${TEST_NGINX_LOAD_MODULES}"
+ fi
+
+ pushd "${NGINX_MOD_S}" >/dev/null || die "pushd failed"
+
+ # If NGINX_MOD_LINK_MODULES is non-empty, meaning the current module is
+ # linked to another module in moddir, set LD_LIBRARY_PATH to the module's
+ # directory so that the dynamic loader can find shared objects we depend on.
+ [[ ${#NGINX_MOD_LINK_MODULES[@]} -gt 0 ]] &&
+ local -x LD_LIBRARY_PATH="${moddir}"
+
+ # Tests break when run in parallel.
+ TEST_NGINX_SERVROOT="${T}/servroot" \
+ edo prove -j1 -I. -r ./"${NGINX_MOD_TEST_DIR}"
+
+ popd >/dev/null || die "popd failed"
+}
+
+# @FUNCTION: nginx-module_src_install
+# @DESCRIPTION:
+# Installs the compiled module(s) into /usr/${libdir}/nginx/modules.
+nginx-module_src_install() {
+ debug-print-function "${FUNCNAME[0]}" "$@"
+ insinto "/usr/$(get_libdir)/nginx/modules"
+ doins build/*.so
+}
+
+# @FUNCTION: nginx-module_pkg_postinst
+# @DESCRIPTION:
+# Shows the instructions on how to enable and use the just-compiled module.
+nginx-module_pkg_postinst() {
+ debug-print-function "${FUNCNAME[0]}" "$@"
+ # ngx_devel_kit is an SDK, it does not need to be enabled manually.
+ [[ ${PN} == ngx_devel_kit ]] && return 0
+
+ local mod
+
+ elog "${PN} has been compiled."
+ elog ""
+ elog "To utilise the module, add the following line(s) to your NGINX"
+ elog "configuration file, which by default is \"${EROOT}/etc/nginx/nginx.conf\"."
+ elog ""
+ for mod in "${NGINX_MOD_SHARED_OBJECTS[@]}"; do
+ elog " load_module modules/${mod};"
+ done
+}
+
+fi
+
+EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_test \
+ src_install pkg_postinst
--
2.45.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-dev] [PATCH v3 04/40] profiles/arch/powerpc/ppc64: mask tests for www-servers/nginx
2025-02-21 16:07 [gentoo-dev] [PATCH v3 00/40] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass Zurab Kvachadze
` (2 preceding siblings ...)
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 03/40] nginx-module.eclass: Add new eclass for building NGINX external modules Zurab Kvachadze
@ 2025-02-21 16:08 ` Zurab Kvachadze
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 05/40] profiles/arch/riscv: " Zurab Kvachadze
` (36 subsequent siblings)
40 siblings, 0 replies; 42+ messages in thread
From: Zurab Kvachadze @ 2025-02-21 16:08 UTC (permalink / raw
To: gentoo-dev; +Cc: Zurab Kvachadze
Tests require www-servers/uwsgi which is not keyworder for ppc64 yet.
Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
---
profiles/arch/powerpc/ppc64/package.use.mask | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/profiles/arch/powerpc/ppc64/package.use.mask b/profiles/arch/powerpc/ppc64/package.use.mask
index 826617e4557b..f7111844f25c 100644
--- a/profiles/arch/powerpc/ppc64/package.use.mask
+++ b/profiles/arch/powerpc/ppc64/package.use.mask
@@ -1,6 +1,10 @@
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
+# Zurab Kvachadze <zurabid2016@gmail.com> (2025-02-18)
+# www-servers/uwsgi, required for tests, is not keyworded on ppc64.
+www-servers/nginx test
+
# Michał Górny <mgorny@gentoo.org> (2024-12-24)
# OpenMP offloading is supported on 64-bit architectures only.
llvm-core/clang-runtime -offload
--
2.45.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-dev] [PATCH v3 05/40] profiles/arch/riscv: mask tests for www-servers/nginx
2025-02-21 16:07 [gentoo-dev] [PATCH v3 00/40] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass Zurab Kvachadze
` (3 preceding siblings ...)
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 04/40] profiles/arch/powerpc/ppc64: mask tests for www-servers/nginx Zurab Kvachadze
@ 2025-02-21 16:08 ` Zurab Kvachadze
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 06/40] www-servers/nginx: add myself as a proxy maintainer; update metadata.xml Zurab Kvachadze
` (35 subsequent siblings)
40 siblings, 0 replies; 42+ messages in thread
From: Zurab Kvachadze @ 2025-02-21 16:08 UTC (permalink / raw
To: gentoo-dev; +Cc: Zurab Kvachadze
Tests for www-servers/nginx require www-servers/uwsgi. uwsgi is not keyworded on
RISC-V.
Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
---
profiles/arch/riscv/package.use.mask | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/profiles/arch/riscv/package.use.mask b/profiles/arch/riscv/package.use.mask
index 5bb9427b613b..a1d6fd310e01 100644
--- a/profiles/arch/riscv/package.use.mask
+++ b/profiles/arch/riscv/package.use.mask
@@ -1,6 +1,10 @@
# Copyright 2019-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
+# Zurab Kvachadze <zurabid2016@gmail.com> (2025-02-18)
+# www-servers/uwsgi, required for tests, is not keyworded on riscv.
+www-servers/nginx test
+
# Alexey Shvetsov <alexxy@gentoo.org> (2024-11-21)
# sci-libs/caffe2 is not keyworded on arm64
sci-chemistry/gromacs nnpot
--
2.45.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-dev] [PATCH v3 06/40] www-servers/nginx: add myself as a proxy maintainer; update metadata.xml
2025-02-21 16:07 [gentoo-dev] [PATCH v3 00/40] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass Zurab Kvachadze
` (4 preceding siblings ...)
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 05/40] profiles/arch/riscv: " Zurab Kvachadze
@ 2025-02-21 16:08 ` Zurab Kvachadze
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 07/40] www-servers/nginx: add nginx.tmpfiles for managing /var/tmp/nginx Zurab Kvachadze
` (34 subsequent siblings)
40 siblings, 0 replies; 42+ messages in thread
From: Zurab Kvachadze @ 2025-02-21 16:08 UTC (permalink / raw
To: gentoo-dev; +Cc: Zurab Kvachadze
With this commit I am stepping up to maintain the www-servers/nginx
package.
In addition to changing the maintainer tags, this commit also makes the
following modifications to the metadata.xml:
1. Added longdescription from [1].
2. Changed descriptions for "aio", "http", "libatomic" USE flags.
3. Added descriptions for "debug", "mail" and "stream" USE flags.
These USE flags were introduced by nginx.eclass.
4. Add <doc>, <bugs-to> and <remote-id> elements under the <upstream>
element; update vendor in NGINX's CPE.
5. Remove all the <remote-id>'s, since they mention third party
modules, not NGINX itself.
[1]: https://nginx.org/en/
Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
---
www-servers/nginx/metadata.xml | 62 +++++++++++++++++++++++-----------
1 file changed, 42 insertions(+), 20 deletions(-)
diff --git a/www-servers/nginx/metadata.xml b/www-servers/nginx/metadata.xml
index 820efd9d7322..a41773eaa90b 100644
--- a/www-servers/nginx/metadata.xml
+++ b/www-servers/nginx/metadata.xml
@@ -1,24 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
- <!-- maintainer-needed -->
- <use>
- <flag name="aio">Enables file AIO support</flag>
- <flag name="http">Enable HTTP core support</flag>
- <flag name="http2">Enable HTTP2 module support</flag>
- <flag name="http3">Enable HTTP3 module support</flag>
- <flag name="http-cache">Enable HTTP cache support</flag>
- <flag name="ktls">Enable Kernel TLS offload (kTLS)</flag>
- <flag name="libatomic">Use libatomic instead of builtin atomic operations</flag>
- <flag name="pcre-jit">Enable JIT for pcre</flag>
- <flag name="pcre2">Enable support for pcre2</flag>
- <flag name="ssl">Enable HTTPS module for http. Enable SSL/TLS support for POP3/IMAP/SMTP for mail.</flag>
- <flag name="rtmp">NGINX-based Media Streaming Server</flag>
- </use>
- <upstream>
- <changelog>https://nginx.org/en/CHANGES</changelog>
- <remote-id type="github">openresty/memc-nginx-module</remote-id>
- <remote-id type="bitbucket">nginx-goodies/nginx-sticky-module-ng</remote-id>
- <remote-id type="cpe">cpe:/a:nginx:nginx</remote-id>
- </upstream>
+ <maintainer type="person" proxied="yes">
+ <email>zurabid2016@gmail.com</email>
+ <name>Zurab Kvachadze</name>
+ </maintainer>
+ <maintainer type="project" proxied="proxy">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <longdescription>
+ nginx [engine x] is an HTTP and reverse proxy server, a mail proxy server, and a generic
+ TCP/UDP proxy server, originally written by Igor Sysoev.
+ </longdescription>
+ <use>
+ <flag name="aio">Enable asynchronous I/O support</flag>
+ <flag name="debug">Enable support for debugging log</flag>
+ <flag name="http">Enable core HTTP support</flag>
+ <flag name="libatomic">
+ Use <pkg>dev-libs/libatomic_ops</pkg> instead of builtin atomic operations
+ </flag>
+ <flag name="mail">Enable POP3/IMAP4/SMTP mail proxy server</flag>
+ <flag name="stream">
+ Enable generic TCP/UDP proxying and load balancing
+ </flag>
+ <!-- NOTE: These are the USE flags for the legacy versions -->
+ <flag name="http2">Enable HTTP2 module support</flag>
+ <flag name="http3">Enable HTTP3 module support</flag>
+ <flag name="http-cache">Enable HTTP cache support</flag>
+ <flag name="ktls">Enable Kernel TLS offload (kTLS)</flag>
+ <flag name="pcre-jit">Enable JIT for pcre</flag>
+ <flag name="pcre2">Enable support for pcre2</flag>
+ <flag name="ssl">
+ Enable HTTPS module for http. Enable SSL/TLS support for POP3/IMAP/SMTP for mail.
+ </flag>
+ <flag name="rtmp">NGINX-based Media Streaming Server</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">nginx/nginx</remote-id>
+ <remote-id type="cpe">cpe:/a:f5:nginx</remote-id>
+ <doc>https://nginx.org/en/docs/</doc>
+ <changelog>https://nginx.org/en/CHANGES</changelog>
+ <bugs-to>https://github.com/nginx/nginx/issues</bugs-to>
+ </upstream>
</pkgmetadata>
--
2.45.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-dev] [PATCH v3 07/40] www-servers/nginx: add nginx.tmpfiles for managing /var/tmp/nginx
2025-02-21 16:07 [gentoo-dev] [PATCH v3 00/40] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass Zurab Kvachadze
` (5 preceding siblings ...)
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 06/40] www-servers/nginx: add myself as a proxy maintainer; update metadata.xml Zurab Kvachadze
@ 2025-02-21 16:08 ` Zurab Kvachadze
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 08/40] www-servers/nginx: add nginx-r5.initd Zurab Kvachadze
` (33 subsequent siblings)
40 siblings, 0 replies; 42+ messages in thread
From: Zurab Kvachadze @ 2025-02-21 16:08 UTC (permalink / raw
To: gentoo-dev; +Cc: Zurab Kvachadze
This places the burden on creating and cleaning /var/tmp/nginx in
world-writable /var/tmp on systemd-tmpfiles(8).
Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
---
www-servers/nginx/files/nginx.tmpfiles | 2 ++
1 file changed, 2 insertions(+)
create mode 100644 www-servers/nginx/files/nginx.tmpfiles
diff --git a/www-servers/nginx/files/nginx.tmpfiles b/www-servers/nginx/files/nginx.tmpfiles
new file mode 100644
index 000000000000..af9cdd26973f
--- /dev/null
+++ b/www-servers/nginx/files/nginx.tmpfiles
@@ -0,0 +1,2 @@
+D /var/tmp/nginx 0755 root root
+x /var/tmp/nginx
--
2.45.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-dev] [PATCH v3 08/40] www-servers/nginx: add nginx-r5.initd
2025-02-21 16:07 [gentoo-dev] [PATCH v3 00/40] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass Zurab Kvachadze
` (6 preceding siblings ...)
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 07/40] www-servers/nginx: add nginx.tmpfiles for managing /var/tmp/nginx Zurab Kvachadze
@ 2025-02-21 16:08 ` Zurab Kvachadze
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 09/40] www-servers/nginx: add nginx-r1.confd Zurab Kvachadze
` (32 subsequent siblings)
40 siblings, 0 replies; 42+ messages in thread
From: Zurab Kvachadze @ 2025-02-21 16:08 UTC (permalink / raw
To: gentoo-dev; +Cc: Zurab Kvachadze
This is the fifth revision of the init.d script for NGINX.
Starting with this commit, NGINX does not check its configuration twice
upon start and configuration reload (bug 481456). In the former case, if
any errors occur, the error message will be printed. This is not the
case with the reload() function though, as it is impossible to
programmatically check if it has succeeded.
Previously, the stop_post() function would block the termination of the
NGINX service from finishing successfuly by returning 1 after not being
able to remove the PID-file. This was caused due to the PID-file being
deleted before the code block in question got executed. This revision
removes this troublesome statement.
Bug: https://bugs.gentoo.org/481456
Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
---
www-servers/nginx/files/nginx-r5.initd | 112 +++++++++++++++++++++++++
1 file changed, 112 insertions(+)
create mode 100644 www-servers/nginx/files/nginx-r5.initd
diff --git a/www-servers/nginx/files/nginx-r5.initd b/www-servers/nginx/files/nginx-r5.initd
new file mode 100644
index 000000000000..35ace16ed36a
--- /dev/null
+++ b/www-servers/nginx/files/nginx-r5.initd
@@ -0,0 +1,112 @@
+#!/sbin/openrc-run
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+name="NGINX"
+description="Robust, small and high performance HTTP and reverse proxy server"
+description_configtest="Run NGINX's internal config check."
+description_upgrade="Upgrade the NGINX binary without losing connections."
+description_reload="Reload the NGINX configuration without losing connections."
+
+NGINX_CONFIGFILE=${NGINX_CONFIGFILE:-/etc/nginx/${RC_SVCNAME}.conf}
+NGINX_MAXWAITTIME=${NGINX_MAXWAITTIME:-3}
+
+command="/usr/sbin/nginx"
+start_stop_daemon_args=${NGINX_SSDARGS:-"--wait 1000"}
+pidfile=/run/${RV_SVCNAME}.pid
+user=${NGINX_USER:-nginx}
+group=${NGINX_GROUP:-nginx}
+retry=${NGINX_TERMTIMEOUT:-"TERM/60/KILL/5"}
+
+extra_commands="configtest"
+extra_started_commands="upgrade reload"
+
+depend() {
+ use net dns logger netmount
+}
+
+stop_pre() {
+ if [ "${RC_CMD}" = "restart" ]; then
+ configtest || return 1
+ fi
+}
+
+start() {
+ ebegin "Starting NGINX"
+ set -f
+ local output
+ output="$(start-stop-daemon --start --exec "${command}" -p "${pidfile}" \
+ ${start_stop_daemon_args} -- -c "${NGINX_CONFIGFILE}" -g "pid ${pidfile};" 2>&1)"
+ if ! eend $?; then
+ eerror "Failed to start NGINX, please have a look at its output below:"
+ # Delete the last line in a POSIX-compliant way because it contains
+ # "start-stop-daemon failed..."
+ printf '%s\n' "${output}" | sed '$d'
+ eerror "Starting NGINX failed, please correct the errors above"
+ return 1
+ else
+ if [ -n "${output}" ]; then
+ ewarn "NGINX has started successfuly, yet there are warnings:"
+ printf '%s\n' "${output}"
+ ewarn "Please take a notice of the warnings above"
+ fi
+ return 0
+ fi
+}
+
+
+reload() {
+ ebegin "Refreshing NGINX's configuration"
+ start-stop-daemon --signal SIGHUP --pidfile "${pidfile}"
+ eend $? "Failed to reload NGINX's configuration, please correct the errors above"
+}
+
+upgrade() {
+ einfo "Upgrading NGINX"
+ configtest || { eerror "Unable to upgrade NGINX: Configuration check failed";
+ return 1; }
+
+ einfo "Sending USR2 signal to the old binary"
+ start-stop-daemon --signal SIGUSR2 --pidfile "${pidfile}"
+
+ ebegin "Waiting up to ${NGINX_MAXWAITTIME} seconds for NGINX to upgrade"
+ local startdate pidfile_found
+ pidfile_found=0
+ endtime=$(("$(date +%s)" + NGINX_MAXWAITTIME))
+ while [ "$(date +%s)" -le "${endtime}" ]; do
+ if [ -f "${pidfile}" ] && [ -f "${pidfile}.oldbin" ]; then
+ pidfile_found=1
+ break
+ fi
+ sleep 1
+ done
+
+ [ "${pidfile_found}" = 1 ]
+ if ! eend $?; then
+ eerror "NGINX has failed to upgrade in time. This might have been caused either"
+ eerror "by a configuration error, uncaught by the configuration check, or, more"
+ eerror "likely, by NGINX taking more time to load the configuration than is"
+ eerror "allowed by the NGINX_MAXWAITTIME variable"
+ eerror "The maximum waiting time can be adjusted by setting the NGINX_MAXWAITTIME"
+ eerror "variable to a larger value in /etc/conf.d/nginx"
+ return 1
+ fi
+
+ einfo "Sending QUIT signal to the old binary"
+ start-stop-daemon --signal SIGQUIT --pidfile "${pidfile}.oldbin" ||
+ { eerror "The old NGINX binary may not have been stopped properly: Sending QUIT signal failed";
+ return 1; }
+
+ einfo "The upgrade has completed successfuly"
+}
+
+configtest() {
+ ebegin "Checking NGINX's configuration"
+ local output
+ output="$("${command}" -c "${NGINX_CONFIGFILE}" -t 2>&1)"
+ if ! eend $?; then
+ printf '%s\n' "${output}"
+ eerror "Configuration check failed, please correct the errors above"
+ return 1
+ fi
+}
--
2.45.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-dev] [PATCH v3 09/40] www-servers/nginx: add nginx-r1.confd
2025-02-21 16:07 [gentoo-dev] [PATCH v3 00/40] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass Zurab Kvachadze
` (7 preceding siblings ...)
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 08/40] www-servers/nginx: add nginx-r5.initd Zurab Kvachadze
@ 2025-02-21 16:08 ` Zurab Kvachadze
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 10/40] www-servers/nginx: add nginx-r2.service Zurab Kvachadze
` (31 subsequent siblings)
40 siblings, 0 replies; 42+ messages in thread
From: Zurab Kvachadze @ 2025-02-21 16:08 UTC (permalink / raw
To: gentoo-dev; +Cc: Zurab Kvachadze
This is the first revision of NGINX .confd file.
This removes the NGINX_PIDFILE configuration directive as it is now
unconditionally set to /run/${RV_SVCNAME}.pid.
Additionally, the NGINX_MAXWAITTIME variable has been added, which
configures the maximum amount of time for the upgrade() function to wait
for NGINX to start before producing an error.
Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
---
.../nginx/files/{nginx.confd => nginx-r1.confd} | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
copy www-servers/nginx/files/{nginx.confd => nginx-r1.confd} (80%)
diff --git a/www-servers/nginx/files/nginx.confd b/www-servers/nginx/files/nginx-r1.confd
similarity index 80%
copy from www-servers/nginx/files/nginx.confd
copy to www-servers/nginx/files/nginx-r1.confd
index 478ad588f4e4..35c0d102d432 100644
--- a/www-servers/nginx/files/nginx.confd
+++ b/www-servers/nginx/files/nginx-r1.confd
@@ -3,11 +3,6 @@
# Configuration file
#NGINX_CONFIGFILE="/etc/nginx/nginx.conf"
-# PID file
-# If you should ever change this, remember to update
-# "/etc/logrotate.d/nginx", too.
-#NGINX_PIDFILE="/run/nginx/nginx.pid"
-
# User to run nginx as
# If you should ever change this, make sure this user has
# execution permission on any of your log directories
@@ -31,5 +26,7 @@
# per default) when you are stopping the service.
#NGINX_TERMTIMEOUT="TERM/60/KILL/5"
-# Run master process as user (requires configuration with setcap)
-#command_user="${NGINX_USER:-nginx}"
+# For the 'upgrade' function, this defines the maximum amount of time (in
+# seconds) the script should wait for the new NGINX binary to start before
+# producing an error.
+#NGINX_MAXWAITTIME="3"
--
2.45.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-dev] [PATCH v3 10/40] www-servers/nginx: add nginx-r2.service
2025-02-21 16:07 [gentoo-dev] [PATCH v3 00/40] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass Zurab Kvachadze
` (8 preceding siblings ...)
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 09/40] www-servers/nginx: add nginx-r1.confd Zurab Kvachadze
@ 2025-02-21 16:08 ` Zurab Kvachadze
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 11/40] www-servers/nginx: add nginx-r2.logrotate Zurab Kvachadze
` (30 subsequent siblings)
40 siblings, 0 replies; 42+ messages in thread
From: Zurab Kvachadze @ 2025-02-21 16:08 UTC (permalink / raw
To: gentoo-dev; +Cc: Zurab Kvachadze
This is the second revision of the systemd service file for NGINX.
This commit removes redundant Exec{Stop,Reload} lines that restate the
systemd defaults and changes the ExecStartPre directive from "nginx -t"
(testing the NGINX configuration that is done anyway by the main
process, bug 481456) to "mkdir -p /var/tmp/nginx", making sure the
required directory for the NGINX temp files is present. ExecStopPost has
also been removed, since sleeping for 100 ms serves no purpose.
The second revision also changes the Exec* directives to use the plain
file names, instead of the absolute ones, per systemd.service(5)
guidelines:
> It is thus safe to use just the executable name in case of executables
> located in any of the "standard" directories, and an absolute path
> must be used in other cases.
Bug: https://bugs.gentoo.org/481456
Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
---
www-servers/nginx/files/nginx-r2.service | 11 +++++++++++
1 file changed, 11 insertions(+)
create mode 100644 www-servers/nginx/files/nginx-r2.service
diff --git a/www-servers/nginx/files/nginx-r2.service b/www-servers/nginx/files/nginx-r2.service
new file mode 100644
index 000000000000..c3afed7bea00
--- /dev/null
+++ b/www-servers/nginx/files/nginx-r2.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=The NGINX HTTP and reverse proxy server
+After=network.target remote-fs.target nss-lookup.target
+
+[Service]
+Type=forking
+PIDFile=/run/nginx.pid
+ExecStart=nginx
+
+[Install]
+WantedBy=multi-user.target
--
2.45.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-dev] [PATCH v3 11/40] www-servers/nginx: add nginx-r2.logrotate
2025-02-21 16:07 [gentoo-dev] [PATCH v3 00/40] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass Zurab Kvachadze
` (9 preceding siblings ...)
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 10/40] www-servers/nginx: add nginx-r2.service Zurab Kvachadze
@ 2025-02-21 16:08 ` Zurab Kvachadze
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 12/40] www-servers/nginx: add nginx-r4.conf Zurab Kvachadze
` (29 subsequent siblings)
40 siblings, 0 replies; 42+ messages in thread
From: Zurab Kvachadze @ 2025-02-21 16:08 UTC (permalink / raw
To: gentoo-dev; +Cc: Zurab Kvachadze
This is the second revision of the logrotate script for NGINX.
This changes the log files' names from /var/log/nginx/*_log to
/var/log/nginx/*.log, resembling the new nginx.eclass defaults (bug
700866).
The postrotate script was updated to use the "$()" construct for the
command substitution, instead of the legacy `backtick` one. The "kill"
utility now use a more POSIX-complying argument "-s singal_name",
replacing the XSI's "-signal_name".
Bug: https://bugs.gentoo.org/700866
Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
---
www-servers/nginx/files/nginx-r2.logrotate | 11 +++++++++++
1 file changed, 11 insertions(+)
create mode 100644 www-servers/nginx/files/nginx-r2.logrotate
diff --git a/www-servers/nginx/files/nginx-r2.logrotate b/www-servers/nginx/files/nginx-r2.logrotate
new file mode 100644
index 000000000000..1f16c41261cb
--- /dev/null
+++ b/www-servers/nginx/files/nginx-r2.logrotate
@@ -0,0 +1,11 @@
+# Copyright 1999-2025 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+/var/log/nginx/*.log {
+ missingok
+ delaycompress
+ sharedscripts
+ postrotate
+ test -r /run/nginx.pid && kill -s USR1 "$(cat /run/nginx.pid)"
+ endscript
+}
--
2.45.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-dev] [PATCH v3 12/40] www-servers/nginx: add nginx-r4.conf
2025-02-21 16:07 [gentoo-dev] [PATCH v3 00/40] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass Zurab Kvachadze
` (10 preceding siblings ...)
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 11/40] www-servers/nginx: add nginx-r2.logrotate Zurab Kvachadze
@ 2025-02-21 16:08 ` Zurab Kvachadze
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 13/40] profiles/desc: reword and update nginx_modules_http.desc Zurab Kvachadze
` (28 subsequent siblings)
40 siblings, 0 replies; 42+ messages in thread
From: Zurab Kvachadze @ 2025-02-21 16:08 UTC (permalink / raw
To: gentoo-dev; +Cc: Zurab Kvachadze
This is the fourth revision of the main configuration file of NGINX.
Thank you Torbjörn Lönnemark for reporting this!
This revision brings a lot of changes, mainly in terms of removed
directives (and yes, I will quote Torbjörn Lönnemark on this):
* worker_processes "1" -> "auto": it makes no sense to cap the
number of worker processes at 1, this commit makes the NGINX spawn
as many worker processes as there are CPU cores.
* remove "worker_connections 1024": 512 is the default value, no
reason to increase.
* remove "use epoll": NGINX already uses the most efficient polling
method available by default, no need to specify it explicitly.
Additionally, NGINX may even fail to start if epoll() is
unavailable on the system.
* remove "default_type application/octet-stream": arbitrary setting
with no obvious purpose, in some circumstances may even be
harmful, considering that the default value for this directive is
"text/plain".
* remove custom "log_format": needlessly diverges from the default
format, quoting Torbjörn Lönnemark:
> The only difference between this and the builtin 'combined' format
> is that it includes gzip_ratio, and gzip is disabled by default
> anyway. Can be removed while additionally replacing 'main' in the
> access_log directives to 'combined'
* remove "connection_pool_size 256", "client_header_buffer_size 1k"
and "large_client_header_buffers 4 2k": the connection_pool_size
directive sets the default value on 32-bit machines and overrides
the default value on 64-bit machines, client_body_buffer_size is 8
times less than the default value, the same applies to
large_client_header_buffers.
* remove "request_pool_size 4k", "gzip off", "tcp_nodelay on",
"ignore_invalid_headers on", "index index.html": they restate the
defaults.
* remove "client_header_timeout 10m", "client_body_timeout 10m",
"send_timeout 10m", "output_buffers 1 32k", "postpone_output
1460", "tcp_nopush off", "keepalive_timeout 75 20": the directives
override the defaults with no clear intent.
The "server" blocks have also been reworked. Due to www-servers/nginx
not installing anything into /var/www/localhost/htodcs, the root
directory for the default server will almost always be empty. Therefore,
the plaintext example server has had its "root" directive commented out.
For the SSL server, the removed-since-1.25.1 "ssl" directive has been
changed into an argument to the "listen" directive, as prescribed
upstream.
Bug: https://bugs.gentoo.org/928131
Bug: https://bugs.gentoo.org/576414
Reported-by: Torbjörn Lönnemark
Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
---
www-servers/nginx/files/nginx-r4.conf | 39 +++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
create mode 100644 www-servers/nginx/files/nginx-r4.conf
diff --git a/www-servers/nginx/files/nginx-r4.conf b/www-servers/nginx/files/nginx-r4.conf
new file mode 100644
index 000000000000..1144af3d7ceb
--- /dev/null
+++ b/www-servers/nginx/files/nginx-r4.conf
@@ -0,0 +1,39 @@
+user nginx nginx;
+worker_processes auto;
+
+events {
+ # NGINX refuses to start if the 'events' section is not present. Yet,
+ # NGINX does not seem to care whether this section is non-empty.
+}
+
+http {
+ # Maximum hash table size is increased to accommodate for a large
+ # mime.types file that is shipped on Gentoo.
+ types_hash_max_size 4096;
+ include /etc/nginx/mime.types.nginx;
+
+ sendfile on;
+
+ # Example server. Warning: by default, the /var/www/localhost directory is
+ # NOT created; for the following configuration block to work, the
+ # directory must be created manually.
+ server {
+ listen 127.0.0.1;
+ server_name localhost;
+
+ # Substitute the directory below for the one you use.
+ #root /var/www/localhost/htdocs;
+ }
+
+ # SSL server example.
+ #server {
+ #listen 127.0.0.1:443 ssl;
+ #server_name localhost;
+
+ #ssl_certificate /etc/ssl/nginx/nginx.pem;
+ #ssl_certificate_key /etc/ssl/nginx/nginx.key;
+
+ #root /var/www/localhost/htdocs;
+ #}
+
+}
--
2.45.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-dev] [PATCH v3 13/40] profiles/desc: reword and update nginx_modules_http.desc
2025-02-21 16:07 [gentoo-dev] [PATCH v3 00/40] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass Zurab Kvachadze
` (11 preceding siblings ...)
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 12/40] www-servers/nginx: add nginx-r4.conf Zurab Kvachadze
@ 2025-02-21 16:08 ` Zurab Kvachadze
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 14/40] profiles/desc: reword and update nginx_modules_mail.desc Zurab Kvachadze
` (27 subsequent siblings)
40 siblings, 0 replies; 42+ messages in thread
From: Zurab Kvachadze @ 2025-02-21 16:08 UTC (permalink / raw
To: gentoo-dev; +Cc: Zurab Kvachadze
The wording used in nginx_modules_http.desc to describe the USE flags
was rather inconsistent with how USE flags are described in Gentoo.
This commit features the following changes:
* The missing descriptions were added for the "ssl"[1],
"upstream_random", "v2"[1] and "v3"[1] modules.
* "This module does something" was changed to "Add support for
something" en masse, as is done elsewhere in Gentoo.
* The descriptions were brought in line with upstream[2] ones. For
many of them, the wording was modified to better (sometimes more
concisely) reflect their function.
* Update copyright and actually sort the modules!
[1]: Previously, these modules were not USE_EXPAND flags but rather USE
flags on their own. With the introduction of nginx.eclass, they become
NGINX_MODULES_HTTP USE_EXPAND flags, as the rest of NGINX modules are.
[2]: See "Module reference" at the bottom of https://nginx.org/en/docs/
Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
---
profiles/desc/nginx_modules_http.desc | 147 +++++++++++++-------------
1 file changed, 75 insertions(+), 72 deletions(-)
diff --git a/profiles/desc/nginx_modules_http.desc b/profiles/desc/nginx_modules_http.desc
index dd1d7ea38a95..ae7a6751599c 100644
--- a/profiles/desc/nginx_modules_http.desc
+++ b/profiles/desc/nginx_modules_http.desc
@@ -1,77 +1,80 @@
-# Copyright 1999-2018 Gentoo Foundation.
+# Copyright 1999-2025 Gentoo Authors.
# Distributed under the terms of the GNU General Public License v2
# This file contains descriptions of NGINX_MODULES_HTTP USE_EXPAND flags.
# Keep it sorted.
-access - This module provides a simple host-based access control.
-addition - This module adds contents of other locations before and after the current location's content.
-auth_basic - This module protects your site or parts of it with username and password based on HTTP Basic Authentication.
-auth_ldap - LDAP module for nginx which supports authentication against multiple LDAP servers.
-auth_pam - This module provides authentication via PAM.
-auth_request - Module implementing client authorization based on the result of a subrequest.
-autoindex - This module provides automatic directory listings.
-brotli - This module allows for on-the-fly Brotli compression.
-browser - This module creates variables, the values of which depend on the request header "User-agent".
-cache_purge - External module adding ability to purge content from nginx's FastCGI and proxy caches.
-charset - This module can reencode data of one encoding into another.
-dav - This module adds the HTTP and WebDAV methods PUT, DELETE, MKCOL, COPY and MOVE.
-dav_ext - Add missing WebDAV methods PROPFIND & OPTIONS to the existing WebDAV module.
-degradation - Allows to return 204 or 444 code for some locations on low memory condition (reliable on FreeBSD only)
-echo - Brings shell-style goodies to Nginx config file.
-empty_gif - This module keeps a 1x1 transparent GIF in memory that can be served very quickly.
-fancyindex - This module makes possible the generation of file listings, like the built-in autoindex module does, but adding a touch of style.
-fastcgi - This module allows Nginx to interact with FastCGI processes and control what parameters are passed to the process.
-flv - This module provides the ability to seek within FLV (Flash) files using time-based offsets.
-geo - This module creates variables, whose values depend on the IP-address of the client.
-geoip - This module creates variables based on the IP-address of the client matched against the MaxMind GeoIP binary files.
-geoip2 - This module creates variables based on the IP-address of the client matched against the MaxMind GeoIP2 binary files.
-grpc - This module provides gRPC support.
-gunzip - Permits to decompress gzip'ed files on-the-fly for clients not supporting the gzip encoding method.
-gzip - This module allows for on-the-fly gzip compression.
-gzip_static - Before serving a file from disk to a gzip-enabled client, this module will look for a precompressed file in the same location.
-headers_more - Set and clear input and output headers
-image_filter - This module is a filter for transforming JPEG, GIF and PNG images.
-javascript - This module implements location and variable handlers in nginScript.
-limit_conn - This module makes it possible to limit the number of simultaneous connections for the assigned session
-limit_req - This module allows you to limit the number of requests for a given session.
-limit_conn - This module makes it possible to limit the number of simultaneous connections for the assigned session
-lua - Embed the power of Lua into nginx
-map - This module allows you to classify, or map a set of values into a different set of values and store the result in a variable.
-memc - An extended version of the standard memcached module that supports set, add, delete, and many more memcached commands.
-memcached - You can use this module to perform simple caching.
-metrics - Module to export various metrics in easy-parseable JSON.
-mirror - This module implements mirroring of an original request by creating background mirror subrequests.
-mogilefs - Enable support for MogileFS.
-mp4 - This module adds pseudo-streaming
-naxsi - An open source, high performance, low rules maintenance, Web Application Firewall module for Nginx.
-perl - This module makes it possible to execute Perl directly within Nginx and call Perl via SSI.
-proxy - This module makes it possible to transfer requests to another server.
-push_stream - Push Stream module, supporting EventSource, WebSocket, Long Polling, and Forever Iframe.
-random_index - Pick a random directory index from a directory.
-realip - This module allows to change the client's IP address to value from request header (e. g. X-Real-IP or X-Forwarded-For).
-referer - This module makes it possible to block access to the site with the incorrect values of line "Referer" in the request header.
-rewrite - This module makes it possible to change URI using regular expressions (PCRE), and to redirect and select configuration depending on variables.
-scgi - An implementation of the Simple Common Gateway Interface.
-secure_link - This module computes and checks request URLs for a required security token.
-security - Web application firewall and Intrusion Detection System.
-slice - A filter that splits a request into subrequests, each returning a certain range of response
-slowfs_cache - This module adds the ability to cache static files
-split_clients - This module provides A/B testing support.
-ssi - This module provides a filter which processes Server-Side Includes (SSI) in the input.
-spdy - This module provides an SPDY implementation. (Deprecated, use IUSE="http2" instead)
-sticky - Module to always forward clients to the same upstream server (via sticky cookies)
-stub_status - This module provides the ability to get some status from nginx.
-sub - This module can search and replace text in the nginx response.
-upload_progress - This module adds the ability to track POST upload progress via JSON API
-upstream_check - Add health check support for upstream servers.
-upstream_hash - This module provides the ability to distribute upstream requests based on hashed key value.
-upstream_ip_hash - This module provides the ability to distribute upstream requests based on the IP-address of the client.
-upstream_keepalive - Thiis module provides the ability to cache connections to upstream servers.
-upstream_least_conn - This module provides the ability to distribute upstream requests using load balancing methods.
-upstream_zone - This module makes it possible to define a shared memory zone that keeps the group's configuration and run-time state that are shared between worker processes.
-userid - This module gives out cookies for identification of clients.
-uwsgi - External module for the uWSGI protocol for python web apps.
-vhost_traffic_status - This module provides access to virtual host status information.
-vod - Adds support for video streaming using DASH, HDS, HLS, MSS.
-xslt - This module is a filter which converts an XML response with the aid of one or more XSLT templates.
+access - Add support for a simple host-based access control
+addition - Add support for adding contents of other locations before and after the current location's content
+auth_basic - Add support for limiting access to a location by validating the username and password using the HTTP Basic Authentication
+auth_ldap - Add support for LDAP authentication module for NGINX
+auth_pam - Add support for authentication via PAM
+auth_request - Add support for client authorization based on the result of a subrequest
+autoindex - Add support for processing requests ending with the slash character ('/') and produciing a directory listing
+brotli - Add support for on-the-fly Brotli compression
+browser - Add support for creating variables whose values depend on the value of the "User-Agent" request header field
+cache_purge - Add support for purging content from NGINX's FastCGI and proxy caches
+charset - Add support for adding the specified charset to the "Content-Type" response header field and reencoding singe-byte charsets
+dav - Add support for the WebDAV functionality and methods: PUT, DELETE, MKCOL, COPY and MOVE
+dav_ext - Add support for the additional WebDAV methods into the existing WebDAV module: PROPFIND & OPTIONS
+degradation - Add support for returning 204 or 444 code for some locations on low memory condition (reliable on FreeBSD only)
+echo - Add support for shell-style goodies in the NGINX configuration file
+empty_gif - Add support for emiting a single-pixel transparent GIF
+fancyindex - Add support for the fancy generation of file listings
+fastcgi - Add support for passing requests to a FastCGI server
+flv - Add support for the server-side pseudo-streaming of Flash Video (FLV) files
+geo - Add support for creating variables whose values depend on the client IP-address
+geoip - Add support for creating variables whose values depend on the client IP-address, using the precompiled MaxMind databases
+geoip2 - Add support for creating variables whose values depend on the client IP-address, using the precompiled MaxMind GeoIP2 databases
+grpc - Add support for passing requests to a gRPC server
+gunzip - Add support for decompressing responses with "Content-Encoding: gzip" for clients that do not support "gzip" encoding method
+gzip - Add support for compressing responses using the "gzip" method
+gzip_static - Add support for sending precompressed files with the ".gz" filename extension instead of regular files
+headers_more - Add support for setting arbitrary input and output headers
+image_filter - Add support for transforming images in JPEG, GIF, PNG, and WebP formats
+javascript - Add support for implementing location and variable handlers in njs - a subset of the JavaScript language
+limit_conn - Add support for limiting the number of connections per a defined key, e.g. the number of connections from a single IP address
+limit_req - Add support for limiting the request processing rate per a defined key, e.g. the processing rate of requests coming from a single IP address
+lua - Add support for Lua scripting in NGINX
+map - Add support for creating variables whose values depend on values of other variables
+memc - Add support for an extended version of the standard memcached module that supports set, add, delete, and many more memcached commands
+memcached - Add support for obtaining responses from a memcached server
+metrics - Add support for exporting various metrics in an easy-parseable JSON format
+mirror - Add support for mirroring of the original request by creating background mirror subrequests
+mogilefs - Add support for MogileFS
+mp4 - Add support for server-side pseudo-streaming for MP4 files
+naxsi - Add support for NAXSI WAF (Web Application Firewall)
+perl - Add support for implementing location and variable handlers in Perl and inserting Perl calls into SSI
+proxy - Add support for passing subrequests to another server
+push_stream - Add support for the stream HTTP push module, which supports EventSource, WebSocket, Long Polling, and Forever Iframe
+random_index - Add support for processing requests ending with the slash character ('/') by picking a random file in a directory to serve as an index file
+realip - Add support for setting the client address and optional port to those sent in the specified header field (e.g. "X-Real-IP" or "X-Forwarded-For")
+referer - Add support for blocking access to a site for requests with invalid values in the "Referer" header field
+rewrite - Add support for changing the request URI using PCRE regular expressions, returning redirects, and conditionally selecting configurations
+scgi - Add support for passing requests to an SCGI server
+secure_link - Add support for checking authenticity of requested links, protecting resources from unauthorized access, and limiting link lifetime
+security - Add support for modsecurity: web application firewall and intrusion detection system
+slice - Add support for spliting a request into subrequests, each returning a certain range of response
+slowfs_cache - Add support for caching static files
+spdy - Add support for an SPDY implementation. (Deprecated, use USE="nginx_modules_http_v2" instead)
+split_clients - Add support for creating variables suitable for A/B testing, also known as split testing
+ssi - Add support for processing SSI (Server Side Includes) commands in responses passing through NGINX
+ssl - Add support for HTTPS - SSL/TLS-encrypted HTTP
+sticky - Add support for sending a sticky cookie in order to always forward client to the same upstream server
+stub_status - Add support for providing access to basic status information
+sub - Add support for modifying a response by replacing one specified string by another
+upload_progress - Add support for an upload progress system, that monitors RFC1867 POST uploads as they are transmitted to upstream servers
+upstream_check - Add support for performing health check of upstream servers
+upstream_hash - Add support for distributing upstream requests based on hashed key value
+upstream_ip_hash - Add support for distributing upstream requests based on the IP-address of the client
+upstream_keepalive - Add support for caching connections to upstream servers
+upstream_least_conn - Add support for passing upstream requests to the server with the least number of active connections
+upstream_random - Add support for passing upstream requests to a randomly selected server
+upstream_zone - Add support for defining a shared memory zone that keeps the group's configuration and run-time state that are shared between worker processes
+userid - Add support for setting cookies suitable for client identification
+uwsgi - Add support for passing requests to a uwsgi server
+vhost_traffic_status - Add support for providing access to virtual host status information
+v2 - Add support for HTTP/2
+v3 - Add experimental support for HTTP/3
+vod - Add support for streaming video using DASH, HDS, HLS, MSS
+xslt - Add support for transforming XML responses using one or more XSLT stylesheets
--
2.45.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-dev] [PATCH v3 14/40] profiles/desc: reword and update nginx_modules_mail.desc
2025-02-21 16:07 [gentoo-dev] [PATCH v3 00/40] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass Zurab Kvachadze
` (12 preceding siblings ...)
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 13/40] profiles/desc: reword and update nginx_modules_http.desc Zurab Kvachadze
@ 2025-02-21 16:08 ` Zurab Kvachadze
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 15/40] profiles/desc: reword and update nginx_modules_stream.desc Zurab Kvachadze
` (26 subsequent siblings)
40 siblings, 0 replies; 42+ messages in thread
From: Zurab Kvachadze @ 2025-02-21 16:08 UTC (permalink / raw
To: gentoo-dev; +Cc: Zurab Kvachadze
This commit modifies the nginx_modules_mail.desc roughly the same as the
preceeding one modified nginx_modules_http.desc.
This commit adds description for the "ssl" module (see [1] in the
previous commit).
Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
---
profiles/desc/nginx_modules_mail.desc | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/profiles/desc/nginx_modules_mail.desc b/profiles/desc/nginx_modules_mail.desc
index 930f57bc2480..7e428689a51e 100644
--- a/profiles/desc/nginx_modules_mail.desc
+++ b/profiles/desc/nginx_modules_mail.desc
@@ -1,9 +1,10 @@
-# Copyright 2010 Gentoo Foundation.
+# Copyright 2010-2025 Gentoo Authors.
# Distributed under the terms of the GNU General Public License v2
# This file contains descriptions of NGINX_MODULES_MAIL USE_EXPAND flags.
# Keep it sorted.
-imap - This module provides IMAP proxy capability.
-pop3 - This module provides POP3 proxy capability.
-smtp - This module provides SMTP proxy capability.
+imap - Add support for proxying IMAP messages
+pop3 - Add support for proxying POP3 messages
+smtp - Add support for proxying SMTP messages
+ssl - Add SSL/TLS protocol support to a mail proxy server (implicit TLS, STARTTLS, etc.)
--
2.45.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-dev] [PATCH v3 15/40] profiles/desc: reword and update nginx_modules_stream.desc
2025-02-21 16:07 [gentoo-dev] [PATCH v3 00/40] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass Zurab Kvachadze
` (13 preceding siblings ...)
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 14/40] profiles/desc: reword and update nginx_modules_mail.desc Zurab Kvachadze
@ 2025-02-21 16:08 ` Zurab Kvachadze
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 16/40] profiles/categories: Add www-nginx category for external NGINX modules Zurab Kvachadze
` (25 subsequent siblings)
40 siblings, 0 replies; 42+ messages in thread
From: Zurab Kvachadze @ 2025-02-21 16:08 UTC (permalink / raw
To: gentoo-dev; +Cc: Zurab Kvachadze
Does the same as two previous commits, this time with
nginx_modules_stream.desc.
Two new modules were added: "pass", "set", "upstream_random" and "ssl".
For the last module, see [1] in the first of two preceeding commits.
Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
---
profiles/desc/nginx_modules_stream.desc | 34 ++++++++++++++-----------
1 file changed, 19 insertions(+), 15 deletions(-)
diff --git a/profiles/desc/nginx_modules_stream.desc b/profiles/desc/nginx_modules_stream.desc
index 8d8e9cb5a5f9..54c5966498d9 100644
--- a/profiles/desc/nginx_modules_stream.desc
+++ b/profiles/desc/nginx_modules_stream.desc
@@ -1,20 +1,24 @@
-# Copyright 1999-2017 Gentoo Foundation.
+# Copyright 1999-2025 Gentoo Authors.
# Distributed under the terms of the GNU General Public License v2
# This file contains descriptions of NGINX_MODULES_STREAM USE_EXPAND flags.
# Keep it sorted.
-access - This module allows limiting access to certain client addresses.
-geo - This module creates variables, whose values depend on the IP-address of the client.
-geoip - This module creates variables based on the IP-address of the client matched against the MaxMind GeoIP binary files.
-geoip2 - This module creates variables based on the IP-address of the client matched against the MaxMind GeoIP2 binary files.
-javascript - This module implements location and variable handlers in nginScript.
-limit_conn - This module is used to limit the number of connections per the defined key.
-map - This module allows you to classify, or map a set of values into a different set of values and store the result in a variable.
-realip - This module allows to change the client's IP address to value from request header (e. g. X-Real-IP or X-Forwarded-For).
-return - This module allows sending a specified value to the client and then closing the connection.
-split_clients - This module provides A/B testing support.
-ssl_preread - This module allows extracting information from the ClientHello message without terminating SSL/TLS.
-upstream_hash - This module provides the ability to distribute upstream requests based on hashed key value.
-upstream_least_conn - This module provides the ability to distribute upstream requests using load balancing methods.
-upstream_zone - This module makes it possible to define a shared memory zone that keeps the group's configuration and run-time state that are shared between worker processes.
+access - Add support for a simple host-based access control
+geo - Add support for creating variables whose values depend on the client IP-address
+geoip - Add support for creating variables whose values depend on the client IP-address, using the precompiled MaxMind databases
+geoip2 - Add support for creating variables whose values depend on the client IP-address, using the precompiled MaxMind GeoIP2 databases
+javascript - Add support for implementing location and variable handlers in njs - a subset of the JavaScript language
+limit_conn - Add support for limiting the number of connections per a defined key, e.g. the number of connections from a single IP address
+map - Add support for creating variables whose values depend on the values of other variables
+pass - Add support for passing the accepted connection directly to any configured listening socket in "http", "stream", "mail", and other similar modules
+realip - Add support for setting the client address and optional port to those sent in the specified header field (e.g. "X-Real-IP" or "X-Forwarded-For")
+return - Add support for sending a specified value to the client and then closing the connection
+set - Add support for setting a value for a variable
+split_clients - Add support for creating variables suitable for A/B testing, also known as split testing
+ssl - Add SSL/TLS protocol support to a stream proxy server
+ssl_preread - Add support for extracting information from the ClientHello message without terminating SSL/TLS connection
+upstream_hash - Add support for distributing upstream requests based on hashed key value
+upstream_least_conn - Add support for passing upstream requests to the server with the least number of active connections
+upstream_random - Add support for passing upstream requests to a randomly selected server
+upstream_zone - Add support for defining a shared memory zone that keeps the group's configuration and run-time state that are shared between worker processes
--
2.45.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-dev] [PATCH v3 16/40] profiles/categories: Add www-nginx category for external NGINX modules
2025-02-21 16:07 [gentoo-dev] [PATCH v3 00/40] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass Zurab Kvachadze
` (14 preceding siblings ...)
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 15/40] profiles/desc: reword and update nginx_modules_stream.desc Zurab Kvachadze
@ 2025-02-21 16:08 ` Zurab Kvachadze
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 17/40] app-metrics/nginx-lua-prometheus: revbump to r101, update EAPI 7 -> 8, remove r100 Zurab Kvachadze
` (24 subsequent siblings)
40 siblings, 0 replies; 42+ messages in thread
From: Zurab Kvachadze @ 2025-02-21 16:08 UTC (permalink / raw
To: gentoo-dev; +Cc: Zurab Kvachadze
The www-nginx category is expected to contain third party modules for
the NGINX server, which was made possible with the introduction of
nginx-module.eclass.
Currently, NGINX bundles 25 modules that could all be separate packages.
A non-comprehensive list of these modules: ngx_devel_kit[1],
ngx-fancyindex[2], lua-nginx-module[3], nginx-push-stream-module[4] and
many more.
See the www-servers/nginx ebuild for the full list of bundled moduled
that may be packaged in the www-nginx category.
[1]: https://github.com/vision5/ngx_devel_kit
[2]: https://github.com/aperezdc/ngx-fancyindex
[3]: https://github.com/openresty/lua-nginx-module
[4]: https://github.com/wandenberg/nginx-push-stream-module
Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
---
profiles/categories | 1 +
{gui-wm => www-nginx}/metadata.xml | 5 +----
2 files changed, 2 insertions(+), 4 deletions(-)
copy {gui-wm => www-nginx}/metadata.xml (53%)
diff --git a/profiles/categories b/profiles/categories
index eb23eea4aeee..2b1572677296 100644
--- a/profiles/categories
+++ b/profiles/categories
@@ -157,6 +157,7 @@ www-apache
www-apps
www-client
www-misc
+www-nginx
www-plugins
www-servers
x11-apps
diff --git a/gui-wm/metadata.xml b/www-nginx/metadata.xml
similarity index 53%
copy from gui-wm/metadata.xml
copy to www-nginx/metadata.xml
index 448acadd7390..53d8713dfcd1 100644
--- a/gui-wm/metadata.xml
+++ b/www-nginx/metadata.xml
@@ -2,9 +2,6 @@
<!DOCTYPE catmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<catmetadata>
<longdescription lang="en">
- The gui-wm category contains various window managers.
- </longdescription>
- <longdescription lang="de">
- Die Kategorie gui-wm enthält verschiedene Fenstermanager.
+ The www-nginx category contains external modules for the NGINX reverse proxy and web server
</longdescription>
</catmetadata>
--
2.45.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-dev] [PATCH v3 17/40] app-metrics/nginx-lua-prometheus: revbump to r101, update EAPI 7 -> 8, remove r100
2025-02-21 16:07 [gentoo-dev] [PATCH v3 00/40] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass Zurab Kvachadze
` (15 preceding siblings ...)
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 16/40] profiles/categories: Add www-nginx category for external NGINX modules Zurab Kvachadze
@ 2025-02-21 16:08 ` Zurab Kvachadze
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 18/40] www-servers/nginx: revbump 1.26.3-r0 to 1.26.3-r1, use nginx.eclass Zurab Kvachadze
` (23 subsequent siblings)
40 siblings, 0 replies; 42+ messages in thread
From: Zurab Kvachadze @ 2025-02-21 16:08 UTC (permalink / raw
To: gentoo-dev; +Cc: Zurab Kvachadze
Depend www-nginx/ngx-lua-module if it is present, use default disable "(-)"
USE-dependency on the nginx_module_http_lua USE flag of www-servers/nginx.
Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
---
...-lua-prometheus-0.1_pre20170610-r101.ebuild} | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
rename app-metrics/nginx-lua-prometheus/{nginx-lua-prometheus-0.1_pre20170610-r100.ebuild => nginx-lua-prometheus-0.1_pre20170610-r101.ebuild} (79%)
diff --git a/app-metrics/nginx-lua-prometheus/nginx-lua-prometheus-0.1_pre20170610-r100.ebuild b/app-metrics/nginx-lua-prometheus/nginx-lua-prometheus-0.1_pre20170610-r101.ebuild
similarity index 79%
rename from app-metrics/nginx-lua-prometheus/nginx-lua-prometheus-0.1_pre20170610-r100.ebuild
rename to app-metrics/nginx-lua-prometheus/nginx-lua-prometheus-0.1_pre20170610-r101.ebuild
index cd6f311c9ea0..19df5e6cefad 100644
--- a/app-metrics/nginx-lua-prometheus/nginx-lua-prometheus-0.1_pre20170610-r100.ebuild
+++ b/app-metrics/nginx-lua-prometheus/nginx-lua-prometheus-0.1_pre20170610-r101.ebuild
@@ -1,7 +1,7 @@
-# Copyright 2019-2020 Gentoo Authors
+# Copyright 2019-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
# This should be kept in sync with implementations supported
# by www-servers/nginx
@@ -16,6 +16,7 @@ inherit lua-single
DESCRIPTION="Library that exports Nginx metrics to Prometheus"
HOMEPAGE="https://github.com/knyar/nginx-lua-prometheus"
SRC_URI="https://github.com/knyar/${PN}/archive/${TAG}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/${PN}-${TAG}"
LICENSE="MIT"
SLOT="0"
@@ -23,14 +24,16 @@ KEYWORDS="~amd64"
REQUIRED_USE="${LUA_REQUIRED_USE}"
+BDEPEND="virtual/pkgconfig"
+
COMMON_DEPEND="${LUA_DEPS}"
DEPEND="${COMMON_DEPEND}"
RDEPEND="${COMMON_DEPEND}
- www-servers/nginx[nginx_modules_http_lua,${LUA_SINGLE_USEDEP}]"
-BDEPEND="${COMMON_DEPEND}
- virtual/pkgconfig"
-
-S="${WORKDIR}/${PN}-${TAG}"
+ || (
+ www-nginx/ngx-lua-module[${LUA_SINGLE_USEDEP}]
+ www-servers/nginx[nginx_modules_http_lua(-),${LUA_SINGLE_USEDEP}]
+ )
+"
src_install() {
insinto "$(lua_get_lmod_dir)"/${PN}
--
2.45.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-dev] [PATCH v3 18/40] www-servers/nginx: revbump 1.26.3-r0 to 1.26.3-r1, use nginx.eclass
2025-02-21 16:07 [gentoo-dev] [PATCH v3 00/40] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass Zurab Kvachadze
` (16 preceding siblings ...)
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 17/40] app-metrics/nginx-lua-prometheus: revbump to r101, update EAPI 7 -> 8, remove r100 Zurab Kvachadze
@ 2025-02-21 16:08 ` Zurab Kvachadze
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 19/40] www-servers/nginx: revbump 1.27.4-r0 to 1.27.4-r1, " Zurab Kvachadze
` (22 subsequent siblings)
40 siblings, 0 replies; 42+ messages in thread
From: Zurab Kvachadze @ 2025-02-21 16:08 UTC (permalink / raw
To: gentoo-dev; +Cc: Zurab Kvachadze
This commit makes NGINX employ new nginx.eclass. This bumps the stable
1.26.2 NGINX version to the second revision bringing a considerable
amount of changes:
* NGINX is now fully slotted. Stable versions are in the 'stable'
SLOT and mainline ones are in the 'mainline' SLOT. There is also a
'live' slot for the latest git version.
* All external modules have been unbundled from the main NGINX
package. They will soon be available as separate packages in the
www-nginx/ category. In addition, NGINX development kit
(ngx_devel_kit) is no longer unconditionally statically built into
NGINX binary.
* LICENSE has been modified to reflect reality.
* USE flag changes:
1. "pcre", "pcre2" have been removed along with the dependency
on EOL libpcre1. Bug 886537, although it is not really closed
until old versions that still depend on libpcre1 are
treecleaned.
2. "ktls" and "pcre-jit" have been removed completely since they
have no effect if system OpenSSL and libpcre are used (as is
always the case with NGINX on Gentoo).
3. "threads" - removed, even though some really ancient
third-party modules break with this (e.g. mogilefs last time
I checked it). nginx.eclass enables pthreads support
unconditionally, see https://bugs.gentoo.org/868336.
4. "vim-syntax" has been removed, as vimfiles are bundled with
NGINX, are more updated there and, therefore, are now
installed from the NGINX tarball.
5. "http2" and "http3" have been moved to their
nginx_modules_http_v{2,3} counterparts where they actually
belong as regular modules.
6. "ssl" has been moved to nginx_modules_{http,mail,stream}_ssl.
7. "http-cache" has been removed. It does not even qualify to be
a USE flag: the flag just passes some argument to disable the
http cache, which (the cache) is not documented upstream at
all.
8. "modules" USE flag has been added to control dynamic modules
support.
9. A substantial amount of USE flags have been added for minor
HTTP, stream (bug 735020) and mail modules.
* All the miscellaneous files (configuration file, confd, init and
logrotate scripts, systemd service) have been revbumped. NGINX now
ships with tmpfiles.d(5) configuration file (see below). This
closes bugs 481456, 928131, 576414.
* All the files that previously went into /etc/nginx are now stored
in /usr/share/nginx, apart from nginx.conf.
* NGINX's temporary files are now stored in /var/tmp/nginx, instead
of /var/lib/nginx/tmp. The new directory is managed by
systemd-tmpfiles(8), which has been added as a dependency.
* NGINX now uses the access.log and error.log as default log names,
instead of access_log and error_log (bug 700866).
* NGINX no longer does strange permission checks for 8-year-old
CVEs.
This commit also closes the bug 578658 mentioned in nginx.eclass.
Bug: https://bugs.gentoo.org/886537
Closes: https://bugs.gentoo.org/481456
Closes: https://bugs.gentoo.org/928131
Closes: https://bugs.gentoo.org/576414
Closes: https://bugs.gentoo.org/578658
Closes: https://bugs.gentoo.org/735020
Closes: https://bugs.gentoo.org/700866
Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
---
www-servers/nginx/Manifest | 1 +
www-servers/nginx/nginx-1.26.3-r1.ebuild | 31 ++++++++++++++++++++++++
2 files changed, 32 insertions(+)
create mode 100644 www-servers/nginx/nginx-1.26.3-r1.ebuild
diff --git a/www-servers/nginx/Manifest b/www-servers/nginx/Manifest
index 0d1feb7515f5..3977e86f67f8 100644
--- a/www-servers/nginx/Manifest
+++ b/www-servers/nginx/Manifest
@@ -3,6 +3,7 @@ DIST nginx-1.26.3.tar.gz 1260179 BLAKE2B 4ef731070e986d98fc1984717dec7fb766ed1a0
DIST nginx-1.27.4.tar.gz 1277177 BLAKE2B d51999a56a1c3ea04d7f052f7d4b196b8f00afa0d00986c0601ff429b65c57a3842e821ccdb9c5b61973e172eade8c6c40c00ded7999dbfba6640ee086f6a945 SHA512 3785797d3c8f96b930c11a445c68ce88b584af9645f41b8929a779ef1507b74831fa91e9144f3a56599737517cbf1864954d91e312d12cc59e23e4db72c2c716
DIST nginx-auth-ldap-42d195d7a7575ebab1c369ad3fc5d78dc2c2669c.tar.gz 18457 BLAKE2B 22225ca9e5299b20ab5a93a001cac48e446bd86b3a24ac49e716bc975b128890bdb4b0dbbf5730fbaaeadfd958160093c7a6af798dd0e6de27062f149a760333 SHA512 ec59637fda5acac053e815cb1d04b545fc6b765e5ec63d8c2c9c301abad87afaa2698145acac08e9e14c91e1423ebff7aff0cca2b940b19ccccbf4cf53973269
DIST nginx-tests-0b5ec15c62ed.tar.gz 282652 BLAKE2B af41397f88f7aa969749c6dd9a77c58d1835bca24fe764dd0af328d621817f5fb89b3f5b5c0fbd1e7db53d51365e9098b020005e27a531649bd8a51a05b3cbb0 SHA512 c376d23c7001c5203428b664c388e97956cdda8365eb7df57db0da5146d0806f5c35cd1352260d6803d55542f46a90da4a604ebf971055caa77dd6106930558e
+DIST nginx-tests-981b8807117014d5bfc3ddd17496fc48de038072.tar.gz 311608 BLAKE2B f58f40966727f21cbd292f3aa7f90c77da3b7707c2228c70ea850460049bb6c6e986a37357996be1d9936190e48a2a6a0094e9294ed61c8c4917cb3dcde2ba6a SHA512 1b8e4c860b6774a11314bd2c4d103fbc7d44cd135219e5dd11f980246872d4f7825866d0ba20a7f33f3cd788918c31a1037237cb346a25330f9a63ad20ad096c
DIST nginx-vod-module-1.33.tar.gz 471858 BLAKE2B fa5cb9fd185b30c5c53b25a6f103213b3d04dac5d2d81db72f9749a51548e09e3e17dccc636d748aff8d21c6623484c77fdeb10d70854480759665d140d42e0e SHA512 29ef77f1bbdb2410ff317ebdd7434f31b8ec370ae6b617b92e745e87c11bc820b451181d1d2b57156b414348da14ac448b689b32b17ab418144292eda094512d
DIST nginx_http_sticky_module_ng-1.2.6-10-g08a395c66e42.tar.bz2 124047 BLAKE2B d37ef9a15c91abe3c6258e420d1f99fa452f9d9966a0e13102174973314a3bac5413957a5fe632a9dcb1163b3be5df8116e05cc053ee061e19319ec25f341570 SHA512 6c1bfdcf89884b2855d51ae7da0f6e53a4ca3629e1aaf58433b70c07dcb2af797ba6e87d9b3eb4fe2fb6d4d697e862f2b4c2f8d8b3fdaea201740c97ec936529
DIST ngx_brotli-1.0.0rc.tar.gz 16207 BLAKE2B 450d0ea693bd98d4a1b615f2cdcaad41ccd28266f6d80beec7fe77fe750ab8c5d1bb55aabe15161b9b6d819d2b4d99a7774f2706f2f6fd084b52a7c7dddbc00c SHA512 05a880d5e48ac83be84498ed41fb4750211b827a9d7541acfd6ef494e5205a6e853d5594bfec3ab4ae668ea3f803e4f4b0ba550c76811971c8e266e42663c56d
diff --git a/www-servers/nginx/nginx-1.26.3-r1.ebuild b/www-servers/nginx/nginx-1.26.3-r1.ebuild
new file mode 100644
index 000000000000..43b77a0a76af
--- /dev/null
+++ b/www-servers/nginx/nginx-1.26.3-r1.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+NGINX_SUBSYSTEMS=(+http stream mail)
+NGINX_MODULES=(
+ +http_{charset,gzip,ssi,userid,access,auth_basic,mirror,autoindex,geo,map}
+ +http_{split_clients,referer,rewrite,proxy,fastcgi,uwsgi,scgi,grpc}
+ +http_{memcached,limit_conn,limit_req,empty_gif,browser,upstream_hash}
+ +http_{upstream_ip_hash,upstream_least_conn,upstream_random}
+ +http_{upstream_keepalive,upstream_zone}
+ http_{ssl,v2,v3,realip,addition,xslt,image_filter,geoip,sub,dav,flv,mp4}
+ http_{gunzip,gzip_static,auth_request,random_index,secure_link,degradation}
+ http_{slice,stub_status,perl}
+ +mail_{pop3,imap,smtp}
+ mail_ssl
+ +stream_{limit_conn,access,geo,map,split_clients,return,pass,set}
+ +stream_{upstream_hash,upstream_least_conn,upstream_random,upstream_zone}
+ stream_{ssl,realip,geoip,ssl_preread}
+)
+NGINX_UPDATE_STREAM=stable
+NGINX_TESTS_COMMIT=981b8807117014d5bfc3ddd17496fc48de038072
+NGINX_MISC_FILES=(
+ nginx-{r2.logrotate,r2.service,r4.conf,r5.initd,r1.confd}
+ nginx.tmpfiles
+)
+
+inherit nginx
+
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~x86 ~amd64-linux ~x86-linux"
--
2.45.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-dev] [PATCH v3 19/40] www-servers/nginx: revbump 1.27.4-r0 to 1.27.4-r1, use nginx.eclass
2025-02-21 16:07 [gentoo-dev] [PATCH v3 00/40] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass Zurab Kvachadze
` (17 preceding siblings ...)
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 18/40] www-servers/nginx: revbump 1.26.3-r0 to 1.26.3-r1, use nginx.eclass Zurab Kvachadze
@ 2025-02-21 16:08 ` Zurab Kvachadze
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 20/40] www-servers/nginx: add 9999 live version, " Zurab Kvachadze
` (21 subsequent siblings)
40 siblings, 0 replies; 42+ messages in thread
From: Zurab Kvachadze @ 2025-02-21 16:08 UTC (permalink / raw
To: gentoo-dev; +Cc: Zurab Kvachadze
This commit is identical to the previous one, with the mainline
1.27.3 NGINX version being made to utilize nginx.eclass.
See the previous commit for the list of changes.
Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
---
.../nginx/{nginx-1.26.3-r1.ebuild => nginx-1.27.4-r1.ebuild} | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
copy www-servers/nginx/{nginx-1.26.3-r1.ebuild => nginx-1.27.4-r1.ebuild} (97%)
diff --git a/www-servers/nginx/nginx-1.26.3-r1.ebuild b/www-servers/nginx/nginx-1.27.4-r1.ebuild
similarity index 97%
copy from www-servers/nginx/nginx-1.26.3-r1.ebuild
copy to www-servers/nginx/nginx-1.27.4-r1.ebuild
index 43b77a0a76af..3ee6e5458c92 100644
--- a/www-servers/nginx/nginx-1.26.3-r1.ebuild
+++ b/www-servers/nginx/nginx-1.27.4-r1.ebuild
@@ -19,7 +19,7 @@ NGINX_MODULES=(
+stream_{upstream_hash,upstream_least_conn,upstream_random,upstream_zone}
stream_{ssl,realip,geoip,ssl_preread}
)
-NGINX_UPDATE_STREAM=stable
+NGINX_UPDATE_STREAM=mainline
NGINX_TESTS_COMMIT=981b8807117014d5bfc3ddd17496fc48de038072
NGINX_MISC_FILES=(
nginx-{r2.logrotate,r2.service,r4.conf,r5.initd,r1.confd}
--
2.45.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-dev] [PATCH v3 20/40] www-servers/nginx: add 9999 live version, use nginx.eclass
2025-02-21 16:07 [gentoo-dev] [PATCH v3 00/40] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass Zurab Kvachadze
` (18 preceding siblings ...)
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 19/40] www-servers/nginx: revbump 1.27.4-r0 to 1.27.4-r1, " Zurab Kvachadze
@ 2025-02-21 16:08 ` Zurab Kvachadze
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 21/40] www-nginx/ngx_devel_kit: new package, add 0.3.4 Zurab Kvachadze
` (20 subsequent siblings)
40 siblings, 0 replies; 42+ messages in thread
From: Zurab Kvachadze @ 2025-02-21 16:08 UTC (permalink / raw
To: gentoo-dev; +Cc: Zurab Kvachadze
This commit adds the live Git version of NGINX to the Gentoo tree,
making use of nginx.eclass.
Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
---
.../nginx/{nginx-1.26.3-r1.ebuild => nginx-9999.ebuild} | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
copy www-servers/nginx/{nginx-1.26.3-r1.ebuild => nginx-9999.ebuild} (85%)
diff --git a/www-servers/nginx/nginx-1.26.3-r1.ebuild b/www-servers/nginx/nginx-9999.ebuild
similarity index 85%
copy from www-servers/nginx/nginx-1.26.3-r1.ebuild
copy to www-servers/nginx/nginx-9999.ebuild
index 43b77a0a76af..801d51bbc7f9 100644
--- a/www-servers/nginx/nginx-1.26.3-r1.ebuild
+++ b/www-servers/nginx/nginx-9999.ebuild
@@ -19,13 +19,11 @@ NGINX_MODULES=(
+stream_{upstream_hash,upstream_least_conn,upstream_random,upstream_zone}
stream_{ssl,realip,geoip,ssl_preread}
)
-NGINX_UPDATE_STREAM=stable
-NGINX_TESTS_COMMIT=981b8807117014d5bfc3ddd17496fc48de038072
+NGINX_UPDATE_STREAM=live
+NGINX_TESTS_COMMIT=live
NGINX_MISC_FILES=(
nginx-{r2.logrotate,r2.service,r4.conf,r5.initd,r1.confd}
nginx.tmpfiles
)
inherit nginx
-
-KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~x86 ~amd64-linux ~x86-linux"
--
2.45.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-dev] [PATCH v3 21/40] www-nginx/ngx_devel_kit: new package, add 0.3.4
2025-02-21 16:07 [gentoo-dev] [PATCH v3 00/40] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass Zurab Kvachadze
` (19 preceding siblings ...)
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 20/40] www-servers/nginx: add 9999 live version, " Zurab Kvachadze
@ 2025-02-21 16:08 ` Zurab Kvachadze
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 22/40] www-nginx/ngx-echo: new package, add 0.63 Zurab Kvachadze
` (19 subsequent siblings)
40 siblings, 0 replies; 42+ messages in thread
From: Zurab Kvachadze @ 2025-02-21 16:08 UTC (permalink / raw
To: gentoo-dev; +Cc: Zurab Kvachadze
Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
---
www-nginx/ngx_devel_kit/Manifest | 1 +
www-nginx/ngx_devel_kit/metadata.xml | 25 +++++++++++
.../ngx_devel_kit/ngx_devel_kit-0.3.4.ebuild | 45 +++++++++++++++++++
3 files changed, 71 insertions(+)
create mode 100644 www-nginx/ngx_devel_kit/Manifest
create mode 100644 www-nginx/ngx_devel_kit/metadata.xml
create mode 100644 www-nginx/ngx_devel_kit/ngx_devel_kit-0.3.4.ebuild
diff --git a/www-nginx/ngx_devel_kit/Manifest b/www-nginx/ngx_devel_kit/Manifest
new file mode 100644
index 000000000000..b5f5f9eb5341
--- /dev/null
+++ b/www-nginx/ngx_devel_kit/Manifest
@@ -0,0 +1 @@
+DIST ngx_devel_kit-0.3.4.tar.gz 66474 BLAKE2B 3b5ed36517f27ea83881d2fb1e6ba2839c173a833ec563fa94dc9b633b3ebe9ea24c7bb5676aa811267b09a2504d74b306ee7268b8a0d56b230886fd955289e9 SHA512 6bc2f4d3b7ad22527e6c7c343884f8b0d5810ae9b7b09d6c2988b50afbd9c7a79e387667bfb980e93c5e204c163544f79634b2862895d8ee004a4393245ee185
diff --git a/www-nginx/ngx_devel_kit/metadata.xml b/www-nginx/ngx_devel_kit/metadata.xml
new file mode 100644
index 000000000000..935599305174
--- /dev/null
+++ b/www-nginx/ngx_devel_kit/metadata.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person" proxied="yes">
+ <email>zurabid2016@gmail.com</email>
+ <name>Zurab Kvachadze</name>
+ </maintainer>
+ <maintainer type="project" proxied="proxy">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <longdescription>
+ The NDK is an NGINX module that is designed to extend the core functionality of the
+ excellent NGINX webserver in a way that can be used as a basis of other NGINX modules.
+
+ It has functions and macros to deal with generic tasks that don't currently have generic
+ code as part of the core distribution. The NDK itself adds few features that are seen from a
+ user's point of view - it's just designed to help reduce the code that NGINX module
+ developers need to write.
+ </longdescription>
+ <upstream>
+ <bugs-to>https://github.com/vision5/ngx_devel_kit/issues</bugs-to>
+ <remote-id type="github">vision5/ngx_devel_kit</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/www-nginx/ngx_devel_kit/ngx_devel_kit-0.3.4.ebuild b/www-nginx/ngx_devel_kit/ngx_devel_kit-0.3.4.ebuild
new file mode 100644
index 000000000000..d46dfbae3d7d
--- /dev/null
+++ b/www-nginx/ngx_devel_kit/ngx_devel_kit-0.3.4.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit flag-o-matic nginx-module
+
+DESCRIPTION="An NGINX module that adds generic tools for third-party modules"
+HOMEPAGE="https://github.com/vision5/ngx_devel_kit"
+SRC_URI="
+ https://github.com/vision5/ngx_devel_kit/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
+"
+
+LICENSE="BSD"
+SLOT="0"
+
+src_configure() {
+ # ngx_devel_kit (NDK) is designed in a modular way. As such, only the
+ # required modules are built based if the corresponding preprocessor macros
+ # are defined.
+ #
+ # Since we do not want to deal with a dependency hell (other NGINX plugins
+ # depend on dfferent NDK's modules) and a bunch of USE flag toggles, NDK is
+ # compiled with all its modules. Fortunately, even with all the modules
+ # built-in, the resulting binary is really small, so the size is not an
+ # issue.
+ #
+ # For details, have a look at 'objs/ndk_config.c' in NDK's source tree and
+ # the 'modular' section in 'README.md'.
+ append-cflags -DNDK_ALL
+ nginx-module_src_configure
+}
+
+src_install() {
+ nginx-module_src_install
+
+ pushd "${NGINX_MOD_S}" >/dev/null || die "pushd failed"
+
+ # Install ngx_devel_kit's headers for use by other modules.
+ insinto /usr/include/nginx/modules
+ find objs src -maxdepth 1 -type f -name '*.h' -print0 | xargs -0 doins
+ assert "find failed"
+
+ popd >/dev/null || die "popd failed"
+}
--
2.45.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-dev] [PATCH v3 22/40] www-nginx/ngx-echo: new package, add 0.63
2025-02-21 16:07 [gentoo-dev] [PATCH v3 00/40] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass Zurab Kvachadze
` (20 preceding siblings ...)
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 21/40] www-nginx/ngx_devel_kit: new package, add 0.3.4 Zurab Kvachadze
@ 2025-02-21 16:08 ` Zurab Kvachadze
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 23/40] www-nginx/ngx-encrypted-session: new package, add 0.09 Zurab Kvachadze
` (18 subsequent siblings)
40 siblings, 0 replies; 42+ messages in thread
From: Zurab Kvachadze @ 2025-02-21 16:08 UTC (permalink / raw
To: gentoo-dev; +Cc: Zurab Kvachadze
Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
---
www-nginx/ngx-echo/Manifest | 1 +
www-nginx/ngx-echo/metadata.xml | 24 ++++++++++++++++++++++++
www-nginx/ngx-echo/ngx-echo-0.63.ebuild | 19 +++++++++++++++++++
3 files changed, 44 insertions(+)
create mode 100644 www-nginx/ngx-echo/Manifest
create mode 100644 www-nginx/ngx-echo/metadata.xml
create mode 100644 www-nginx/ngx-echo/ngx-echo-0.63.ebuild
diff --git a/www-nginx/ngx-echo/Manifest b/www-nginx/ngx-echo/Manifest
new file mode 100644
index 000000000000..a6f587dfaa80
--- /dev/null
+++ b/www-nginx/ngx-echo/Manifest
@@ -0,0 +1 @@
+DIST ngx-echo-0.63.tar.gz 53421 BLAKE2B 613d4f265b9bcf9b4a44a18749314075e797dca4b350e6c4bc2e7ddd52edadc52660504ee57d0c859ec0a20f6b2e425727e5ec4b30282e67498010fc8d959baa SHA512 c325ac4e3f3f735739e156d8c7ada503b34475c62533b4830231ff1b42c25cb0c841aae06b3448b589c2ab35da8d211436ed194d6fd062cad925af8152c5e789
diff --git a/www-nginx/ngx-echo/metadata.xml b/www-nginx/ngx-echo/metadata.xml
new file mode 100644
index 000000000000..f2200d43e260
--- /dev/null
+++ b/www-nginx/ngx-echo/metadata.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person" proxied="yes">
+ <email>zurabid2016@gmail.com</email>
+ <name>Zurab Kvachadze</name>
+ </maintainer>
+ <maintainer type="project" proxied="proxy">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <longdescription>
+ The ngx-echo module wraps lots of NGINX internal APIs for streaming input and output,
+ parallel/sequential subrequests, timers and sleeping, as well as various metadata
+ accessing.
+
+ Basically it provides various utilities that help testing and debugging of other modules by
+ trivially emulating different kinds of faked subrequest locations.
+ </longdescription>
+ <upstream>
+ <bugs-to>https://github.com/openresty/echo-nginx-module/issues</bugs-to>
+ <remote-id type="github">openresty/echo-nginx-module</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/www-nginx/ngx-echo/ngx-echo-0.63.ebuild b/www-nginx/ngx-echo/ngx-echo-0.63.ebuild
new file mode 100644
index 000000000000..92c51003ab4d
--- /dev/null
+++ b/www-nginx/ngx-echo/ngx-echo-0.63.ebuild
@@ -0,0 +1,19 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+MY_PN="echo-nginx-module"
+NGINX_MOD_S="${WORKDIR}/${MY_PN}-${PV}"
+inherit nginx-module
+
+DESCRIPTION='An NGINX module bringing the power of "echo", "sleep", "time" and more to NGINX'
+HOMEPAGE="https://github.com/openresty/echo-nginx-module"
+SRC_URI="
+ https://github.com/openresty/echo-nginx-module/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
+"
+
+LICENSE="BSD-2"
+SLOT="0"
+
+RESTRICT="test"
--
2.45.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-dev] [PATCH v3 23/40] www-nginx/ngx-encrypted-session: new package, add 0.09
2025-02-21 16:07 [gentoo-dev] [PATCH v3 00/40] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass Zurab Kvachadze
` (21 preceding siblings ...)
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 22/40] www-nginx/ngx-echo: new package, add 0.63 Zurab Kvachadze
@ 2025-02-21 16:08 ` Zurab Kvachadze
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 24/40] www-nginx/ngx-set-misc: new package, add 0.33 Zurab Kvachadze
` (17 subsequent siblings)
40 siblings, 0 replies; 42+ messages in thread
From: Zurab Kvachadze @ 2025-02-21 16:08 UTC (permalink / raw
To: gentoo-dev; +Cc: Zurab Kvachadze
Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
---
www-nginx/ngx-encrypted-session/Manifest | 1 +
www-nginx/ngx-encrypted-session/metadata.xml | 22 ++++++++++++
.../ngx-encrypted-session-0.09.ebuild | 34 +++++++++++++++++++
3 files changed, 57 insertions(+)
create mode 100644 www-nginx/ngx-encrypted-session/Manifest
create mode 100644 www-nginx/ngx-encrypted-session/metadata.xml
create mode 100644 www-nginx/ngx-encrypted-session/ngx-encrypted-session-0.09.ebuild
diff --git a/www-nginx/ngx-encrypted-session/Manifest b/www-nginx/ngx-encrypted-session/Manifest
new file mode 100644
index 000000000000..bf079459db04
--- /dev/null
+++ b/www-nginx/ngx-encrypted-session/Manifest
@@ -0,0 +1 @@
+DIST ngx-encrypted-session-0.09.tar.gz 11847 BLAKE2B 2e923054c34c9b2d3c799280c331c8288444c7f59bc6ea4858e680c81e28f7d8595006474326739c804d6949e3b74b67ce643ed9e196695affb8c275065a4fee SHA512 399ce2690e85ee27802e8031954a1a3aa3fdc9246e17323a72a298d235931a8dbebdcb121ac8788e074872df0ef5b5a8a3d512b17fbe860b38f696ce42de3655
diff --git a/www-nginx/ngx-encrypted-session/metadata.xml b/www-nginx/ngx-encrypted-session/metadata.xml
new file mode 100644
index 000000000000..2691b306a130
--- /dev/null
+++ b/www-nginx/ngx-encrypted-session/metadata.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person" proxied="yes">
+ <email>zurabid2016@gmail.com</email>
+ <name>Zurab Kvachadze</name>
+ </maintainer>
+ <maintainer type="project" proxied="proxy">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <longdescription>
+ The encrypted-session module provides encryption and decryption support for nginx variables
+ based on AES-256 with Mac. It is usually used with the ngx_set_misc module and the
+ standard rewrite module's directives. This module can be used to implement simple user login
+ and ACL.
+ </longdescription>
+ <upstream>
+ <bugs-to>https://github.com/openresty/encrypted-session-nginx-module/issues</bugs-to>
+ <remote-id type="github">openresty/encrypted-session-nginx-module</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/www-nginx/ngx-encrypted-session/ngx-encrypted-session-0.09.ebuild b/www-nginx/ngx-encrypted-session/ngx-encrypted-session-0.09.ebuild
new file mode 100644
index 000000000000..04d5614696b4
--- /dev/null
+++ b/www-nginx/ngx-encrypted-session/ngx-encrypted-session-0.09.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+MY_PN="encrypted-session-nginx-module"
+NGINX_MOD_S="${WORKDIR}/${MY_PN}-${PV}"
+
+NGINX_MOD_LINK_MODULES=( www-nginx/ngx_devel_kit )
+
+inherit toolchain-funcs nginx-module
+
+DESCRIPTION="An NGINX module that encrypts and decrypts NGINX variable values"
+HOMEPAGE="https://github.com/openresty/encrypted-session-nginx-module"
+SRC_URI="
+ https://github.com/openresty/encrypted-session-nginx-module/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
+"
+
+LICENSE="BSD-2"
+SLOT="0"
+
+RESTRICT="test"
+
+BDEPEND="virtual/pkgconfig"
+DEPEND="dev-libs/openssl:="
+RDEPEND="${DEPEND}"
+
+src_configure() {
+ # Make sure the module links to libcrypto, independently of whether NGINX
+ # has SSL/TLS support.
+ ngx_mod_append_libs "$("$(tc-getPKG_CONFIG)" --libs libcrypto)"
+
+ nginx-module_src_configure
+}
--
2.45.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-dev] [PATCH v3 24/40] www-nginx/ngx-set-misc: new package, add 0.33
2025-02-21 16:07 [gentoo-dev] [PATCH v3 00/40] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass Zurab Kvachadze
` (22 preceding siblings ...)
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 23/40] www-nginx/ngx-encrypted-session: new package, add 0.09 Zurab Kvachadze
@ 2025-02-21 16:08 ` Zurab Kvachadze
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 25/40] www-nginx/ngx-brotli: new package, add 20231109 Zurab Kvachadze
` (16 subsequent siblings)
40 siblings, 0 replies; 42+ messages in thread
From: Zurab Kvachadze @ 2025-02-21 16:08 UTC (permalink / raw
To: gentoo-dev; +Cc: Zurab Kvachadze
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-0.33-hmac-configurable.patch | 71 +++++++++++++++++++
www-nginx/ngx-set-misc/metadata.xml | 25 +++++++
.../ngx-set-misc/ngx-set-misc-0.33.ebuild | 43 +++++++++++
4 files changed, 140 insertions(+)
create mode 100644 www-nginx/ngx-set-misc/Manifest
create mode 100644 www-nginx/ngx-set-misc/files/ngx-set-misc-0.33-hmac-configurable.patch
create mode 100644 www-nginx/ngx-set-misc/metadata.xml
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/www-nginx/ngx-set-misc/files/ngx-set-misc-0.33-hmac-configurable.patch b/www-nginx/ngx-set-misc/files/ngx-set-misc-0.33-hmac-configurable.patch
new file mode 100644
index 000000000000..49302624efa3
--- /dev/null
+++ b/www-nginx/ngx-set-misc/files/ngx-set-misc-0.33-hmac-configurable.patch
@@ -0,0 +1,71 @@
+From 01292430b8eb0972670a3221c4809fc6a9bd98f2 Mon Sep 17 00:00:00 2001
+From: Zurab Kvachadze <zurabid2016@gmail.com>
+Date: Mon, 23 Dec 2024 00:32:18 +0100
+Subject: [PATCH] Make HMAC support easily toggleable
+
+set-misc-nginx-module tries to automagically detect the presence of the
+crypto library by checking USE_OPENSSL and MAIL_SSL shell variables.
+These variables are set by NGINX build system (see 'auto/modules') if
+OpenSSL and mail_ssl modules are being used respectively. Since set-misc
+does not actually depend on any of the NGINX's SSL modules, but rather
+on OpenSSL itself, we change the guard variable to GENTOO_USE_HMAC and
+set from within ebuild based on a USE flag.
+
+This also makes a similar change to ngx_http_set_misc_module.c file.
+
+Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
+---
+ config | 3 ++-
+ src/ngx_http_set_misc_module.c | 6 +++---
+ 2 files changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/config b/config
+index 7bb00af..58bffd4 100755
+--- a/config
++++ b/config
+@@ -54,9 +54,10 @@ SET_MISC_DEPS=" \
+ $ngx_addon_dir/src/ngx_http_set_misc_module.h \
+ "
+
+-if [ $USE_OPENSSL = YES -o $MAIL_SSL = YES ]; then
++if [ $GENTOO_USE_HMAC = YES ]; then
+ SET_MISC_DEPS="$SET_MISC_DEPS $ngx_addon_dir/src/ngx_http_set_hmac.h"
+ SET_MISC_SRCS="$SET_MISC_SRCS $ngx_addon_dir/src/ngx_http_set_hmac.c"
++ CFLAGS="$CFLAGS -DGENTOO_USE_HMAC=1"
+ fi
+
+ CFLAGS="$CFLAGS -DNDK_SET_VAR -DNDK_UPSTREAM_LIST"
+diff --git a/src/ngx_http_set_misc_module.c b/src/ngx_http_set_misc_module.c
+index 3b12b0e..6d4df68 100644
+--- a/src/ngx_http_set_misc_module.c
++++ b/src/ngx_http_set_misc_module.c
+@@ -18,7 +18,7 @@
+ #include "ngx_http_set_hex.h"
+ #include "ngx_http_set_base64.h"
+ #include "ngx_http_set_base64url.h"
+-#if NGX_OPENSSL
++#if GENTOO_USE_HMAC
+ #include "ngx_http_set_hmac.h"
+ #endif
+ #include "ngx_http_set_random.h"
+@@ -90,7 +90,7 @@ static ndk_set_var_t ngx_http_set_misc_set_encode_hex_filter = {
+ };
+
+
+-#if NGX_OPENSSL
++#if GENTOO_USE_HMAC
+ static ndk_set_var_t ngx_http_set_misc_set_hmac_sha1_filter = {
+ NDK_SET_VAR_MULTI_VALUE,
+ (void *) ngx_http_set_misc_set_hmac_sha1,
+@@ -281,7 +281,7 @@ static ngx_command_t ngx_http_set_misc_commands[] = {
+ 0,
+ &ngx_http_set_misc_set_encode_hex_filter
+ },
+-#if NGX_OPENSSL
++#if GENTOO_USE_HMAC
+ { ngx_string ("set_hmac_sha1"),
+ NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF
+ |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE3,
+--
+2.45.3
+
diff --git a/www-nginx/ngx-set-misc/metadata.xml b/www-nginx/ngx-set-misc/metadata.xml
new file mode 100644
index 000000000000..327c79a8fbb6
--- /dev/null
+++ b/www-nginx/ngx-set-misc/metadata.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person" proxied="yes">
+ <email>zurabid2016@gmail.com</email>
+ <name>Zurab Kvachadze</name>
+ </maintainer>
+ <maintainer type="project" proxied="proxy">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <longdescription>
+ The ngx-set-mist module extends the standard NGINX HttpRewriteModule's directive set to
+ provide more functionalities like URI escaping and unescaping, JSON quoting,
+ Hexadecimal/MD5/SHA1/Base32/Base64 digest encoding and decoding, random number generator,
+ and more.
+ </longdescription>
+ <use>
+ <flag name="hmac">Enable support for generating HMAC digests using <pkg>dev-libs/openssl</pkg></flag>
+ </use>
+ <upstream>
+ <bugs-to>https://github.com/openresty/set-misc-nginx-module/issues</bugs-to>
+ <remote-id type="github">openresty/set-misc-nginx-module</remote-id>
+ </upstream>
+</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..c71366126ffe
--- /dev/null
+++ b/www-nginx/ngx-set-misc/ngx-set-misc-0.33.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+MY_PN="set-misc-nginx-module"
+NGINX_MOD_S="${WORKDIR}/${MY_PN}-${PV}"
+
+NGINX_MOD_LINK_MODULES=( www-nginx/ngx_devel_kit )
+
+inherit toolchain-funcs nginx-module
+
+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"
+
+IUSE="+hmac"
+
+RESTRICT="test"
+
+BDEPEND="virtual/pkgconfig"
+DEPEND="hmac? ( dev-libs/openssl:= )"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-0.33-hmac-configurable.patch"
+)
+
+src_configure() {
+ # These are variables patched into the build system to be able to control
+ # HMAC support. For more details, see the "hmac-configurable" patch above.
+ local -x GENTOO_USE_HMAC=NO
+ if use hmac; then
+ GENTOO_USE_HMAC=YES
+ ngx_mod_append_libs "$("$(tc-getPKG_CONFIG)" --libs libcrypto)"
+ fi
+ nginx-module_src_configure
+}
--
2.45.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-dev] [PATCH v3 25/40] www-nginx/ngx-brotli: new package, add 20231109
2025-02-21 16:07 [gentoo-dev] [PATCH v3 00/40] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass Zurab Kvachadze
` (23 preceding siblings ...)
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 24/40] www-nginx/ngx-set-misc: new package, add 0.33 Zurab Kvachadze
@ 2025-02-21 16:08 ` Zurab Kvachadze
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 26/40] www-nginx/ngx-headers-more: new package, add 0.37 Zurab Kvachadze
` (15 subsequent siblings)
40 siblings, 0 replies; 42+ messages in thread
From: Zurab Kvachadze @ 2025-02-21 16:08 UTC (permalink / raw
To: gentoo-dev; +Cc: Zurab Kvachadze
Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
---
www-nginx/ngx-brotli/Manifest | 2 ++
www-nginx/ngx-brotli/metadata.xml | 24 +++++++++++++++
.../ngx-brotli/ngx-brotli-20231109.ebuild | 30 +++++++++++++++++++
3 files changed, 56 insertions(+)
create mode 100644 www-nginx/ngx-brotli/Manifest
create mode 100644 www-nginx/ngx-brotli/metadata.xml
create mode 100644 www-nginx/ngx-brotli/ngx-brotli-20231109.ebuild
diff --git a/www-nginx/ngx-brotli/Manifest b/www-nginx/ngx-brotli/Manifest
new file mode 100644
index 000000000000..9a3492068a39
--- /dev/null
+++ b/www-nginx/ngx-brotli/Manifest
@@ -0,0 +1,2 @@
+DIST brotli-ed738e842d2fbdf2d6459e39267a633c4a9b2f5d.tar.gz 512305 BLAKE2B b646e4565386870443d006a97a13b295c2c66de448e501f809700c303bb3daf5e4f84a2dacec16c43a534879243e4cda9292072630f13d5f7ca54f2c4372e560 SHA512 f493e7f15ca2804ae8715e48bdc954680f527533e684ec3762a7d49d05890915194289ed948c8cce95644274e1dcab952dcfbc84c0108aaf79f35f20270ffe6a
+DIST ngx-brotli-a71f9312c2deb28875acc7bacfdd5695a111aa53.tar.gz 16387 BLAKE2B 2883711581ff5073f8e6451078c046f70323e1c893c3b70f8feb1abfc6ccb420ddb5f5d3b5131eb127538cf9b0cd0d9843d450cacd49b7fc7dfeb0a8c8865de8 SHA512 62a904f1a8e63e169cf09517189d65dd9ee1a6cca2a8461bc4ea29d72f97b940048e34f8dcc4a332785ab603be79f1830e371d920f06bdaa460d7e57915cafdc
diff --git a/www-nginx/ngx-brotli/metadata.xml b/www-nginx/ngx-brotli/metadata.xml
new file mode 100644
index 000000000000..258827550a02
--- /dev/null
+++ b/www-nginx/ngx-brotli/metadata.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person" proxied="yes">
+ <email>zurabid2016@gmail.com</email>
+ <name>Zurab Kvachadze</name>
+ </maintainer>
+ <maintainer type="project" proxied="proxy">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <longdescription>
+ ngx-brotli provides support for Brotli compression in NGINX server. 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.
+ </longdescription>
+ <upstream>
+ <bugs-to>https://github.com/google/ngx_brotli/issues</bugs-to>
+ <remote-id type="github">google/ngx_brotli</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/www-nginx/ngx-brotli/ngx-brotli-20231109.ebuild b/www-nginx/ngx-brotli/ngx-brotli-20231109.ebuild
new file mode 100644
index 000000000000..61db19a9a98c
--- /dev/null
+++ b/www-nginx/ngx-brotli/ngx-brotli-20231109.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+NGX_BROTLI_P="ngx-brotli-a71f9312c2deb28875acc7bacfdd5695a111aa53"
+# A submodule.
+BROTLI_P="brotli-ed738e842d2fbdf2d6459e39267a633c4a9b2f5d"
+
+MY_PN="${PN//-/_}"
+NGINX_MOD_S="${WORKDIR}/${MY_PN}-${NGX_BROTLI_P#ngx-brotli-}"
+inherit nginx-module
+
+DESCRIPTION="NGINX module for Brotli compression"
+HOMEPAGE="https://github.com/google/ngx_brotli"
+SRC_URI="
+ https://github.com/google/ngx_brotli/archive/${NGX_BROTLI_P#ngx-brotli-}.tar.gz -> ${NGX_BROTLI_P}.tar.gz
+ https://github.com/google/brotli/archive/${BROTLI_P#brotli-}.tar.gz -> ${BROTLI_P}.tar.gz
+"
+
+LICENSE="BSD-2"
+SLOT="0"
+
+src_unpack() {
+ nginx-module_src_unpack
+
+ # Move the submodule to its place.
+ rmdir "${NGINX_MOD_S}/deps/brotli" || die "rmdir failed"
+ mv "./${BROTLI_P}" "${NGINX_MOD_S}/deps/brotli" || die "mv failed"
+}
--
2.45.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-dev] [PATCH v3 26/40] www-nginx/ngx-headers-more: new package, add 0.37
2025-02-21 16:07 [gentoo-dev] [PATCH v3 00/40] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass Zurab Kvachadze
` (24 preceding siblings ...)
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 25/40] www-nginx/ngx-brotli: new package, add 20231109 Zurab Kvachadze
@ 2025-02-21 16:08 ` Zurab Kvachadze
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 27/40] www-nginx/ngx-upload-progress: new package, add 0.9.3 Zurab Kvachadze
` (14 subsequent siblings)
40 siblings, 0 replies; 42+ messages in thread
From: Zurab Kvachadze @ 2025-02-21 16:08 UTC (permalink / raw
To: gentoo-dev; +Cc: Zurab Kvachadze
Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
---
| 1 +
.../metadata.xml | 13 +++++++------
| 19 +++++++++++++++++++
3 files changed, 27 insertions(+), 6 deletions(-)
create mode 100644 www-nginx/ngx-headers-more/Manifest
copy www-nginx/{ngx-encrypted-session => ngx-headers-more}/metadata.xml (50%)
create mode 100644 www-nginx/ngx-headers-more/ngx-headers-more-0.37.ebuild
--git a/www-nginx/ngx-headers-more/Manifest b/www-nginx/ngx-headers-more/Manifest
new file mode 100644
index 000000000000..ce0a7423c736
--- /dev/null
+++ b/www-nginx/ngx-headers-more/Manifest
@@ -0,0 +1 @@
+DIST ngx-headers-more-0.37.tar.gz 29433 BLAKE2B 0029eac59ee7182dbcb9be93f2f25684bae200e1ee897e2d4dde6abc304b4c7e7373a4cdd3059c5ec1b199a3d5467e034889a4cf1f133d26194acbc4374a1054 SHA512 0cc2fffe506194d439e3669644d41b7943e2c3cffa3483eb70b92067930b358d506a14646eff8362b191a11c624db29f6b53d830876929dcb4ce1c9d7b2bc40d
diff --git a/www-nginx/ngx-encrypted-session/metadata.xml b/www-nginx/ngx-headers-more/metadata.xml
similarity index 50%
copy from www-nginx/ngx-encrypted-session/metadata.xml
copy to www-nginx/ngx-headers-more/metadata.xml
index 2691b306a130..cbcfe86571ca 100644
--- a/www-nginx/ngx-encrypted-session/metadata.xml
+++ b/www-nginx/ngx-headers-more/metadata.xml
@@ -10,13 +10,14 @@
<name>Proxy Maintainers</name>
</maintainer>
<longdescription>
- The encrypted-session module provides encryption and decryption support for nginx variables
- based on AES-256 with Mac. It is usually used with the ngx_set_misc module and the
- standard rewrite module's directives. This module can be used to implement simple user login
- and ACL.
+ The ngx-headers-more module allows adding, settin, or clearing any output or input header.
+
+ This is an enhanced version of the standard headers module since it provides more
+ utilities like resetting or clearing "builtin headers" like Content-Type, Content-Length,
+ and Server.
</longdescription>
<upstream>
- <bugs-to>https://github.com/openresty/encrypted-session-nginx-module/issues</bugs-to>
- <remote-id type="github">openresty/encrypted-session-nginx-module</remote-id>
+ <bugs-to>https://github.com/openresty/headers-more-nginx-module/issues</bugs-to>
+ <remote-id type="github">openresty/headers-more-nginx-module</remote-id>
</upstream>
</pkgmetadata>
--git a/www-nginx/ngx-headers-more/ngx-headers-more-0.37.ebuild b/www-nginx/ngx-headers-more/ngx-headers-more-0.37.ebuild
new file mode 100644
index 000000000000..606446a9641e
--- /dev/null
+++ b/www-nginx/ngx-headers-more/ngx-headers-more-0.37.ebuild
@@ -0,0 +1,19 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+MY_PN="headers-more-nginx-module"
+NGINX_MOD_S="${WORKDIR}/${MY_PN}-${PV}"
+inherit nginx-module
+
+DESCRIPTION="Set, add, and clear arbitrary output headers in NGINX HTTP servers"
+HOMEPAGE="https://github.com/openresty/headers-more-nginx-module"
+SRC_URI="
+ https://github.com/openresty/headers-more-nginx-module/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
+"
+
+LICENSE="BSD-2"
+SLOT="0"
+
+RESTRICT="test"
--
2.45.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-dev] [PATCH v3 27/40] www-nginx/ngx-upload-progress: new package, add 0.9.3
2025-02-21 16:07 [gentoo-dev] [PATCH v3 00/40] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass Zurab Kvachadze
` (25 preceding siblings ...)
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 26/40] www-nginx/ngx-headers-more: new package, add 0.37 Zurab Kvachadze
@ 2025-02-21 16:08 ` Zurab Kvachadze
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 28/40] dev-lua/lua-resty-core: new package, add 0.1.30 Zurab Kvachadze
` (13 subsequent siblings)
40 siblings, 0 replies; 42+ messages in thread
From: Zurab Kvachadze @ 2025-02-21 16:08 UTC (permalink / raw
To: gentoo-dev; +Cc: Zurab Kvachadze
Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
---
www-nginx/ngx-upload-progress/Manifest | 1 +
www-nginx/ngx-upload-progress/metadata.xml | 24 +++++++++++++++++++
.../ngx-upload-progress-0.9.3.ebuild | 20 ++++++++++++++++
3 files changed, 45 insertions(+)
create mode 100644 www-nginx/ngx-upload-progress/Manifest
create mode 100644 www-nginx/ngx-upload-progress/metadata.xml
create mode 100644 www-nginx/ngx-upload-progress/ngx-upload-progress-0.9.3.ebuild
diff --git a/www-nginx/ngx-upload-progress/Manifest b/www-nginx/ngx-upload-progress/Manifest
new file mode 100644
index 000000000000..932d7f7e777b
--- /dev/null
+++ b/www-nginx/ngx-upload-progress/Manifest
@@ -0,0 +1 @@
+DIST ngx-upload-progress-0.9.3.tar.gz 17303 BLAKE2B 80053985e5b07ab6baf1852514210264b29abdc36689a1d57d7ed5c52b54239911bc6f25d1d062be2015b9809b2efc122a1e424cc8e14971d04fb26b3a65af96 SHA512 43361c584207ddab61ddd9266507b0e1c39041b792e99325088b0621a870ff52b3c191becf4c8ad4fba0c7b7ca29a3a12472b95e9c20c0610c50c6ccedb45871
diff --git a/www-nginx/ngx-upload-progress/metadata.xml b/www-nginx/ngx-upload-progress/metadata.xml
new file mode 100644
index 000000000000..26cbb24af8bf
--- /dev/null
+++ b/www-nginx/ngx-upload-progress/metadata.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person" proxied="yes">
+ <email>zurabid2016@gmail.com</email>
+ <name>Zurab Kvachadze</name>
+ </maintainer>
+ <maintainer type="project" proxied="proxy">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <longdescription>
+ The ngx-upload-proress module is an NGINX module that implements an upload progress system
+ which monitors RFC1867 POST upload as they are transmitted to upstream servers.
+
+ The module works by tracking the uploads proxied by NGINX to upstream servers without analysing the
+ uploaded content and offers a web API to report upload progress in JavaScript, JSON or any
+ other format (with the help of templates).
+ </longdescription>
+ <upstream>
+ <bugs-to>https://github.com/masterzen/nginx-upload-progress-module/issues</bugs-to>
+ <remote-id type="github">masterzen/nginx-upload-progress-module</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/www-nginx/ngx-upload-progress/ngx-upload-progress-0.9.3.ebuild b/www-nginx/ngx-upload-progress/ngx-upload-progress-0.9.3.ebuild
new file mode 100644
index 000000000000..c9e3856c74eb
--- /dev/null
+++ b/www-nginx/ngx-upload-progress/ngx-upload-progress-0.9.3.ebuild
@@ -0,0 +1,20 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+MY_PN="nginx-upload-progress-module"
+inherit nginx-module
+
+DESCRIPTION="An upload progress system for NGINX monitoring RFC1867 POST uploads"
+HOMEPAGE="https://github.com/masterzen/nginx-upload-progress-module"
+SRC_URI="
+ https://github.com/masterzen/nginx-upload-progress-module/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
+"
+NGINX_MOD_S="${WORKDIR}/${MY_PN}-${PV}"
+
+LICENSE="BSD-2"
+SLOT="0"
+
+# Uses custom shell-based tests.
+RESTRICT="test"
--
2.45.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-dev] [PATCH v3 28/40] dev-lua/lua-resty-core: new package, add 0.1.30
2025-02-21 16:07 [gentoo-dev] [PATCH v3 00/40] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass Zurab Kvachadze
` (26 preceding siblings ...)
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 27/40] www-nginx/ngx-upload-progress: new package, add 0.9.3 Zurab Kvachadze
@ 2025-02-21 16:08 ` Zurab Kvachadze
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 29/40] dev-lua/lua-resty-lrucache: new package, add 0.15 Zurab Kvachadze
` (12 subsequent siblings)
40 siblings, 0 replies; 42+ messages in thread
From: Zurab Kvachadze @ 2025-02-21 16:08 UTC (permalink / raw
To: gentoo-dev; +Cc: Zurab Kvachadze
lua-resty-core[1] is a "FFI-based Lua API", required by
www-nginx/ngx-lua-module.
[1]: https://github.com/openresty/lua-resty-core
Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
---
dev-lua/lua-resty-core/Manifest | 1 +
.../lua-resty-core-0.1.30.ebuild | 33 +++++++++++++++++++
dev-lua/lua-resty-core/metadata.xml | 24 ++++++++++++++
3 files changed, 58 insertions(+)
create mode 100644 dev-lua/lua-resty-core/Manifest
create mode 100644 dev-lua/lua-resty-core/lua-resty-core-0.1.30.ebuild
create mode 100644 dev-lua/lua-resty-core/metadata.xml
diff --git a/dev-lua/lua-resty-core/Manifest b/dev-lua/lua-resty-core/Manifest
new file mode 100644
index 000000000000..3a2f5fd11082
--- /dev/null
+++ b/dev-lua/lua-resty-core/Manifest
@@ -0,0 +1 @@
+DIST lua-resty-core-0.1.30.tar.gz 226422 BLAKE2B c1afe9d7f06b9fe52ae8ea1840afa9ce7525f01aa7f9bd632d08ee9b84e2253fb531ee506e3e9acd641cc30e978d2d2f54d9e986c3982974ae866f561208bc84 SHA512 e3951e71600b16732b3d1fc0e9c9497e9e73e739628ca06171e0274ebe880e3ce77a7992a98e911e33fbd336bc723c45e198357046308d5043e64e3003ccb26f
diff --git a/dev-lua/lua-resty-core/lua-resty-core-0.1.30.ebuild b/dev-lua/lua-resty-core/lua-resty-core-0.1.30.ebuild
new file mode 100644
index 000000000000..eb4de4b5c50e
--- /dev/null
+++ b/dev-lua/lua-resty-core/lua-resty-core-0.1.30.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# Openresty only ever supports luajit.
+LUA_COMPAT=( luajit )
+inherit lua-single
+
+DESCRIPTION="FFI-based API for lua-nginx-module"
+HOMEPAGE="https://github.com/openresty/lua-resty-core"
+SRC_URI="
+ https://github.com/openresty/lua-resty-core/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
+"
+
+LICENSE="BSD-2"
+SLOT="0"
+# Tests require replicating much of nginx-module_src_test() in each
+# dev-lua/lua-resty-* ebuild.
+RESTRICT="test"
+
+REQUIRED_USE="${LUA_REQUIRED_USE}"
+
+BDEPEND="virtual/pkgconfig"
+DEPEND="${LUA_DEPS}"
+RDEPEND="${DEPEND}"
+
+src_configure() {
+ # The directory where to Lua files are to be installed, used by the build
+ # system.
+ export LUA_LIB_DIR="$(lua_get_lmod_dir)"
+ default
+}
diff --git a/dev-lua/lua-resty-core/metadata.xml b/dev-lua/lua-resty-core/metadata.xml
new file mode 100644
index 000000000000..2eafe932ef4b
--- /dev/null
+++ b/dev-lua/lua-resty-core/metadata.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person" proxied="yes">
+ <email>zurabid2016@gmail.com</email>
+ <name>Zurab Kvachadze</name>
+ </maintainer>
+ <maintainer type="project" proxied="proxy">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <longdescription>
+ This Lua library reimplements part of the ngx_lua module's NGINX API for Lua with LuaJIT FFI
+ and installs the new FFI-based Lua API into the ngx.* and ndk.* namespaces used by the
+ ngx_lua module.
+
+ In addition, this Lua library implements any significant new Lua APIs of the ngx_lua module
+ as proper Lua modules, like ngx.semaphore and ngx.balancer.
+ </longdescription>
+ <upstream>
+ <bugs-to>https://github.com/openresty/lua-resty-core/issues</bugs-to>
+ <remote-id type="github">openresty/lua-resty-core</remote-id>
+ </upstream>
+</pkgmetadata>
--
2.45.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-dev] [PATCH v3 29/40] dev-lua/lua-resty-lrucache: new package, add 0.15
2025-02-21 16:07 [gentoo-dev] [PATCH v3 00/40] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass Zurab Kvachadze
` (27 preceding siblings ...)
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 28/40] dev-lua/lua-resty-core: new package, add 0.1.30 Zurab Kvachadze
@ 2025-02-21 16:08 ` Zurab Kvachadze
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 30/40] www-nginx/ngx-lua-module: new package, add 0.10.27 Zurab Kvachadze
` (11 subsequent siblings)
40 siblings, 0 replies; 42+ messages in thread
From: Zurab Kvachadze @ 2025-02-21 16:08 UTC (permalink / raw
To: gentoo-dev; +Cc: Zurab Kvachadze
lua-resty-lrucache[1] is a "Lua LRU cache"; it is a runtime dependency of
www-nginx/ngx-lua-module.
[1]: https://github.com/openresty/lua-resty-lrucache
Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
---
dev-lua/lua-resty-lrucache/Manifest | 1 +
.../lua-resty-lrucache-0.15.ebuild} | 6 +++---
.../usbmuxd => dev-lua/lua-resty-lrucache}/metadata.xml | 6 +++++-
3 files changed, 9 insertions(+), 4 deletions(-)
create mode 100644 dev-lua/lua-resty-lrucache/Manifest
copy dev-lua/{lua-resty-core/lua-resty-core-0.1.30.ebuild => lua-resty-lrucache/lua-resty-lrucache-0.15.ebuild} (74%)
copy {app-pda/usbmuxd => dev-lua/lua-resty-lrucache}/metadata.xml (61%)
diff --git a/dev-lua/lua-resty-lrucache/Manifest b/dev-lua/lua-resty-lrucache/Manifest
new file mode 100644
index 000000000000..3af68d23c1fa
--- /dev/null
+++ b/dev-lua/lua-resty-lrucache/Manifest
@@ -0,0 +1 @@
+DIST lua-resty-lrucache-0.15.tar.gz 17834 BLAKE2B 80e6c1472de7df1b4c4e34cc002d64ae2aad92da8e0346325bb75e3ddb03c9015d5c34ffc961afbab6a06f0922eb11c0e17a1a91ddb0c84d42fe8c3aaf7c2c07 SHA512 544d862fb6de66c6a9e342ba62aaf11b639ba199c97261a74881a9b395705e2a78b96d58a405dab7793b53be12cd8108d3861f6d30c3b3950b565fed1547a47d
diff --git a/dev-lua/lua-resty-core/lua-resty-core-0.1.30.ebuild b/dev-lua/lua-resty-lrucache/lua-resty-lrucache-0.15.ebuild
similarity index 74%
copy from dev-lua/lua-resty-core/lua-resty-core-0.1.30.ebuild
copy to dev-lua/lua-resty-lrucache/lua-resty-lrucache-0.15.ebuild
index eb4de4b5c50e..f85dbf3f9a66 100644
--- a/dev-lua/lua-resty-core/lua-resty-core-0.1.30.ebuild
+++ b/dev-lua/lua-resty-lrucache/lua-resty-lrucache-0.15.ebuild
@@ -7,10 +7,10 @@ EAPI=8
LUA_COMPAT=( luajit )
inherit lua-single
-DESCRIPTION="FFI-based API for lua-nginx-module"
-HOMEPAGE="https://github.com/openresty/lua-resty-core"
+DESCRIPTION="Lua-land LRU Cache based on LuaJIT FFI"
+HOMEPAGE="https://github.com/openresty/lua-resty-lrucache"
SRC_URI="
- https://github.com/openresty/lua-resty-core/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
+ https://github.com/openresty/lua-resty-lrucache/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
"
LICENSE="BSD-2"
diff --git a/app-pda/usbmuxd/metadata.xml b/dev-lua/lua-resty-lrucache/metadata.xml
similarity index 61%
copy from app-pda/usbmuxd/metadata.xml
copy to dev-lua/lua-resty-lrucache/metadata.xml
index d8e789b30263..81d1558075b9 100644
--- a/app-pda/usbmuxd/metadata.xml
+++ b/dev-lua/lua-resty-lrucache/metadata.xml
@@ -9,7 +9,11 @@
<email>proxy-maint@gentoo.org</email>
<name>Proxy Maintainers</name>
</maintainer>
+ <longdescription>
+ This library implements a simple LRU cache for OpenResty and the ngx_lua module.
+ </longdescription>
<upstream>
- <remote-id type="github">libimobiledevice/usbmuxd</remote-id>
+ <bugs-to>https://github.com/openresty/lua-resty-lrucache/issues</bugs-to>
+ <remote-id type="github">openresty/lua-resty-lrucache</remote-id>
</upstream>
</pkgmetadata>
--
2.45.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-dev] [PATCH v3 30/40] www-nginx/ngx-lua-module: new package, add 0.10.27
2025-02-21 16:07 [gentoo-dev] [PATCH v3 00/40] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass Zurab Kvachadze
` (28 preceding siblings ...)
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 29/40] dev-lua/lua-resty-lrucache: new package, add 0.15 Zurab Kvachadze
@ 2025-02-21 16:08 ` Zurab Kvachadze
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 31/40] dev-lua/lua-resty-string: new package, add 0.16 Zurab Kvachadze
` (10 subsequent siblings)
40 siblings, 0 replies; 42+ messages in thread
From: Zurab Kvachadze @ 2025-02-21 16:08 UTC (permalink / raw
To: gentoo-dev; +Cc: Zurab Kvachadze
This package requires two environmental variables being set in order to
use Lua: LUAJIT_LIB and LUAJIT_INC. The former is set to /usr/${libdir},
for the latter one, the ebuild uses pkg-config directly to get the
include directory.
Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
---
www-nginx/ngx-lua-module/Manifest | 1 +
...lua-module-0.10.27-always-define-NDK.patch | 29 ++++++++
...0.10.27-do-not-log-non-openresty-lua.patch | 41 ++++++++++++
.../ngx-lua-module}/metadata.xml | 8 ++-
.../ngx-lua-module-0.10.27.ebuild | 67 +++++++++++++++++++
5 files changed, 143 insertions(+), 3 deletions(-)
create mode 100644 www-nginx/ngx-lua-module/Manifest
create mode 100644 www-nginx/ngx-lua-module/files/ngx-lua-module-0.10.27-always-define-NDK.patch
create mode 100644 www-nginx/ngx-lua-module/files/ngx-lua-module-0.10.27-do-not-log-non-openresty-lua.patch
copy {dev-lua/lua-resty-lrucache => www-nginx/ngx-lua-module}/metadata.xml (56%)
create mode 100644 www-nginx/ngx-lua-module/ngx-lua-module-0.10.27.ebuild
diff --git a/www-nginx/ngx-lua-module/Manifest b/www-nginx/ngx-lua-module/Manifest
new file mode 100644
index 000000000000..245ccaf878bd
--- /dev/null
+++ b/www-nginx/ngx-lua-module/Manifest
@@ -0,0 +1 @@
+DIST ngx-lua-module-0.10.27.tar.gz 758952 BLAKE2B 3c0a85fac3452a50eb4009405d7a8f76262d3d36c844139ce3eb829eefef098641b161e0ff27487332fa21269667a838bd2d913cea1c4b183cd9cad87ac76783 SHA512 ff1f7bb593a91402453709d63c95b304ef14d805f5a7f8e6689e95b93522823b80f76baced70664c9f46e9fc8da3941f153b9cf5d1dfbabfb0ee9d9bcc8151b4
diff --git a/www-nginx/ngx-lua-module/files/ngx-lua-module-0.10.27-always-define-NDK.patch b/www-nginx/ngx-lua-module/files/ngx-lua-module-0.10.27-always-define-NDK.patch
new file mode 100644
index 000000000000..309670bcb3d5
--- /dev/null
+++ b/www-nginx/ngx-lua-module/files/ngx-lua-module-0.10.27-always-define-NDK.patch
@@ -0,0 +1,29 @@
+From e156f14b262ec3dce32e87dfeb0dabce4821646c Mon Sep 17 00:00:00 2001
+From: Zurab Kvachadze <zurabid2016@gmail.com>
+Date: Sun, 16 Feb 2025 22:51:03 +0100
+Subject: [PATCH] src/ngx_http_lua_common.h: always #define NDK
+
+In Gentoo, NDK is a mandatory dependency. Make life easier for everybody
+and just define the NDK macro.
+
+Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
+---
+ src/ngx_http_lua_common.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/ngx_http_lua_common.h b/src/ngx_http_lua_common.h
+index cc2d36a3..42a7df6b 100644
+--- a/src/ngx_http_lua_common.h
++++ b/src/ngx_http_lua_common.h
+@@ -23,6 +23,8 @@
+ #include <lualib.h>
+ #include <lauxlib.h>
+
++#define NDK 1
++
+
+ #if defined(NDK) && NDK
+ #include <ndk.h>
+--
+2.45.3
+
diff --git a/www-nginx/ngx-lua-module/files/ngx-lua-module-0.10.27-do-not-log-non-openresty-lua.patch b/www-nginx/ngx-lua-module/files/ngx-lua-module-0.10.27-do-not-log-non-openresty-lua.patch
new file mode 100644
index 000000000000..98c5967da149
--- /dev/null
+++ b/www-nginx/ngx-lua-module/files/ngx-lua-module-0.10.27-do-not-log-non-openresty-lua.patch
@@ -0,0 +1,41 @@
+From 87a7e04982a2d2963b10965304d822554d1ec848 Mon Sep 17 00:00:00 2001
+From: Zurab Kvachadze <zurabid2016@gmail.com>
+Date: Tue, 11 Feb 2025 10:57:14 +0100
+Subject: [PATCH] Do not log error if non-OpenResty Lua is used
+
+Users are perfectly capable of reading the recommendation on README and
+deciding themselves which distribution of Lua to use. There is no need
+to scream at the users each time NGINX is started.
+
+Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
+---
+ src/ngx_http_lua_module.c | 13 +------------
+ 1 file changed, 1 insertion(+), 12 deletions(-)
+
+diff --git a/src/ngx_http_lua_module.c b/src/ngx_http_lua_module.c
+index 63367f46..4ddf7b21 100644
+--- a/src/ngx_http_lua_module.c
++++ b/src/ngx_http_lua_module.c
+@@ -895,18 +895,7 @@ ngx_http_lua_init(ngx_conf_t *cf)
+ if (lmcf->lua == NULL) {
+ dd("initializing lua vm");
+
+-#ifndef OPENRESTY_LUAJIT
+- if (ngx_process != NGX_PROCESS_SIGNALLER && !ngx_test_config) {
+- ngx_log_error(NGX_LOG_ALERT, cf->log, 0,
+- "detected a LuaJIT version which is not OpenResty's"
+- "; many optimizations will be disabled and "
+- "performance will be compromised (see "
+- "https://github.com/openresty/luajit2 for "
+- "OpenResty's LuaJIT or, even better, consider using "
+- "the OpenResty releases from https://openresty.org/"
+- "en/download.html)");
+- }
+-#else
++#ifdef OPENRESTY_LUAJIT
+ # if !defined(HAVE_LUA_RESETTHREAD)
+ ngx_log_error(NGX_LOG_ALERT, cf->log, 0,
+ "detected an old version of OpenResty's LuaJIT missing "
+--
+2.45.3
+
diff --git a/dev-lua/lua-resty-lrucache/metadata.xml b/www-nginx/ngx-lua-module/metadata.xml
similarity index 56%
copy from dev-lua/lua-resty-lrucache/metadata.xml
copy to www-nginx/ngx-lua-module/metadata.xml
index 81d1558075b9..42a518e970f5 100644
--- a/dev-lua/lua-resty-lrucache/metadata.xml
+++ b/www-nginx/ngx-lua-module/metadata.xml
@@ -10,10 +10,12 @@
<name>Proxy Maintainers</name>
</maintainer>
<longdescription>
- This library implements a simple LRU cache for OpenResty and the ngx_lua module.
+ The ngx-lua module embeds LuaJIT 2.0/2.1 into NGINX. By leveraging NGINX's subrequests, this
+ module allows the integration of the powerful Lua threads (known as Lua "coroutines") into
+ the NGINX event model.
</longdescription>
<upstream>
- <bugs-to>https://github.com/openresty/lua-resty-lrucache/issues</bugs-to>
- <remote-id type="github">openresty/lua-resty-lrucache</remote-id>
+ <bugs-to>https://github.com/openresty/lua-nginx-module/issues</bugs-to>
+ <remote-id type="github">openresty/lua-nginx-module</remote-id>
</upstream>
</pkgmetadata>
diff --git a/www-nginx/ngx-lua-module/ngx-lua-module-0.10.27.ebuild b/www-nginx/ngx-lua-module/ngx-lua-module-0.10.27.ebuild
new file mode 100644
index 000000000000..1f29f1fc2be8
--- /dev/null
+++ b/www-nginx/ngx-lua-module/ngx-lua-module-0.10.27.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# Upstream supports luajit only.
+LUA_COMPAT=( luajit )
+
+MY_PN="lua-nginx-module"
+NGINX_MOD_S="${WORKDIR}/${MY_PN}-${PV}"
+
+NGINX_MOD_LINK_MODULES=( www-nginx/ngx_devel_kit )
+
+inherit lua-single toolchain-funcs nginx-module
+
+DESCRIPTION="A module embedding the power of Lua into NGINX HTTP Servers"
+HOMEPAGE="https://github.com/openresty/lua-nginx-module"
+SRC_URI="
+ https://github.com/openresty/lua-nginx-module/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
+"
+
+LICENSE="BSD-2"
+SLOT="0"
+
+IUSE="+ssl"
+REQUIRED_USE="${LUA_REQUIRED_USE}"
+
+# Tests require too much manual patching to get working.
+RESTRICT="test"
+
+BDEPEND="virtual/pkgconfig"
+DEPEND="${LUA_DEPS}"
+# ngx-lua-module does not use OpenSSL by itself, rather some of the modules,
+# like lua-resty-string, use SHA functions through LuaJIT's FFI.
+DEPEND+=" ssl? ( dev-libs/openssl:= )"
+RDEPEND="
+ ${DEPEND}
+ dev-lua/lua-resty-core[${LUA_SINGLE_USEDEP}]
+ dev-lua/lua-resty-lrucache[${LUA_SINGLE_USEDEP}]
+"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-0.10.27-always-define-NDK.patch"
+ "${FILESDIR}/${PN}-0.10.27-do-not-log-non-openresty-lua.patch"
+)
+
+src_configure() {
+ # The config script does some manual auto-detection, which only looks for
+ # luajit-2.0, so we set the necessary variables manually.
+ export LUAJIT_LIB="${ESYSROOT}/usr/$(get_libdir)"
+ export LUAJIT_INC="$(lua_get_include_dir)"
+
+ # Link to dev-libs/openssl so that SHA functions are available for Lua
+ # modules like lua-resty-string.
+ use ssl && ngx_mod_append_libs "$("$(tc-getPKG_CONFIG)" --libs libcrypto)"
+
+ nginx-module_src_configure
+}
+
+src_install() {
+ nginx-module_src_install
+
+ # Install headers from 'src/api' into '/usr/include/nginx/modules'.
+ insinto /usr/include/nginx/modules
+ find "${NGINX_MOD_S}/src/api" -type f -name '*.h' -print0 | xargs -0 doins
+ assert "find failed"
+}
--
2.45.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-dev] [PATCH v3 31/40] dev-lua/lua-resty-string: new package, add 0.16
2025-02-21 16:07 [gentoo-dev] [PATCH v3 00/40] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass Zurab Kvachadze
` (29 preceding siblings ...)
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 30/40] www-nginx/ngx-lua-module: new package, add 0.10.27 Zurab Kvachadze
@ 2025-02-21 16:08 ` Zurab Kvachadze
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 32/40] dev-lua/lua-resty-mysql: new package, add 0.27 Zurab Kvachadze
` (9 subsequent siblings)
40 siblings, 0 replies; 42+ messages in thread
From: Zurab Kvachadze @ 2025-02-21 16:08 UTC (permalink / raw
To: gentoo-dev; +Cc: Zurab Kvachadze
lua-resty-string[1] is a Lua module for ngx-lua-module NGINX module
providing "string utilities and common hash functions for ngx_lua and
LuaJIT".
[1]: https://github.com/openresty/lua-resty-string
Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
---
dev-lua/lua-resty-string/Manifest | 1 +
.../lua-resty-string-0.16.ebuild} | 11 ++++++++---
.../usbmuxd => dev-lua/lua-resty-string}/metadata.xml | 3 ++-
3 files changed, 11 insertions(+), 4 deletions(-)
create mode 100644 dev-lua/lua-resty-string/Manifest
copy dev-lua/{lua-resty-lrucache/lua-resty-lrucache-0.15.ebuild => lua-resty-string/lua-resty-string-0.16.ebuild} (50%)
copy {app-pda/usbmuxd => dev-lua/lua-resty-string}/metadata.xml (75%)
diff --git a/dev-lua/lua-resty-string/Manifest b/dev-lua/lua-resty-string/Manifest
new file mode 100644
index 000000000000..dece9c7070ec
--- /dev/null
+++ b/dev-lua/lua-resty-string/Manifest
@@ -0,0 +1 @@
+DIST lua-resty-string-0.16.tar.gz 13078 BLAKE2B 9c0903da36f6309fed47c9f184510c53877d35c86a8b6ba91e008c5010a8b65adec70b7e6911e51cae1121c5c2c64638b3c41117ae4b7949613766d5403fda31 SHA512 dff61ebfe42ea055c2d20ab8d54a53a88d67b40dfb87bb97aa91e857a8f95884c2444d50942a6b7e580f503cc98467799b421dc659dc5d1d41c64fb30d303746
diff --git a/dev-lua/lua-resty-lrucache/lua-resty-lrucache-0.15.ebuild b/dev-lua/lua-resty-string/lua-resty-string-0.16.ebuild
similarity index 50%
copy from dev-lua/lua-resty-lrucache/lua-resty-lrucache-0.15.ebuild
copy to dev-lua/lua-resty-string/lua-resty-string-0.16.ebuild
index f85dbf3f9a66..4640e515e1f2 100644
--- a/dev-lua/lua-resty-lrucache/lua-resty-lrucache-0.15.ebuild
+++ b/dev-lua/lua-resty-string/lua-resty-string-0.16.ebuild
@@ -7,10 +7,10 @@ EAPI=8
LUA_COMPAT=( luajit )
inherit lua-single
-DESCRIPTION="Lua-land LRU Cache based on LuaJIT FFI"
-HOMEPAGE="https://github.com/openresty/lua-resty-lrucache"
+DESCRIPTION="String utilities and common hash functions for the ngx-lua-module NGINX module"
+HOMEPAGE="https://github.com/openresty/lua-resty-string"
SRC_URI="
- https://github.com/openresty/lua-resty-lrucache/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
+ https://github.com/openresty/lua-resty-string/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
"
LICENSE="BSD-2"
@@ -24,6 +24,11 @@ REQUIRED_USE="${LUA_REQUIRED_USE}"
BDEPEND="virtual/pkgconfig"
DEPEND="${LUA_DEPS}"
RDEPEND="${DEPEND}"
+# www-nginx/ngx-lua-module[test] depends on dev-lua/lua-resty-mysql, which, in
+# turn, depends on dev-lua/lua-resty-string (this package). lua-resty-string
+# requires SSL support to function, so www-nginx/ngx-lua-module[ssl] is put into
+# PDEPEND to avoid circular dependencies.
+PDEPEND="www-nginx/ngx-lua-module[${LUA_SINGLE_USEDEP},ssl(-)]"
src_configure() {
# The directory where to Lua files are to be installed, used by the build
diff --git a/app-pda/usbmuxd/metadata.xml b/dev-lua/lua-resty-string/metadata.xml
similarity index 75%
copy from app-pda/usbmuxd/metadata.xml
copy to dev-lua/lua-resty-string/metadata.xml
index d8e789b30263..a65b3294ea75 100644
--- a/app-pda/usbmuxd/metadata.xml
+++ b/dev-lua/lua-resty-string/metadata.xml
@@ -10,6 +10,7 @@
<name>Proxy Maintainers</name>
</maintainer>
<upstream>
- <remote-id type="github">libimobiledevice/usbmuxd</remote-id>
+ <bugs-to>https://github.com/openresty/lua-resty-string/issues</bugs-to>
+ <remote-id type="github">openresty/lua-resty-string</remote-id>
</upstream>
</pkgmetadata>
--
2.45.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-dev] [PATCH v3 32/40] dev-lua/lua-resty-mysql: new package, add 0.27
2025-02-21 16:07 [gentoo-dev] [PATCH v3 00/40] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass Zurab Kvachadze
` (30 preceding siblings ...)
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 31/40] dev-lua/lua-resty-string: new package, add 0.16 Zurab Kvachadze
@ 2025-02-21 16:08 ` Zurab Kvachadze
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 33/40] dev-lua/lua-resty-memcached: new package, add 0.17 Zurab Kvachadze
` (8 subsequent siblings)
40 siblings, 0 replies; 42+ messages in thread
From: Zurab Kvachadze @ 2025-02-21 16:08 UTC (permalink / raw
To: gentoo-dev; +Cc: Zurab Kvachadze
lua-resty-mysql[1] is a "nonblocking Lua MySQL driver library for
ngx_lua".
[1]: https://github.com/openresty/lua-resty-mysql
Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
---
dev-lua/lua-resty-mysql/Manifest | 1 +
.../lua-resty-mysql-0.27.ebuild} | 12 ++++++++----
.../metadata.xml | 9 ++++++---
3 files changed, 15 insertions(+), 7 deletions(-)
create mode 100644 dev-lua/lua-resty-mysql/Manifest
copy dev-lua/{lua-resty-core/lua-resty-core-0.1.30.ebuild => lua-resty-mysql/lua-resty-mysql-0.27.ebuild} (61%)
copy dev-lua/{lua-resty-lrucache => lua-resty-mysql}/metadata.xml (58%)
diff --git a/dev-lua/lua-resty-mysql/Manifest b/dev-lua/lua-resty-mysql/Manifest
new file mode 100644
index 000000000000..b4bb7a726d6c
--- /dev/null
+++ b/dev-lua/lua-resty-mysql/Manifest
@@ -0,0 +1 @@
+DIST lua-resty-mysql-0.27.tar.gz 128105 BLAKE2B 32b012691dd6b8aa29bd663b16d51d775c85268abd2a6018be5d154e8af7b191f87d26e627208bf99ee64bd329e71feab17df2636d9e83b3454412ce916ef591 SHA512 5b3ee2ae61fc87af9253d23d79fdfeffa78e8167a72d37ec31a27686b353ec8b5a3863ba8281f69f26acfcdb984eaa759646c235a3278476db2059970f613f03
diff --git a/dev-lua/lua-resty-core/lua-resty-core-0.1.30.ebuild b/dev-lua/lua-resty-mysql/lua-resty-mysql-0.27.ebuild
similarity index 61%
copy from dev-lua/lua-resty-core/lua-resty-core-0.1.30.ebuild
copy to dev-lua/lua-resty-mysql/lua-resty-mysql-0.27.ebuild
index eb4de4b5c50e..08350757ce10 100644
--- a/dev-lua/lua-resty-core/lua-resty-core-0.1.30.ebuild
+++ b/dev-lua/lua-resty-mysql/lua-resty-mysql-0.27.ebuild
@@ -7,10 +7,10 @@ EAPI=8
LUA_COMPAT=( luajit )
inherit lua-single
-DESCRIPTION="FFI-based API for lua-nginx-module"
-HOMEPAGE="https://github.com/openresty/lua-resty-core"
+DESCRIPTION="Nonblocking Lua MySQL driver library for the ngx-lua-module NGINX module"
+HOMEPAGE="https://github.com/openresty/lua-resty-mysql"
SRC_URI="
- https://github.com/openresty/lua-resty-core/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
+ https://github.com/openresty/lua-resty-mysql/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
"
LICENSE="BSD-2"
@@ -23,7 +23,11 @@ REQUIRED_USE="${LUA_REQUIRED_USE}"
BDEPEND="virtual/pkgconfig"
DEPEND="${LUA_DEPS}"
-RDEPEND="${DEPEND}"
+RDEPEND="
+ ${DEPEND}
+ dev-lua/lua-resty-string[${LUA_SINGLE_USEDEP}]
+ $(lua_gen_cond_dep 'dev-lua/LuaBitOp[${LUA_USEDEP}]')
+"
src_configure() {
# The directory where to Lua files are to be installed, used by the build
diff --git a/dev-lua/lua-resty-lrucache/metadata.xml b/dev-lua/lua-resty-mysql/metadata.xml
similarity index 58%
copy from dev-lua/lua-resty-lrucache/metadata.xml
copy to dev-lua/lua-resty-mysql/metadata.xml
index 81d1558075b9..d53c791c23b0 100644
--- a/dev-lua/lua-resty-lrucache/metadata.xml
+++ b/dev-lua/lua-resty-mysql/metadata.xml
@@ -10,10 +10,13 @@
<name>Proxy Maintainers</name>
</maintainer>
<longdescription>
- This library implements a simple LRU cache for OpenResty and the ngx_lua module.
+ This Lua library is a MySQL client driver for the ngx-lua-module NGINX module.
+
+ lua-resty-mysql takes advantage of ngx-lua-module's cosocket API, which ensures 100%
+ nonblocking behavior.
</longdescription>
<upstream>
- <bugs-to>https://github.com/openresty/lua-resty-lrucache/issues</bugs-to>
- <remote-id type="github">openresty/lua-resty-lrucache</remote-id>
+ <bugs-to>https://github.com/openresty/lua-resty-mysql/issues</bugs-to>
+ <remote-id type="github">openresty/lua-resty-mysql</remote-id>
</upstream>
</pkgmetadata>
--
2.45.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-dev] [PATCH v3 33/40] dev-lua/lua-resty-memcached: new package, add 0.17
2025-02-21 16:07 [gentoo-dev] [PATCH v3 00/40] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass Zurab Kvachadze
` (31 preceding siblings ...)
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 32/40] dev-lua/lua-resty-mysql: new package, add 0.27 Zurab Kvachadze
@ 2025-02-21 16:08 ` Zurab Kvachadze
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 34/40] www-nginx/ngx-xss: new package, add 0.06 Zurab Kvachadze
` (7 subsequent siblings)
40 siblings, 0 replies; 42+ messages in thread
From: Zurab Kvachadze @ 2025-02-21 16:08 UTC (permalink / raw
To: gentoo-dev; +Cc: Zurab Kvachadze
lua-resty-memcached[1] is "Lua memcached client driver for the ngx_lua
based on the cosocket API".
[1]: https://github.com/openresty/lua-resty-memcached
Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
---
dev-lua/lua-resty-memcached/Manifest | 1 +
.../lua-resty-memcached-0.17.ebuild} | 6 +++---
.../usbmuxd => dev-lua/lua-resty-memcached}/metadata.xml | 3 ++-
3 files changed, 6 insertions(+), 4 deletions(-)
create mode 100644 dev-lua/lua-resty-memcached/Manifest
copy dev-lua/{lua-resty-lrucache/lua-resty-lrucache-0.15.ebuild => lua-resty-memcached/lua-resty-memcached-0.17.ebuild} (71%)
copy {app-pda/usbmuxd => dev-lua/lua-resty-memcached}/metadata.xml (74%)
diff --git a/dev-lua/lua-resty-memcached/Manifest b/dev-lua/lua-resty-memcached/Manifest
new file mode 100644
index 000000000000..1f9d3170a1fa
--- /dev/null
+++ b/dev-lua/lua-resty-memcached/Manifest
@@ -0,0 +1 @@
+DIST lua-resty-memcached-0.17.tar.gz 21216 BLAKE2B 3b65a06d50fce5cc33d570e558e412446c649173e5e495bf1b8d00f63114fe451e9fb4f3284cd314cdfe9561f87291b45b32750c2a290e8d0f05b6996fa765fd SHA512 efc7164e01816133b24a60524078565fa4c5f4f1e22608e59d49bb825c8df459ecd315c434c390be2641d3fd55cdfd960f607ced63675cdcd11dd254196b1a63
diff --git a/dev-lua/lua-resty-lrucache/lua-resty-lrucache-0.15.ebuild b/dev-lua/lua-resty-memcached/lua-resty-memcached-0.17.ebuild
similarity index 71%
copy from dev-lua/lua-resty-lrucache/lua-resty-lrucache-0.15.ebuild
copy to dev-lua/lua-resty-memcached/lua-resty-memcached-0.17.ebuild
index f85dbf3f9a66..e04b3fd3ce0a 100644
--- a/dev-lua/lua-resty-lrucache/lua-resty-lrucache-0.15.ebuild
+++ b/dev-lua/lua-resty-memcached/lua-resty-memcached-0.17.ebuild
@@ -7,10 +7,10 @@ EAPI=8
LUA_COMPAT=( luajit )
inherit lua-single
-DESCRIPTION="Lua-land LRU Cache based on LuaJIT FFI"
-HOMEPAGE="https://github.com/openresty/lua-resty-lrucache"
+DESCRIPTION="Lua memcached client driver based on cosocket API for ngx-lua-module"
+HOMEPAGE="https://github.com/openresty/lua-resty-memcached"
SRC_URI="
- https://github.com/openresty/lua-resty-lrucache/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
+ https://github.com/openresty/lua-resty-memcached/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
"
LICENSE="BSD-2"
diff --git a/app-pda/usbmuxd/metadata.xml b/dev-lua/lua-resty-memcached/metadata.xml
similarity index 74%
copy from app-pda/usbmuxd/metadata.xml
copy to dev-lua/lua-resty-memcached/metadata.xml
index d8e789b30263..0a435022302b 100644
--- a/app-pda/usbmuxd/metadata.xml
+++ b/dev-lua/lua-resty-memcached/metadata.xml
@@ -10,6 +10,7 @@
<name>Proxy Maintainers</name>
</maintainer>
<upstream>
- <remote-id type="github">libimobiledevice/usbmuxd</remote-id>
+ <bugs-to>https://github.com/openresty/lua-resty-memcached/issues</bugs-to>
+ <remote-id type="github">openresty/lua-resty-memcached</remote-id>
</upstream>
</pkgmetadata>
--
2.45.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-dev] [PATCH v3 34/40] www-nginx/ngx-xss: new package, add 0.06
2025-02-21 16:07 [gentoo-dev] [PATCH v3 00/40] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass Zurab Kvachadze
` (32 preceding siblings ...)
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 33/40] dev-lua/lua-resty-memcached: new package, add 0.17 Zurab Kvachadze
@ 2025-02-21 16:08 ` Zurab Kvachadze
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 35/40] www-nginx/ngx-eval: new package, add 0_p20240817 Zurab Kvachadze
` (6 subsequent siblings)
40 siblings, 0 replies; 42+ messages in thread
From: Zurab Kvachadze @ 2025-02-21 16:08 UTC (permalink / raw
To: gentoo-dev; +Cc: Zurab Kvachadze
ngx-xss[1] is an NGINX module that adds support for "native cross-site
scripting".
[1]: https://github.com/openresty/xss-nginx-module
Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
---
www-nginx/ngx-xss/Manifest | 1 +
...x-xss-0.06-add-dynamic-build-support.patch | 34 +++++++++++++++++++
.../{ngx-lua-module => ngx-xss}/metadata.xml | 10 +++---
www-nginx/ngx-xss/ngx-xss-0.06.ebuild | 24 +++++++++++++
4 files changed, 64 insertions(+), 5 deletions(-)
create mode 100644 www-nginx/ngx-xss/Manifest
create mode 100644 www-nginx/ngx-xss/files/ngx-xss-0.06-add-dynamic-build-support.patch
copy www-nginx/{ngx-lua-module => ngx-xss}/metadata.xml (57%)
create mode 100644 www-nginx/ngx-xss/ngx-xss-0.06.ebuild
diff --git a/www-nginx/ngx-xss/Manifest b/www-nginx/ngx-xss/Manifest
new file mode 100644
index 000000000000..ec20887f1122
--- /dev/null
+++ b/www-nginx/ngx-xss/Manifest
@@ -0,0 +1 @@
+DIST ngx-xss-0.06.tar.gz 12448 BLAKE2B 58cb1f23699e173c6fe3ac1c03ddef184238b1c3dc0471569e11b9a8f40b93250a9fa60c0bcc71222daf22769698835d1fe5515c0b55e385141c10451f347005 SHA512 b417ba5199d7147c348cd897f6294c49270f700d565b841086a5b1ecbfcea4005b6c01aac4e0e0e86cfafdc1d578107783dda718da2b9a1fd3b89676ec7b1ff4
diff --git a/www-nginx/ngx-xss/files/ngx-xss-0.06-add-dynamic-build-support.patch b/www-nginx/ngx-xss/files/ngx-xss-0.06-add-dynamic-build-support.patch
new file mode 100644
index 000000000000..5cfd8715e569
--- /dev/null
+++ b/www-nginx/ngx-xss/files/ngx-xss-0.06-add-dynamic-build-support.patch
@@ -0,0 +1,34 @@
+From a45c0c645841795d124acd43ea8a5c8297754a6f Mon Sep 17 00:00:00 2001
+From: Su Yang <soulteary@users.noreply.github.com>
+Date: Mon, 14 Jun 2021 11:47:03 +0800
+Subject: [PATCH 1/2] support dynamic build
+
+---
+ config | 15 +++++++++++++++
+ 1 file changed, 15 insertions(+)
+
+diff --git a/config b/config
+index 42ebe33..4ca7d3d 100644
+--- a/config
++++ b/config
+@@ -1,5 +1,20 @@
+ ngx_addon_name=ngx_http_xss_filter_module
++
+ HTTP_AUX_FILTER_MODULES="$HTTP_AUX_FILTER_MODULES ngx_http_xss_filter_module"
+ NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/src/ngx_http_xss_filter_module.c $ngx_addon_dir/src/ngx_http_xss_util.c"
+ NGX_ADDON_DEPS="$NGX_ADDON_DEPS $ngx_addon_dir/src/ddebug.h $ngx_addon_dir/src/ngx_http_xss_filter_module.h $ngx_addon_dir/src/ngx_http_xss_util.h"
+
++if test -n "$ngx_module_link"; then
++ ngx_module_type=HTTP_AUX_FILTER
++ ngx_module_name=$ngx_addon_name
++ ngx_module_incs=
++ ngx_module_deps="$NGX_ADDON_DEPS"
++ ngx_module_srcs="$NGX_ADDON_SRCS"
++ ngx_module_libs=
++
++ . auto/module
++else
++ HTTP_AUX_FILTER_MODULES="$HTTP_AUX_FILTER_MODULES $ngx_addon_name"
++ NGX_ADDON_SRCS="$NGX_ADDON_SRCS"
++ NGX_ADDON_DEPS="$NGX_ADDON_DEPS"
++fi
diff --git a/www-nginx/ngx-lua-module/metadata.xml b/www-nginx/ngx-xss/metadata.xml
similarity index 57%
copy from www-nginx/ngx-lua-module/metadata.xml
copy to www-nginx/ngx-xss/metadata.xml
index 42a518e970f5..005843751b17 100644
--- a/www-nginx/ngx-lua-module/metadata.xml
+++ b/www-nginx/ngx-xss/metadata.xml
@@ -10,12 +10,12 @@
<name>Proxy Maintainers</name>
</maintainer>
<longdescription>
- The ngx-lua module embeds LuaJIT 2.0/2.1 into NGINX. By leveraging NGINX's subrequests, this
- module allows the integration of the powerful Lua threads (known as Lua "coroutines") into
- the NGINX event model.
+ ngx-xss adds native cross-site scripting support to NGINX. This module adds cross-site AJAX
+ support to nginx. Currently only cross-site GET is supported. The cross-site GET is
+ implemented as JSONP (or "JSON with padding").
</longdescription>
<upstream>
- <bugs-to>https://github.com/openresty/lua-nginx-module/issues</bugs-to>
- <remote-id type="github">openresty/lua-nginx-module</remote-id>
+ <bugs-to>https://github.com/openresty/xss-nginx-module/issues</bugs-to>
+ <remote-id type="github">openresty/xss-nginx-module</remote-id>
</upstream>
</pkgmetadata>
diff --git a/www-nginx/ngx-xss/ngx-xss-0.06.ebuild b/www-nginx/ngx-xss/ngx-xss-0.06.ebuild
new file mode 100644
index 000000000000..b190db7280f6
--- /dev/null
+++ b/www-nginx/ngx-xss/ngx-xss-0.06.ebuild
@@ -0,0 +1,24 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+MY_PN="xss-nginx-module"
+NGINX_MOD_S="${WORKDIR}/${MY_PN}-${PV}"
+
+inherit nginx-module
+
+DESCRIPTION="Native support for cross-site scripting (XSS) in NGINX"
+HOMEPAGE="https://github.com/openresty/xss-nginx-module"
+SRC_URI="
+ https://github.com/openresty/xss-nginx-module/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
+"
+
+LICENSE="BSD-2"
+SLOT="0"
+
+RESTRICT="test"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-0.06-add-dynamic-build-support.patch"
+)
--
2.45.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-dev] [PATCH v3 35/40] www-nginx/ngx-eval: new package, add 0_p20240817
2025-02-21 16:07 [gentoo-dev] [PATCH v3 00/40] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass Zurab Kvachadze
` (33 preceding siblings ...)
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 34/40] www-nginx/ngx-xss: new package, add 0.06 Zurab Kvachadze
@ 2025-02-21 16:08 ` Zurab Kvachadze
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 36/40] www-nginx/ngx-iconv: new package, add 0.14 Zurab Kvachadze
` (5 subsequent siblings)
40 siblings, 0 replies; 42+ messages in thread
From: Zurab Kvachadze @ 2025-02-21 16:08 UTC (permalink / raw
To: gentoo-dev; +Cc: Zurab Kvachadze
ngx-eval[1] is an NGINX module that "[captures] subrequest response
bodies into NGINX variables".
[1]: https://github.com/openresty/nginx-eval-module/
Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
---
www-nginx/ngx-eval/Manifest | 1 +
.../ngx-eval}/metadata.xml | 3 ++-
.../ngx-eval/ngx-eval-0_p20240817.ebuild | 21 +++++++++++++++++++
3 files changed, 24 insertions(+), 1 deletion(-)
create mode 100644 www-nginx/ngx-eval/Manifest
copy {app-pda/usbmuxd => www-nginx/ngx-eval}/metadata.xml (74%)
create mode 100644 www-nginx/ngx-eval/ngx-eval-0_p20240817.ebuild
diff --git a/www-nginx/ngx-eval/Manifest b/www-nginx/ngx-eval/Manifest
new file mode 100644
index 000000000000..673ee8c38f56
--- /dev/null
+++ b/www-nginx/ngx-eval/Manifest
@@ -0,0 +1 @@
+DIST nginx-eval-module-13425e897c19f4f4436c5ca4414dddd37fc65190.tar.gz 14925 BLAKE2B d0e273980804538d1518fc02181e9332f19584086495874b3c5f5b244d4cd6524af90896df382d029143b856f184813e8de489f2b5edd4e2ba4b6eff14a4b9cb SHA512 0ecc9250067a55c043006766489e8d2364bed3771ca11eb157fe9ea35ad945957005c571c6499a098a9956580665cbb336aef3e8ee0892255ee2dbfab7e8d288
diff --git a/app-pda/usbmuxd/metadata.xml b/www-nginx/ngx-eval/metadata.xml
similarity index 74%
copy from app-pda/usbmuxd/metadata.xml
copy to www-nginx/ngx-eval/metadata.xml
index d8e789b30263..1e6a92214964 100644
--- a/app-pda/usbmuxd/metadata.xml
+++ b/www-nginx/ngx-eval/metadata.xml
@@ -10,6 +10,7 @@
<name>Proxy Maintainers</name>
</maintainer>
<upstream>
- <remote-id type="github">libimobiledevice/usbmuxd</remote-id>
+ <bugs-to>https://github.com/openresty/nginx-eval-module/issues</bugs-to>
+ <remote-id type="github">openresty/nginx-eval-module</remote-id>
</upstream>
</pkgmetadata>
diff --git a/www-nginx/ngx-eval/ngx-eval-0_p20240817.ebuild b/www-nginx/ngx-eval/ngx-eval-0_p20240817.ebuild
new file mode 100644
index 000000000000..7a0e3097b3d5
--- /dev/null
+++ b/www-nginx/ngx-eval/ngx-eval-0_p20240817.ebuild
@@ -0,0 +1,21 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+MY_COMMIT="13425e897c19f4f4436c5ca4414dddd37fc65190"
+MY_P="nginx-eval-module-${MY_COMMIT}"
+NGINX_MOD_S="${WORKDIR}/${MY_P}"
+
+inherit nginx-module
+
+DESCRIPTION="An NGINX module that stores subrequest response bodies into variables"
+HOMEPAGE="https://github.com/openresty/nginx-eval-module"
+SRC_URI="
+ https://github.com/openresty/nginx-eval-module/archive/${MY_COMMIT}.tar.gz -> ${MY_P}.tar.gz
+"
+
+LICENSE="BSD-2"
+SLOT="0"
+
+RESTRICT="test"
--
2.45.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-dev] [PATCH v3 36/40] www-nginx/ngx-iconv: new package, add 0.14
2025-02-21 16:07 [gentoo-dev] [PATCH v3 00/40] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass Zurab Kvachadze
` (34 preceding siblings ...)
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 35/40] www-nginx/ngx-eval: new package, add 0_p20240817 Zurab Kvachadze
@ 2025-02-21 16:08 ` Zurab Kvachadze
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 37/40] www-nginx/ngx-srcache: new package, add 0.33 Zurab Kvachadze
` (4 subsequent siblings)
40 siblings, 0 replies; 42+ messages in thread
From: Zurab Kvachadze @ 2025-02-21 16:08 UTC (permalink / raw
To: gentoo-dev; +Cc: Zurab Kvachadze
ngx-iconv[1] is a "a character conversion NGINX module using libiconv".
[1]: https://github.com/calio/iconv-nginx-module
Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
---
www-nginx/ngx-iconv/Manifest | 1 +
.../ngx-iconv}/metadata.xml | 7 +++---
www-nginx/ngx-iconv/ngx-iconv-0.14.ebuild | 25 +++++++++++++++++++
3 files changed, 30 insertions(+), 3 deletions(-)
create mode 100644 www-nginx/ngx-iconv/Manifest
copy {dev-lua/lua-resty-lrucache => www-nginx/ngx-iconv}/metadata.xml (62%)
create mode 100644 www-nginx/ngx-iconv/ngx-iconv-0.14.ebuild
diff --git a/www-nginx/ngx-iconv/Manifest b/www-nginx/ngx-iconv/Manifest
new file mode 100644
index 000000000000..3b1d8b58b21e
--- /dev/null
+++ b/www-nginx/ngx-iconv/Manifest
@@ -0,0 +1 @@
+DIST ngx-iconv-0.14.tar.gz 13133 BLAKE2B e0120a667bc0ee76efee1310b72fa4cbbe0e21fece502dab46b19a87f285f718257464d0c6df8df27fc5b8d4a2acc2e9c88474dfea2fd040220be9affc4b2546 SHA512 63e5e4f1d667438f13aa93f56ec05f0af86147e996ae450f13664668f9813319cc895f0b5e72e05cb2d93722fdb17541972a4d492be8ad226bfc87e4672e29d9
diff --git a/dev-lua/lua-resty-lrucache/metadata.xml b/www-nginx/ngx-iconv/metadata.xml
similarity index 62%
copy from dev-lua/lua-resty-lrucache/metadata.xml
copy to www-nginx/ngx-iconv/metadata.xml
index 81d1558075b9..0d1c3551bf30 100644
--- a/dev-lua/lua-resty-lrucache/metadata.xml
+++ b/www-nginx/ngx-iconv/metadata.xml
@@ -10,10 +10,11 @@
<name>Proxy Maintainers</name>
</maintainer>
<longdescription>
- This library implements a simple LRU cache for OpenResty and the ngx_lua module.
+ The ngx-iconv NGINX module allows converting characters of different encoding by using
+ libiconv. It brings the 'set_iconv' command to NGINX.
</longdescription>
<upstream>
- <bugs-to>https://github.com/openresty/lua-resty-lrucache/issues</bugs-to>
- <remote-id type="github">openresty/lua-resty-lrucache</remote-id>
+ <bugs-to>https://github.com/calio/iconv-nginx-module/issues</bugs-to>
+ <remote-id type="github">calio/iconv-nginx-module</remote-id>
</upstream>
</pkgmetadata>
diff --git a/www-nginx/ngx-iconv/ngx-iconv-0.14.ebuild b/www-nginx/ngx-iconv/ngx-iconv-0.14.ebuild
new file mode 100644
index 000000000000..1d6a393bfeaf
--- /dev/null
+++ b/www-nginx/ngx-iconv/ngx-iconv-0.14.ebuild
@@ -0,0 +1,25 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+MY_PN="iconv-nginx-module"
+NGINX_MOD_S="${WORKDIR}/${MY_PN}-${PV}"
+
+NGINX_MOD_LINK_MODULES=( www-nginx/ngx_devel_kit )
+
+inherit nginx-module
+
+DESCRIPTION="A character conversion NGINX module using libiconv"
+HOMEPAGE="https://github.com/calio/iconv-nginx-module"
+SRC_URI="
+ https://github.com/calio/iconv-nginx-module/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
+"
+
+LICENSE="BSD-2"
+SLOT="0"
+
+RESTRICT="test"
+
+DEPEND="virtual/libiconv"
+RDEPEND="${DEPEND}"
--
2.45.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-dev] [PATCH v3 37/40] www-nginx/ngx-srcache: new package, add 0.33
2025-02-21 16:07 [gentoo-dev] [PATCH v3 00/40] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass Zurab Kvachadze
` (35 preceding siblings ...)
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 36/40] www-nginx/ngx-iconv: new package, add 0.14 Zurab Kvachadze
@ 2025-02-21 16:08 ` Zurab Kvachadze
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 38/40] www-nginx/ngx-lua-upstream: new package, add 0.07 Zurab Kvachadze
` (3 subsequent siblings)
40 siblings, 0 replies; 42+ messages in thread
From: Zurab Kvachadze @ 2025-02-21 16:08 UTC (permalink / raw
To: gentoo-dev; +Cc: Zurab Kvachadze
ngx-srcache[1] provides "transparent caching layer for arbitrary NGINX
locations".
[1]: https://github.com/openresty/srcache-nginx-module
Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
---
www-nginx/ngx-srcache/Manifest | 1 +
www-nginx/ngx-srcache/metadata.xml | 25 +++++++++++++++++++
www-nginx/ngx-srcache/ngx-srcache-0.33.ebuild | 20 +++++++++++++++
3 files changed, 46 insertions(+)
create mode 100644 www-nginx/ngx-srcache/Manifest
create mode 100644 www-nginx/ngx-srcache/metadata.xml
create mode 100644 www-nginx/ngx-srcache/ngx-srcache-0.33.ebuild
diff --git a/www-nginx/ngx-srcache/Manifest b/www-nginx/ngx-srcache/Manifest
new file mode 100644
index 000000000000..8b319366a602
--- /dev/null
+++ b/www-nginx/ngx-srcache/Manifest
@@ -0,0 +1 @@
+DIST ngx-srcache-0.33.tar.gz 51025 BLAKE2B e45591e8901514ce14597c41f464f27007e566010f19ffe3e5310eaafb8a3c2b6b01755936ca6abe3fe2e8e87125cdcc656d3d980d5523a4fba02f441fa75242 SHA512 d96003e636b1a18bc1ad2f5005edcc96f3e386471f8a8242c0d882013a3bd1463eaf435203e25c4d8cddd99b5bf028664c4672958133b51d5b6c833fa9a2da4c
diff --git a/www-nginx/ngx-srcache/metadata.xml b/www-nginx/ngx-srcache/metadata.xml
new file mode 100644
index 000000000000..f8f10b14dab9
--- /dev/null
+++ b/www-nginx/ngx-srcache/metadata.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person" proxied="yes">
+ <email>zurabid2016@gmail.com</email>
+ <name>Zurab Kvachadze</name>
+ </maintainer>
+ <maintainer type="project" proxied="proxy">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <longdescription>
+ The ngx-srcache NGINX module provides a transparent caching layer for arbitrary NGINX
+ locations (like those use an upstream or even serve static disk files). The caching behavior
+ is mostly compatible with RFC 2616.
+
+ Usually, ngx-memc is used together with this module to provide a concrete caching
+ storage backend. But technically, any modules that provide a REST interface can be used as
+ the fetching and storage subrequests used by this module.
+ </longdescription>
+ <upstream>
+ <bugs-to>https://github.com/openresty/srcache-nginx-module/issues</bugs-to>
+ <remote-id type="github">openresty/srcache-nginx-module</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/www-nginx/ngx-srcache/ngx-srcache-0.33.ebuild b/www-nginx/ngx-srcache/ngx-srcache-0.33.ebuild
new file mode 100644
index 000000000000..cabc43d06fb8
--- /dev/null
+++ b/www-nginx/ngx-srcache/ngx-srcache-0.33.ebuild
@@ -0,0 +1,20 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+MY_PN="srcache-nginx-module"
+NGINX_MOD_S="${WORKDIR}/${MY_PN}-${PV}"
+
+inherit nginx-module
+
+DESCRIPTION="An NGINX module enabling transparent subrequest-based caching"
+HOMEPAGE="https://github.com/openresty/srcache-nginx-module"
+SRC_URI="
+ https://github.com/openresty/srcache-nginx-module/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
+"
+
+LICENSE="BSD-2"
+SLOT="0"
+
+RESTRICT="test"
--
2.45.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-dev] [PATCH v3 38/40] www-nginx/ngx-lua-upstream: new package, add 0.07
2025-02-21 16:07 [gentoo-dev] [PATCH v3 00/40] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass Zurab Kvachadze
` (36 preceding siblings ...)
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 37/40] www-nginx/ngx-srcache: new package, add 0.33 Zurab Kvachadze
@ 2025-02-21 16:08 ` Zurab Kvachadze
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 39/40] www-nginx/ngx-memc: new package, add 0.20 Zurab Kvachadze
` (2 subsequent siblings)
40 siblings, 0 replies; 42+ messages in thread
From: Zurab Kvachadze @ 2025-02-21 16:08 UTC (permalink / raw
To: gentoo-dev; +Cc: Zurab Kvachadze
ngx-lua-upstream[1] is a "NGINX C module to expose Lua API to ngx_lua
for NGINX upstreams".
[1]: https://github.com/openresty/lua-upstream-nginx-module
Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
---
www-nginx/ngx-lua-upstream/Manifest | 1 +
.../ngx-lua-upstream}/metadata.xml | 3 +-
.../ngx-lua-upstream-0.07.ebuild | 38 +++++++++++++++++++
3 files changed, 41 insertions(+), 1 deletion(-)
create mode 100644 www-nginx/ngx-lua-upstream/Manifest
copy {app-pda/usbmuxd => www-nginx/ngx-lua-upstream}/metadata.xml (72%)
create mode 100644 www-nginx/ngx-lua-upstream/ngx-lua-upstream-0.07.ebuild
diff --git a/www-nginx/ngx-lua-upstream/Manifest b/www-nginx/ngx-lua-upstream/Manifest
new file mode 100644
index 000000000000..55a14a93f4bc
--- /dev/null
+++ b/www-nginx/ngx-lua-upstream/Manifest
@@ -0,0 +1 @@
+DIST ngx-lua-upstream-0.07.tar.gz 12763 BLAKE2B 45867c528cca9f2c4d057167609863e9b772403a6fabac4e270b541006dbb49d169a2841c02b8a075a591a0efd3ea2227f6fdf5810c5819ee7bcf455a0444432 SHA512 72887c4490854b099cb26bb3f840073a36b0d812bde4486f04dc1be182ca74f0d1e3fd709e77c240c2dcf37665f74cf04e188ea9efe8e127c6789b27b487d0cd
diff --git a/app-pda/usbmuxd/metadata.xml b/www-nginx/ngx-lua-upstream/metadata.xml
similarity index 72%
copy from app-pda/usbmuxd/metadata.xml
copy to www-nginx/ngx-lua-upstream/metadata.xml
index d8e789b30263..4cf7d31adb2d 100644
--- a/app-pda/usbmuxd/metadata.xml
+++ b/www-nginx/ngx-lua-upstream/metadata.xml
@@ -10,6 +10,7 @@
<name>Proxy Maintainers</name>
</maintainer>
<upstream>
- <remote-id type="github">libimobiledevice/usbmuxd</remote-id>
+ <bugs-to>https://github.com/openresty/lua-upstream-nginx-module/issues</bugs-to>
+ <remote-id type="github">openresty/lua-upstream-nginx-module</remote-id>
</upstream>
</pkgmetadata>
diff --git a/www-nginx/ngx-lua-upstream/ngx-lua-upstream-0.07.ebuild b/www-nginx/ngx-lua-upstream/ngx-lua-upstream-0.07.ebuild
new file mode 100644
index 000000000000..5fd8aa16dac1
--- /dev/null
+++ b/www-nginx/ngx-lua-upstream/ngx-lua-upstream-0.07.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# Upstream supports luajit only.
+LUA_COMPAT=( luajit )
+
+MY_PN="lua-upstream-nginx-module"
+NGINX_MOD_S="${WORKDIR}/${MY_PN}-${PV}"
+
+NGINX_MOD_LINK_MODULES=( www-nginx/ngx-lua-module )
+
+inherit flag-o-matic lua-single nginx-module
+
+DESCRIPTION="An NGINX C module exposing ngx-lua-module's Lua APIs for NGINX upstreams"
+HOMEPAGE="https://github.com/openresty/lua-upstream-nginx-module"
+SRC_URI="
+ https://github.com/openresty/lua-upstream-nginx-module/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
+"
+
+LICENSE="BSD-2"
+SLOT="0"
+
+REQUIRED_USE="${LUA_REQUIRED_USE}"
+
+RESTRICT="test"
+
+BDEPEND="virtual/pkgconfig"
+DEPEND="${LUA_DEPS}"
+RDEPEND="${DEPEND}"
+
+src_configure() {
+ ngx_mod_append_libs "$(lua_get_LIBS)"
+ append-cflags "$(lua_get_CFLAGS)"
+
+ nginx-module_src_configure
+}
--
2.45.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-dev] [PATCH v3 39/40] www-nginx/ngx-memc: new package, add 0.20
2025-02-21 16:07 [gentoo-dev] [PATCH v3 00/40] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass Zurab Kvachadze
` (37 preceding siblings ...)
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 38/40] www-nginx/ngx-lua-upstream: new package, add 0.07 Zurab Kvachadze
@ 2025-02-21 16:08 ` Zurab Kvachadze
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 40/40] www-nginx: enable tests Zurab Kvachadze
2025-02-22 3:55 ` [gentoo-dev] [PATCH v3 00/40] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass Zhixu Liu
40 siblings, 0 replies; 42+ messages in thread
From: Zurab Kvachadze @ 2025-02-21 16:08 UTC (permalink / raw
To: gentoo-dev; +Cc: Zurab Kvachadze
ngx-memc[1] is an "extended version of the standard memcached module
that supports set, add, delete, and many more memcached commands".
[1]: https://github.com/openresty/memc-nginx-module/
Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
---
www-nginx/ngx-memc/Manifest | 1 +
www-nginx/ngx-memc/metadata.xml | 27 +++++++++++++++++++
.../ngx-memc-0.20.ebuild} | 9 ++++---
3 files changed, 33 insertions(+), 4 deletions(-)
create mode 100644 www-nginx/ngx-memc/Manifest
create mode 100644 www-nginx/ngx-memc/metadata.xml
copy www-nginx/{ngx-echo/ngx-echo-0.63.ebuild => ngx-memc/ngx-memc-0.20.ebuild} (51%)
diff --git a/www-nginx/ngx-memc/Manifest b/www-nginx/ngx-memc/Manifest
new file mode 100644
index 000000000000..2bd0d89133f4
--- /dev/null
+++ b/www-nginx/ngx-memc/Manifest
@@ -0,0 +1 @@
+DIST ngx-memc-0.20.tar.gz 34736 BLAKE2B 443192785568f680e0b20cc24598fa737dc207011a42748ba7808a429e7f752bc1ac302fbf816d6c388fe30daf77b4e050779261fde30c96cab80b5553788817 SHA512 62ffdddf246aae0a4353c369166108ff559db95bad7252684d772d2b52510311209fe963d009b846ecba188be95b877ec509705a52e6d2153a81571c063670e4
diff --git a/www-nginx/ngx-memc/metadata.xml b/www-nginx/ngx-memc/metadata.xml
new file mode 100644
index 000000000000..d4e644ae4b5e
--- /dev/null
+++ b/www-nginx/ngx-memc/metadata.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person" proxied="yes">
+ <email>zurabid2016@gmail.com</email>
+ <name>Zurab Kvachadze</name>
+ </maintainer>
+ <maintainer type="project" proxied="proxy">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <longdescription>
+ ngx-memc is an extended version of the standard NGINX memcached module that supports set,
+ add, delete, and many more memcached commands.
+
+ This module extends the standard memcached module to support almost the whole memcached
+ ASCII protocol.
+
+ The module allows to define a custom REST interface to a memcached servers or to access
+ memcached in a very efficient way from within the NGINX server by means of subrequests or
+ independent fake requests.
+ </longdescription>
+ <upstream>
+ <bugs-to>https://github.com/openresty/memc-nginx-module/issues</bugs-to>
+ <remote-id type="github">openresty/memc-nginx-module</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/www-nginx/ngx-echo/ngx-echo-0.63.ebuild b/www-nginx/ngx-memc/ngx-memc-0.20.ebuild
similarity index 51%
copy from www-nginx/ngx-echo/ngx-echo-0.63.ebuild
copy to www-nginx/ngx-memc/ngx-memc-0.20.ebuild
index 92c51003ab4d..ab186f0f0df4 100644
--- a/www-nginx/ngx-echo/ngx-echo-0.63.ebuild
+++ b/www-nginx/ngx-memc/ngx-memc-0.20.ebuild
@@ -3,14 +3,15 @@
EAPI=8
-MY_PN="echo-nginx-module"
+MY_PN="memc-nginx-module"
NGINX_MOD_S="${WORKDIR}/${MY_PN}-${PV}"
+
inherit nginx-module
-DESCRIPTION='An NGINX module bringing the power of "echo", "sleep", "time" and more to NGINX'
-HOMEPAGE="https://github.com/openresty/echo-nginx-module"
+DESCRIPTION="An extended version of the standard NGINX memcached module"
+HOMEPAGE="https://github.com/openresty/memc-nginx-module"
SRC_URI="
- https://github.com/openresty/echo-nginx-module/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
+ https://github.com/openresty/memc-nginx-module/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
"
LICENSE="BSD-2"
--
2.45.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-dev] [PATCH v3 40/40] www-nginx: enable tests
2025-02-21 16:07 [gentoo-dev] [PATCH v3 00/40] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass Zurab Kvachadze
` (38 preceding siblings ...)
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 39/40] www-nginx/ngx-memc: new package, add 0.20 Zurab Kvachadze
@ 2025-02-21 16:08 ` Zurab Kvachadze
2025-02-22 3:55 ` [gentoo-dev] [PATCH v3 00/40] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass Zhixu Liu
40 siblings, 0 replies; 42+ messages in thread
From: Zurab Kvachadze @ 2025-02-21 16:08 UTC (permalink / raw
To: gentoo-dev; +Cc: Zurab Kvachadze
This commits enables tests for all the www-nginx packages.
Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
---
www-nginx/ngx-echo/ngx-echo-0.63.ebuild | 9 +-
.../ngx-encrypted-session-0.09.ebuild | 8 +-
.../ngx-eval/ngx-eval-0_p20240817.ebuild | 24 ++-
| 12 +-
.../ngx-iconv-0.14-skip-rds-json-tests.patch | 30 ++++
www-nginx/ngx-iconv/ngx-iconv-0.14.ebuild | 15 +-
...lua-upstream-0.07-skip-invalid-tests.patch | 26 ++++
.../ngx-lua-upstream-0.07.ebuild | 11 +-
...0.20-stats_t-do-not-run-timeout-test.patch | 31 ++++
www-nginx/ngx-memc/ngx-memc-0.20.ebuild | 30 +++-
...isc-0.33-skip-hashed-upstream_t-test.patch | 31 ++++
.../ngx-set-misc/ngx-set-misc-0.33.ebuild | 8 +-
...x-srcache-0.33-disable-invalid-tests.patch | 147 ++++++++++++++++++
www-nginx/ngx-srcache/ngx-srcache-0.33.ebuild | 35 ++++-
www-nginx/ngx-xss/ngx-xss-0.06.ebuild | 8 +-
15 files changed, 410 insertions(+), 15 deletions(-)
create mode 100644 www-nginx/ngx-iconv/files/ngx-iconv-0.14-skip-rds-json-tests.patch
create mode 100644 www-nginx/ngx-lua-upstream/files/ngx-lua-upstream-0.07-skip-invalid-tests.patch
create mode 100644 www-nginx/ngx-memc/files/ngx-memc-0.20-stats_t-do-not-run-timeout-test.patch
create mode 100644 www-nginx/ngx-set-misc/files/ngx-set-misc-0.33-skip-hashed-upstream_t-test.patch
create mode 100644 www-nginx/ngx-srcache/files/ngx-srcache-0.33-disable-invalid-tests.patch
diff --git a/www-nginx/ngx-echo/ngx-echo-0.63.ebuild b/www-nginx/ngx-echo/ngx-echo-0.63.ebuild
index 92c51003ab4d..a70da8450b25 100644
--- a/www-nginx/ngx-echo/ngx-echo-0.63.ebuild
+++ b/www-nginx/ngx-echo/ngx-echo-0.63.ebuild
@@ -5,6 +5,12 @@ EAPI=8
MY_PN="echo-nginx-module"
NGINX_MOD_S="${WORKDIR}/${MY_PN}-${PV}"
+
+NGINX_MOD_OPENRESTY_TESTS=1
+NGINX_MOD_TEST_LOAD_ORDER=(
+ www-nginx/ngx-lua-module
+ www-nginx/ngx-xss
+)
inherit nginx-module
DESCRIPTION='An NGINX module bringing the power of "echo", "sleep", "time" and more to NGINX'
@@ -16,4 +22,5 @@ SRC_URI="
LICENSE="BSD-2"
SLOT="0"
-RESTRICT="test"
+# Tests require NGINX to be built with debugging log enabled.
+BDEPEND="test? ( www-servers/nginx[debug(-)] )"
diff --git a/www-nginx/ngx-encrypted-session/ngx-encrypted-session-0.09.ebuild b/www-nginx/ngx-encrypted-session/ngx-encrypted-session-0.09.ebuild
index 04d5614696b4..5538ded752bb 100644
--- a/www-nginx/ngx-encrypted-session/ngx-encrypted-session-0.09.ebuild
+++ b/www-nginx/ngx-encrypted-session/ngx-encrypted-session-0.09.ebuild
@@ -8,6 +8,12 @@ NGINX_MOD_S="${WORKDIR}/${MY_PN}-${PV}"
NGINX_MOD_LINK_MODULES=( www-nginx/ngx_devel_kit )
+NGINX_MOD_OPENRESTY_TESTS=1
+NGINX_MOD_TEST_LOAD_ORDER=(
+ www-nginx/ngx-set-misc
+ www-nginx/ngx-echo
+ www-nginx/ngx-lua-module
+)
inherit toolchain-funcs nginx-module
DESCRIPTION="An NGINX module that encrypts and decrypts NGINX variable values"
@@ -19,8 +25,6 @@ SRC_URI="
LICENSE="BSD-2"
SLOT="0"
-RESTRICT="test"
-
BDEPEND="virtual/pkgconfig"
DEPEND="dev-libs/openssl:="
RDEPEND="${DEPEND}"
diff --git a/www-nginx/ngx-eval/ngx-eval-0_p20240817.ebuild b/www-nginx/ngx-eval/ngx-eval-0_p20240817.ebuild
index 7a0e3097b3d5..fcfbec277d7b 100644
--- a/www-nginx/ngx-eval/ngx-eval-0_p20240817.ebuild
+++ b/www-nginx/ngx-eval/ngx-eval-0_p20240817.ebuild
@@ -7,6 +7,11 @@ MY_COMMIT="13425e897c19f4f4436c5ca4414dddd37fc65190"
MY_P="nginx-eval-module-${MY_COMMIT}"
NGINX_MOD_S="${WORKDIR}/${MY_P}"
+NGINX_MOD_OPENRESTY_TESTS=1
+NGINX_MOD_TEST_LOAD_ORDER=(
+ www-nginx/ngx-memc
+ www-nginx/ngx-echo
+)
inherit nginx-module
DESCRIPTION="An NGINX module that stores subrequest response bodies into variables"
@@ -18,4 +23,21 @@ SRC_URI="
LICENSE="BSD-2"
SLOT="0"
-RESTRICT="test"
+BDEPEND="test? ( net-misc/memcached )"
+
+src_test() {
+ # Start memcached in background on a port 11211, the default port if
+ # environment variable TEST_NGINX_MEMCACHED_PORT is not set.
+ # memcached is enclosed in braces so that the not operator properly applies
+ # to the asynchronous invocation of memcached.
+ if ! { memcached -p 11211 & }
+ then
+ die "memcached failed"
+ fi
+ # Save the PID of the launched memcached instance.
+ local memcached_pid=$!
+
+ nginx-module_src_test
+
+ kill "${memcached_pid}" || die "kill failed"
+}
--git a/www-nginx/ngx-headers-more/ngx-headers-more-0.37.ebuild b/www-nginx/ngx-headers-more/ngx-headers-more-0.37.ebuild
index 606446a9641e..7084022222fe 100644
--- a/www-nginx/ngx-headers-more/ngx-headers-more-0.37.ebuild
+++ b/www-nginx/ngx-headers-more/ngx-headers-more-0.37.ebuild
@@ -5,6 +5,15 @@ EAPI=8
MY_PN="headers-more-nginx-module"
NGINX_MOD_S="${WORKDIR}/${MY_PN}-${PV}"
+
+NGINX_MOD_OPENRESTY_TESTS=1
+# ngx-headers-more must be loaded after ngx-lua-module module for test to work.
+NGINX_MOD_TEST_LOAD_ORDER=(
+ www-nginx/ngx-lua-module
+ www-nginx/ngx-headers-more
+ www-nginx/ngx-eval
+ www-nginx/ngx-echo
+)
inherit nginx-module
DESCRIPTION="Set, add, and clear arbitrary output headers in NGINX HTTP servers"
@@ -16,4 +25,5 @@ SRC_URI="
LICENSE="BSD-2"
SLOT="0"
-RESTRICT="test"
+# Tests require NGINX to be built with debugging log enabled.
+BDEPEND="test? ( www-servers/nginx[debug(-)] )"
diff --git a/www-nginx/ngx-iconv/files/ngx-iconv-0.14-skip-rds-json-tests.patch b/www-nginx/ngx-iconv/files/ngx-iconv-0.14-skip-rds-json-tests.patch
new file mode 100644
index 000000000000..6194ed8608e1
--- /dev/null
+++ b/www-nginx/ngx-iconv/files/ngx-iconv-0.14-skip-rds-json-tests.patch
@@ -0,0 +1,30 @@
+From f9adf29df987a0c2d067e43fc4a6b43aabb42f26 Mon Sep 17 00:00:00 2001
+From: Zurab Kvachadze <zurabid2016@gmail.com>
+Date: Thu, 13 Feb 2025 19:52:15 +0100
+Subject: [PATCH] bugs.t: skip test relying on rds_json
+
+libdrizzle, a dependency of rds-json-nginx-module, is not packaged by
+Gentoo.
+
+This commit skips the test relying on rds-json-nginx-module.
+
+Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
+---
+ t/bugs.t | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/t/bugs.t b/t/bugs.t
+index 8d05e43..82f846e 100644
+--- a/t/bugs.t
++++ b/t/bugs.t
+@@ -16,6 +16,7 @@ run_tests();
+ __DATA__
+
+ === TEST 1: used with rds_json
++--- SKIP
+ --- config
+ location /foo {
+ rds_json_ret 100 '你好';
+--
+2.45.3
+
diff --git a/www-nginx/ngx-iconv/ngx-iconv-0.14.ebuild b/www-nginx/ngx-iconv/ngx-iconv-0.14.ebuild
index 1d6a393bfeaf..fb53ca545aff 100644
--- a/www-nginx/ngx-iconv/ngx-iconv-0.14.ebuild
+++ b/www-nginx/ngx-iconv/ngx-iconv-0.14.ebuild
@@ -8,6 +8,15 @@ NGINX_MOD_S="${WORKDIR}/${MY_PN}-${PV}"
NGINX_MOD_LINK_MODULES=( www-nginx/ngx_devel_kit )
+NGINX_MOD_OPENRESTY_TESTS=1
+# ngx-iconv must be loaded after ngx-lua-module.
+NGINX_MOD_TEST_LOAD_ORDER=(
+ www-nginx/ngx-lua-module
+ www-nginx/ngx-iconv
+ www-nginx/ngx-echo
+ www-nginx/ngx-set-misc
+ www-nginx/ngx-headers-more
+)
inherit nginx-module
DESCRIPTION="A character conversion NGINX module using libiconv"
@@ -19,7 +28,9 @@ SRC_URI="
LICENSE="BSD-2"
SLOT="0"
-RESTRICT="test"
-
DEPEND="virtual/libiconv"
RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-0.14-skip-rds-json-tests.patch"
+)
diff --git a/www-nginx/ngx-lua-upstream/files/ngx-lua-upstream-0.07-skip-invalid-tests.patch b/www-nginx/ngx-lua-upstream/files/ngx-lua-upstream-0.07-skip-invalid-tests.patch
new file mode 100644
index 000000000000..cba15cfbc7a9
--- /dev/null
+++ b/www-nginx/ngx-lua-upstream/files/ngx-lua-upstream-0.07-skip-invalid-tests.patch
@@ -0,0 +1,26 @@
+From 9d8b6160d92a2899e28d4a610a884d160e4a1f38 Mon Sep 17 00:00:00 2001
+From: Zurab Kvachadze <zurabid2016@gmail.com>
+Date: Sat, 15 Feb 2025 17:58:35 +0100
+Subject: [PATCH] Skip invalid tests
+
+Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
+---
+ t/sanity.t | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/t/sanity.t b/t/sanity.t
+index b913f21..f2b22b2 100644
+--- a/t/sanity.t
++++ b/t/sanity.t
+@@ -1,6 +1,7 @@
+ # vim:set ft= ts=4 sw=4 et fdm=marker:
+
+-use Test::Nginx::Socket::Lua;
++use Test::Nginx::Socket::Lua skip_all =>
++ 'uses arbitrary hostname with no corresponding server directive';
+
+ #worker_connections(1014);
+ #master_on();
+--
+2.45.3
+
diff --git a/www-nginx/ngx-lua-upstream/ngx-lua-upstream-0.07.ebuild b/www-nginx/ngx-lua-upstream/ngx-lua-upstream-0.07.ebuild
index 5fd8aa16dac1..fb98e9684e78 100644
--- a/www-nginx/ngx-lua-upstream/ngx-lua-upstream-0.07.ebuild
+++ b/www-nginx/ngx-lua-upstream/ngx-lua-upstream-0.07.ebuild
@@ -11,6 +11,11 @@ NGINX_MOD_S="${WORKDIR}/${MY_PN}-${PV}"
NGINX_MOD_LINK_MODULES=( www-nginx/ngx-lua-module )
+NGINX_MOD_OPENRESTY_TESTS=1
+NGINX_MOD_TEST_LOAD_ORDER=(
+ www-nginx/ngx-lua-module
+ www-nginx/ngx-echo
+)
inherit flag-o-matic lua-single nginx-module
DESCRIPTION="An NGINX C module exposing ngx-lua-module's Lua APIs for NGINX upstreams"
@@ -24,12 +29,14 @@ SLOT="0"
REQUIRED_USE="${LUA_REQUIRED_USE}"
-RESTRICT="test"
-
BDEPEND="virtual/pkgconfig"
DEPEND="${LUA_DEPS}"
RDEPEND="${DEPEND}"
+PATCHES=(
+ "${FILESDIR}/${PN}-0.07-skip-invalid-tests.patch"
+)
+
src_configure() {
ngx_mod_append_libs "$(lua_get_LIBS)"
append-cflags "$(lua_get_CFLAGS)"
diff --git a/www-nginx/ngx-memc/files/ngx-memc-0.20-stats_t-do-not-run-timeout-test.patch b/www-nginx/ngx-memc/files/ngx-memc-0.20-stats_t-do-not-run-timeout-test.patch
new file mode 100644
index 000000000000..2c783e9b0c6d
--- /dev/null
+++ b/www-nginx/ngx-memc/files/ngx-memc-0.20-stats_t-do-not-run-timeout-test.patch
@@ -0,0 +1,31 @@
+From 8ff96cb366e1ed0a78533501b33ca29c378ca808 Mon Sep 17 00:00:00 2001
+From: Zurab Kvachadze <zurabid2016@gmail.com>
+Date: Tue, 11 Feb 2025 15:35:40 +0100
+Subject: [PATCH] t/stats.t: skip broken test
+
+The CI utilises iptables to drop connections on hardcoded port 12345.
+The drop behaviour is required by the "timeout" test. Since tests are
+run unprivileged in Gentoo, iptables can not be used and the test fails.
+
+This commit skips the "timeout" test.
+
+Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
+---
+ t/stats.t | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/t/stats.t b/t/stats.t
+index f412b42..39bc3dd 100644
+--- a/t/stats.t
++++ b/t/stats.t
+@@ -30,6 +30,7 @@ __DATA__
+
+
+ === TEST 2: timeout
++--- SKIP
+ --- config
+ memc_connect_timeout 10ms;
+ memc_send_timeout 10ms;
+--
+2.45.3
+
diff --git a/www-nginx/ngx-memc/ngx-memc-0.20.ebuild b/www-nginx/ngx-memc/ngx-memc-0.20.ebuild
index ab186f0f0df4..2c61469c427c 100644
--- a/www-nginx/ngx-memc/ngx-memc-0.20.ebuild
+++ b/www-nginx/ngx-memc/ngx-memc-0.20.ebuild
@@ -6,6 +6,13 @@ EAPI=8
MY_PN="memc-nginx-module"
NGINX_MOD_S="${WORKDIR}/${MY_PN}-${PV}"
+NGINX_MOD_OPENRESTY_TESTS=1
+NGINX_MOD_TEST_LOAD_ORDER=(
+ www-nginx/ngx-lua-module
+ www-nginx/ngx-eval
+ www-nginx/ngx-echo
+ www-nginx/ngx-set-misc
+)
inherit nginx-module
DESCRIPTION="An extended version of the standard NGINX memcached module"
@@ -17,4 +24,25 @@ SRC_URI="
LICENSE="BSD-2"
SLOT="0"
-RESTRICT="test"
+BDEPEND="test? ( net-misc/memcached )"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-0.20-stats_t-do-not-run-timeout-test.patch"
+)
+
+src_test() {
+ # Start memcached in background on a port 11211, the default port if
+ # environment variable TEST_NGINX_MEMCACHED_PORT is not set.
+ # memcached is enclosed in braces so that the not operator properly applies
+ # to the asynchronous invocation of memcached.
+ if ! { memcached -p 11211 & }
+ then
+ die "memcached failed"
+ fi
+ # Save the PID of the launched memcached instance.
+ local memcached_pid=$!
+
+ nginx-module_src_test
+
+ kill "${memcached_pid}" || die "killing memcached failed"
+}
diff --git a/www-nginx/ngx-set-misc/files/ngx-set-misc-0.33-skip-hashed-upstream_t-test.patch b/www-nginx/ngx-set-misc/files/ngx-set-misc-0.33-skip-hashed-upstream_t-test.patch
new file mode 100644
index 000000000000..812ddbb20f5d
--- /dev/null
+++ b/www-nginx/ngx-set-misc/files/ngx-set-misc-0.33-skip-hashed-upstream_t-test.patch
@@ -0,0 +1,31 @@
+From 25337a9db440d2afb406a78b113e9a8ea0f3fcde Mon Sep 17 00:00:00 2001
+From: Zurab Kvachadze <zurabid2016@gmail.com>
+Date: Thu, 13 Feb 2025 19:43:54 +0100
+Subject: [PATCH] hashed-upstream.t: skip the test
+
+The "hashed-upstream.t" test utilises the upstream_list command. I do
+not know which module provides this command and so far I have been
+unsuccessful to find anything online.
+
+Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
+---
+ t/hashed-upstream.t | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/t/hashed-upstream.t b/t/hashed-upstream.t
+index fdebd15..6e3a912 100644
+--- a/t/hashed-upstream.t
++++ b/t/hashed-upstream.t
+@@ -1,7 +1,8 @@
+ # vi:filetype=
+
+ use lib 'lib';
+-use Test::Nginx::Socket;
++use Test::Nginx::Socket skip_all =>
++ 'not working at all';
+
+ #repeat_each(3);
+
+--
+2.45.3
+
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
index c71366126ffe..2ee48f716938 100644
--- a/www-nginx/ngx-set-misc/ngx-set-misc-0.33.ebuild
+++ b/www-nginx/ngx-set-misc/ngx-set-misc-0.33.ebuild
@@ -8,6 +8,11 @@ NGINX_MOD_S="${WORKDIR}/${MY_PN}-${PV}"
NGINX_MOD_LINK_MODULES=( www-nginx/ngx_devel_kit )
+NGINX_MOD_OPENRESTY_TESTS=1
+NGINX_MOD_TEST_LOAD_ORDER=(
+ www-nginx/ngx-echo
+ www-nginx/ngx-iconv
+)
inherit toolchain-funcs nginx-module
DESCRIPTION="An NGINX module that adds various set_xxx directives to NGINX's rewrite module"
@@ -21,14 +26,13 @@ SLOT="0"
IUSE="+hmac"
-RESTRICT="test"
-
BDEPEND="virtual/pkgconfig"
DEPEND="hmac? ( dev-libs/openssl:= )"
RDEPEND="${DEPEND}"
PATCHES=(
"${FILESDIR}/${PN}-0.33-hmac-configurable.patch"
+ "${FILESDIR}/${PN}-0.33-skip-hashed-upstream_t-test.patch"
)
src_configure() {
diff --git a/www-nginx/ngx-srcache/files/ngx-srcache-0.33-disable-invalid-tests.patch b/www-nginx/ngx-srcache/files/ngx-srcache-0.33-disable-invalid-tests.patch
new file mode 100644
index 000000000000..f3db3c1637fc
--- /dev/null
+++ b/www-nginx/ngx-srcache/files/ngx-srcache-0.33-disable-invalid-tests.patch
@@ -0,0 +1,147 @@
+From e69195edbb7c38135743c4a0c19a6d78d0e7467a Mon Sep 17 00:00:00 2001
+From: Zurab Kvachadze <zurabid2016@gmail.com>
+Date: Thu, 13 Feb 2025 21:41:35 +0100
+Subject: [PATCH] t: Disable invalid tests
+
+Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
+---
+ t/000_init.t | 3 ++-
+ t/conditional-get.t | 3 ++-
+ t/drizzle-main.t | 3 ++-
+ t/eval.t | 3 ++-
+ t/methods.t | 3 ++-
+ t/postgres-main.t | 3 ++-
+ t/proxy.t | 3 ++-
+ t/redis.t | 3 ++-
+ t/timeout.t | 3 ++-
+ 9 files changed, 18 insertions(+), 9 deletions(-)
+
+diff --git a/t/000_init.t b/t/000_init.t
+index b611e6c..06663e6 100644
+--- a/t/000_init.t
++++ b/t/000_init.t
+@@ -1,7 +1,8 @@
+ # vi:filetype=
+
+ use lib 'lib';
+-use Test::Nginx::Socket;
++use Test::Nginx::Socket skip_all =>
++ 'Gentoo does not package neither ngx_postgres nor drizzle';
+
+ repeat_each(1);
+
+diff --git a/t/conditional-get.t b/t/conditional-get.t
+index b652ee6..82daf84 100644
+--- a/t/conditional-get.t
++++ b/t/conditional-get.t
+@@ -1,7 +1,8 @@
+ # vi:filetype=
+
+ use lib 'lib';
+-use Test::Nginx::Socket;
++use Test::Nginx::Socket skip_all =>
++ 'uses arbitrary hostname as proxy_pass';
+
+ #repeat_each(100);
+
+diff --git a/t/drizzle-main.t b/t/drizzle-main.t
+index 5ff11eb..150ce52 100644
+--- a/t/drizzle-main.t
++++ b/t/drizzle-main.t
+@@ -1,7 +1,8 @@
+ # vi:filetype=
+
+ use lib 'lib';
+-use Test::Nginx::Socket;
++use Test::Nginx::Socket skip_all =>
++ 'drizzle is not packaged by Gentoo';
+
+ #repeat_each(100);
+
+diff --git a/t/eval.t b/t/eval.t
+index c109463..bda4dc9 100644
+--- a/t/eval.t
++++ b/t/eval.t
+@@ -1,7 +1,8 @@
+ # vi:filetype=
+
+ use lib 'lib';
+-use Test::Nginx::Socket;
++use Test::Nginx::Socket skip_all =>
++ 'Gentoo does not package drizzle';
+
+ repeat_each(3);
+
+diff --git a/t/methods.t b/t/methods.t
+index 9a57b38..f48e37d 100644
+--- a/t/methods.t
++++ b/t/methods.t
+@@ -1,7 +1,8 @@
+ # vi:filetype=
+
+ use lib 'lib';
+-use Test::Nginx::Socket;
++use Test::Nginx::Socket skip_all =>
++ 'uses arbitrary hostname as proxy_pass';
+
+ #repeat_each(2);
+
+diff --git a/t/postgres-main.t b/t/postgres-main.t
+index ccc00c4..b1e53ea 100644
+--- a/t/postgres-main.t
++++ b/t/postgres-main.t
+@@ -1,7 +1,8 @@
+ # vi:filetype=
+
+ use lib 'lib';
+-use Test::Nginx::Socket;
++use Test::Nginx::Socket skip_all =>
++ 'ngx_postgres is not packaged by Gentoo';
+
+ #repeat_each(100);
+
+diff --git a/t/proxy.t b/t/proxy.t
+index f3e6a31..9eb8678 100644
+--- a/t/proxy.t
++++ b/t/proxy.t
+@@ -1,7 +1,8 @@
+ # vi:filetype=
+
+ use lib 'lib';
+-use Test::Nginx::Socket;
++use Test::Nginx::Socket skip_all =>
++ 'Gentoo does not package drizzle';
+
+ #repeat_each(100);
+
+diff --git a/t/redis.t b/t/redis.t
+index 8af2ff0..ff10a5c 100644
+--- a/t/redis.t
++++ b/t/redis.t
+@@ -1,7 +1,8 @@
+ # vi:ft=
+
+ use lib 'lib';
+-use Test::Nginx::Socket;
++use Test::Nginx::Socket skip_all =>
++ 'relies on horribly outdated Redis 2.x';
+
+ #repeat_each(2);
+
+diff --git a/t/timeout.t b/t/timeout.t
+index 9357658..b9a8827 100644
+--- a/t/timeout.t
++++ b/t/timeout.t
+@@ -1,7 +1,8 @@
+ # vi:filetype=
+
+ use lib 'lib';
+-use Test::Nginx::Socket;
++use Test::Nginx::Socket skip_all =>
++ 'uses arbitrary hostname as proxy_pass';
+
+ repeat_each(2);
+
+--
+2.45.3
+
diff --git a/www-nginx/ngx-srcache/ngx-srcache-0.33.ebuild b/www-nginx/ngx-srcache/ngx-srcache-0.33.ebuild
index cabc43d06fb8..4c2d85d661db 100644
--- a/www-nginx/ngx-srcache/ngx-srcache-0.33.ebuild
+++ b/www-nginx/ngx-srcache/ngx-srcache-0.33.ebuild
@@ -6,6 +6,17 @@ EAPI=8
MY_PN="srcache-nginx-module"
NGINX_MOD_S="${WORKDIR}/${MY_PN}-${PV}"
+NGINX_MOD_OPENRESTY_TESTS=1
+# ngx-srcache must be after ngx-xss, but before ngx-lua-module. The former might
+# be due to the fact that both ngx-xss and ngx-srcache are filters. As for the
+# latter, I just don't know.
+NGINX_MOD_TEST_LOAD_ORDER=(
+ www-nginx/ngx-xss
+ www-nginx/ngx-srcache
+ www-nginx/ngx-lua-module
+ www-nginx/ngx-echo
+ www-nginx/ngx-memc
+)
inherit nginx-module
DESCRIPTION="An NGINX module enabling transparent subrequest-based caching"
@@ -17,4 +28,26 @@ SRC_URI="
LICENSE="BSD-2"
SLOT="0"
-RESTRICT="test"
+# Tests require NGINX to be built with debugging log enabled.
+BDEPEND="test? ( www-servers/nginx[debug(-)] )"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-0.33-disable-invalid-tests.patch"
+)
+
+src_test() {
+ # Start memcached in background on a port 11211, the default port if
+ # environment variable TEST_NGINX_MEMCACHED_PORT is not set.
+ # memcached is enclosed in braces so that the not operator properly applies
+ # to the asynchronous invocation of memcached.
+ if ! { memcached -p 11211 & }
+ then
+ die "memcached failed"
+ fi
+ # Save the PID of the launched memcached instance.
+ local memcached_pid=$!
+
+ nginx-module_src_test
+
+ kill "${memcached_pid}" || die "killing memcached failed"
+}
diff --git a/www-nginx/ngx-xss/ngx-xss-0.06.ebuild b/www-nginx/ngx-xss/ngx-xss-0.06.ebuild
index b190db7280f6..e73f6c7f51d4 100644
--- a/www-nginx/ngx-xss/ngx-xss-0.06.ebuild
+++ b/www-nginx/ngx-xss/ngx-xss-0.06.ebuild
@@ -6,6 +6,12 @@ EAPI=8
MY_PN="xss-nginx-module"
NGINX_MOD_S="${WORKDIR}/${MY_PN}-${PV}"
+# Strangely, 10-year-old tests work perfectly.
+NGINX_MOD_OPENRESTY_TESTS=1
+NGINX_MOD_TEST_LOAD_ORDER=(
+ www-nginx/ngx-lua-module
+ www-nginx/ngx-echo
+)
inherit nginx-module
DESCRIPTION="Native support for cross-site scripting (XSS) in NGINX"
@@ -17,8 +23,6 @@ SRC_URI="
LICENSE="BSD-2"
SLOT="0"
-RESTRICT="test"
-
PATCHES=(
"${FILESDIR}/${PN}-0.06-add-dynamic-build-support.patch"
)
--
2.45.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* Re: [gentoo-dev] [PATCH v3 00/40] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass
2025-02-21 16:07 [gentoo-dev] [PATCH v3 00/40] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass Zurab Kvachadze
` (39 preceding siblings ...)
2025-02-21 16:08 ` [gentoo-dev] [PATCH v3 40/40] www-nginx: enable tests Zurab Kvachadze
@ 2025-02-22 3:55 ` Zhixu Liu
40 siblings, 0 replies; 42+ messages in thread
From: Zhixu Liu @ 2025-02-22 3:55 UTC (permalink / raw
To: gentoo-dev; +Cc: Zurab Kvachadze
I'll be happy to see this PR get reviewed and merged.
I've one question on the style of the revision scheme of the files in
${FILESDIR}: this PR introduce a revision scheme
(nginx-r*.{conf,confd,service,...}) which is different to current
scheme (nginx.{conf,service,...}.r*).
Personally I'd like to align to the existing scheme for a better view
when checking the files. But I'm not insisting on this, because the
old files will be removed sooner or later as we remove the old
ebuilds.
I've several more comments which are not required to be resolved in this PR:
1. nginx.conf should be highly modular, keep example in config to be
imported by include, add hook in every possible context, so in
general, user can add their site-specific config in these locations.
2. www-nginx/ngx-lua-module should not hard RDEPEND on lua-resty-core.
Despite the document said so
(https://github.com/openresty/lua-nginx-module?tab=readme-ov-file#lua_load_resty_core),
but a little trick can bypass the check logic (see
https://github.com/gentoo/gentoo/commit/7ac2835a3fc6c319970af018f3c38752ca46e14a
for current solution), so I think it's better to add USE="resty"
(enabled by default).
3. Static module support. While the dynamic module is suitable for
most cases, I'd like to still leave a possibility to use static linked
module. I'd like to work on a solution after this PR.
Thanks a lot for this great PR.
On Sat, Feb 22, 2025 at 12:09 AM Zurab Kvachadze <zurabid2016@gmail.com> wrote:
>
> This is the third iteration of the patch series.
>
> References
> ===========
>
> GitHub PR: https://github.com/gentoo/gentoo/pull/37590
>
> v2 of the patch series: https://public-inbox.gentoo.org/gentoo-dev/20240729215241.13243-1-zurabid2016@gmail.com/
>
> NEWS item patch: https://public-inbox.gentoo.org/gentoo-dev/20250221153621.26266-2-zurabid2016@gmail.com/
>
> Abstract
> ===========
>
> This is an attempt to improve the state of NGINX in the Gentoo tree. The
> majority of reasoning for introducing this series can be found in the
> nginx.eclass commit, whereas the actual differences between the previous and
> the new versions are outlined in the NGINX 1.26.1 revbump commit. All the
> commits are pretty self-descriptive, explaining the rationale and implementation
> in way more details than I could describe here. I recommend you to start with
> the nginx.eclass commit.
>
> Such "refreshes" are important for Gentoo, in my belief. NGINX has not been
> "full-time" maintained for two years now, let alone being rewritten. Thus, NGINX
> ebuilds are around 42K in size, having accumulated rust over the years. The
> sheer size and monstrosity of the ebuild hinders the discourages developers from
> adopting the package. These patches aim to drastically reduce the size and fix
> numerous issues that NGINX has acquired throughout its lifetime.
>
> This MR closes the following bugs as RESOLVED FIXED:
> * 573710, 481456, 928131, 576414, 578658, 735020, 700866
>
> Makes progress towards solving these bugs:
> * 886537
>
> And otherwise mentions these bugs:
> * 925098
>
> Changelog
> ===========
>
> The changes between v2 and v3:
>
> * Fully support the upstream transition to Git from Mercurial.
>
> * Fix NGINX uwsgi tests.
>
> * Greatly simplify dependency handling for third-party modules by
> introducing the ngx_mod_append_libs() function.
>
> * Enable specifying NGINX module dependencies declaratively via the
> NGINX_MOD_LINK_MODULES array.
>
> * Add tests support for NGINX modules via Test::Nginx (dev-perl/Test-Nginx).
>
> * Port 10 more modules to nginx-module.eclass.
>
> * Some minor improvements to NGINX miscellaneous files.
>
> The changes between v1 and v2:
>
> * nginx.eclass: Add support for installing tmpfiles.d(5) files via
> NGINX_MISC_FILES. Add RDEPEND on virtual/tmpfiles. Also, the
> _ngx_set_mod_*() functions now work properly, by checking the module in
> question against the NGINX_MODULES array with the '+' sign stripped.
>
> * nginx.tmpfiles: Add tmpfiles.d(5) file to manage the /var/tmp/nginx
> directory used to store temporary NGINX files.
>
> * nginx-r5.initd: Set pidfile to /run/${RC_SVCNAME}.pid, make NGINX use that
> instead of the pidfile specified in its configuration file. Allows for
> seamlessly running multiple instances of NGINX. Set NGINX_CONFIGFILE to
> /etc/nginx/${RC_SVCNAME}.conf. Remove 'need net' from depend(). Remove the
> start_pre() function with the call to checkpath. Its functionality is now
> delegated to systemd-tmpfiles(8).
>
> * nginx-r1.confd: The relevant NGINX_PIDFILE option is removed since the
> pidfile is unconditionally saved to /run/${RC_SVCNAME}.pid.
>
> * nginx-*.ebuild: Declare nginx.tmpfiles in NGINX_MISC_FILES, thus
> installing it.
>
> * One more paragraph was added to the third party modules section (2) in
> the "Question and problems", which suggest issuing NEWS item, due to
> the impact of the changes.
>
>
> Happy hacking :)
>
> Zurab Kvachadze (40):
> nginx.eclass: Add new eclass for building the NGINX server
> dev-perl/Test-Nginx: new package, add 0.30
> nginx-module.eclass: Add new eclass for building NGINX external
> modules
> profiles/arch/powerpc/ppc64: mask tests for www-servers/nginx
> profiles/arch/riscv: mask tests for www-servers/nginx
> www-servers/nginx: add myself as a proxy maintainer; update
> metadata.xml
> www-servers/nginx: add nginx.tmpfiles for managing /var/tmp/nginx
> www-servers/nginx: add nginx-r5.initd
> www-servers/nginx: add nginx-r1.confd
> www-servers/nginx: add nginx-r2.service
> www-servers/nginx: add nginx-r2.logrotate
> www-servers/nginx: add nginx-r4.conf
> profiles/desc: reword and update nginx_modules_http.desc
> profiles/desc: reword and update nginx_modules_mail.desc
> profiles/desc: reword and update nginx_modules_stream.desc
> profiles/categories: Add www-nginx category for external NGINX modules
> app-metrics/nginx-lua-prometheus: revbump to r101, update EAPI 7 -> 8,
> remove r100
> www-servers/nginx: revbump 1.26.3-r0 to 1.26.3-r1, use nginx.eclass
> www-servers/nginx: revbump 1.27.4-r0 to 1.27.4-r1, use nginx.eclass
> www-servers/nginx: add 9999 live version, use nginx.eclass
> www-nginx/ngx_devel_kit: new package, add 0.3.4
> www-nginx/ngx-echo: new package, add 0.63
> www-nginx/ngx-encrypted-session: new package, add 0.09
> www-nginx/ngx-set-misc: new package, add 0.33
> www-nginx/ngx-brotli: new package, add 20231109
> www-nginx/ngx-headers-more: new package, add 0.37
> www-nginx/ngx-upload-progress: new package, add 0.9.3
> dev-lua/lua-resty-core: new package, add 0.1.30
> dev-lua/lua-resty-lrucache: new package, add 0.15
> www-nginx/ngx-lua-module: new package, add 0.10.27
> dev-lua/lua-resty-string: new package, add 0.16
> dev-lua/lua-resty-mysql: new package, add 0.27
> dev-lua/lua-resty-memcached: new package, add 0.17
> www-nginx/ngx-xss: new package, add 0.06
> www-nginx/ngx-eval: new package, add 0_p20240817
> www-nginx/ngx-iconv: new package, add 0.14
> www-nginx/ngx-srcache: new package, add 0.33
> www-nginx/ngx-lua-upstream: new package, add 0.07
> www-nginx/ngx-memc: new package, add 0.20
> www-nginx: enable tests
>
> ...ua-prometheus-0.1_pre20170610-r101.ebuild} | 17 +-
> dev-lua/lua-resty-core/Manifest | 1 +
> .../lua-resty-core-0.1.30.ebuild | 33 +
> dev-lua/lua-resty-core/metadata.xml | 24 +
> dev-lua/lua-resty-lrucache/Manifest | 1 +
> .../lua-resty-lrucache-0.15.ebuild | 33 +
> dev-lua/lua-resty-lrucache/metadata.xml | 19 +
> dev-lua/lua-resty-memcached/Manifest | 1 +
> .../lua-resty-memcached-0.17.ebuild | 33 +
> dev-lua/lua-resty-memcached/metadata.xml | 16 +
> dev-lua/lua-resty-mysql/Manifest | 1 +
> .../lua-resty-mysql-0.27.ebuild | 37 +
> dev-lua/lua-resty-mysql/metadata.xml | 22 +
> dev-lua/lua-resty-string/Manifest | 1 +
> .../lua-resty-string-0.16.ebuild | 38 +
> dev-lua/lua-resty-string/metadata.xml | 16 +
> dev-perl/Test-Nginx/Manifest | 1 +
> dev-perl/Test-Nginx/Test-Nginx-0.30.ebuild | 36 +
> ...inx-0.30-preset-temp_path-directives.patch | 38 +
> ...est-Nginx-0.30-set-default-error-log.patch | 48 +
> dev-perl/Test-Nginx/metadata.xml | 17 +
> eclass/nginx-module.eclass | 811 +++++++++++++++
> eclass/nginx.eclass | 950 ++++++++++++++++++
> profiles/arch/powerpc/ppc64/package.use.mask | 4 +
> profiles/arch/riscv/package.use.mask | 4 +
> profiles/categories | 1 +
> profiles/desc/nginx_modules_http.desc | 147 +--
> profiles/desc/nginx_modules_mail.desc | 9 +-
> profiles/desc/nginx_modules_stream.desc | 34 +-
> www-nginx/metadata.xml | 7 +
> www-nginx/ngx-brotli/Manifest | 2 +
> www-nginx/ngx-brotli/metadata.xml | 24 +
> .../ngx-brotli/ngx-brotli-20231109.ebuild | 30 +
> www-nginx/ngx-echo/Manifest | 1 +
> www-nginx/ngx-echo/metadata.xml | 24 +
> www-nginx/ngx-echo/ngx-echo-0.63.ebuild | 26 +
> www-nginx/ngx-encrypted-session/Manifest | 1 +
> www-nginx/ngx-encrypted-session/metadata.xml | 22 +
> .../ngx-encrypted-session-0.09.ebuild | 38 +
> www-nginx/ngx-eval/Manifest | 1 +
> www-nginx/ngx-eval/metadata.xml | 16 +
> .../ngx-eval/ngx-eval-0_p20240817.ebuild | 43 +
> www-nginx/ngx-headers-more/Manifest | 1 +
> www-nginx/ngx-headers-more/metadata.xml | 23 +
> .../ngx-headers-more-0.37.ebuild | 29 +
> www-nginx/ngx-iconv/Manifest | 1 +
> .../ngx-iconv-0.14-skip-rds-json-tests.patch | 30 +
> www-nginx/ngx-iconv/metadata.xml | 20 +
> www-nginx/ngx-iconv/ngx-iconv-0.14.ebuild | 36 +
> www-nginx/ngx-lua-module/Manifest | 1 +
> ...lua-module-0.10.27-always-define-NDK.patch | 29 +
> ...0.10.27-do-not-log-non-openresty-lua.patch | 41 +
> www-nginx/ngx-lua-module/metadata.xml | 21 +
> .../ngx-lua-module-0.10.27.ebuild | 67 ++
> www-nginx/ngx-lua-upstream/Manifest | 1 +
> ...lua-upstream-0.07-skip-invalid-tests.patch | 26 +
> www-nginx/ngx-lua-upstream/metadata.xml | 16 +
> .../ngx-lua-upstream-0.07.ebuild | 45 +
> www-nginx/ngx-memc/Manifest | 1 +
> ...0.20-stats_t-do-not-run-timeout-test.patch | 31 +
> www-nginx/ngx-memc/metadata.xml | 27 +
> www-nginx/ngx-memc/ngx-memc-0.20.ebuild | 48 +
> www-nginx/ngx-set-misc/Manifest | 1 +
> .../ngx-set-misc-0.33-hmac-configurable.patch | 71 ++
> ...isc-0.33-skip-hashed-upstream_t-test.patch | 31 +
> www-nginx/ngx-set-misc/metadata.xml | 25 +
> .../ngx-set-misc/ngx-set-misc-0.33.ebuild | 47 +
> www-nginx/ngx-srcache/Manifest | 1 +
> ...x-srcache-0.33-disable-invalid-tests.patch | 147 +++
> www-nginx/ngx-srcache/metadata.xml | 25 +
> www-nginx/ngx-srcache/ngx-srcache-0.33.ebuild | 53 +
> www-nginx/ngx-upload-progress/Manifest | 1 +
> www-nginx/ngx-upload-progress/metadata.xml | 24 +
> .../ngx-upload-progress-0.9.3.ebuild | 20 +
> www-nginx/ngx-xss/Manifest | 1 +
> ...x-xss-0.06-add-dynamic-build-support.patch | 34 +
> www-nginx/ngx-xss/metadata.xml | 21 +
> www-nginx/ngx-xss/ngx-xss-0.06.ebuild | 28 +
> www-nginx/ngx_devel_kit/Manifest | 1 +
> www-nginx/ngx_devel_kit/metadata.xml | 25 +
> .../ngx_devel_kit/ngx_devel_kit-0.3.4.ebuild | 45 +
> www-servers/nginx/Manifest | 1 +
> www-servers/nginx/files/nginx-r1.confd | 32 +
> www-servers/nginx/files/nginx-r2.logrotate | 11 +
> www-servers/nginx/files/nginx-r2.service | 11 +
> www-servers/nginx/files/nginx-r4.conf | 39 +
> www-servers/nginx/files/nginx-r5.initd | 112 +++
> www-servers/nginx/files/nginx.tmpfiles | 2 +
> www-servers/nginx/metadata.xml | 62 +-
> www-servers/nginx/nginx-1.26.3-r1.ebuild | 31 +
> www-servers/nginx/nginx-1.27.4-r1.ebuild | 31 +
> www-servers/nginx/nginx-9999.ebuild | 29 +
> 92 files changed, 3966 insertions(+), 118 deletions(-)
> rename app-metrics/nginx-lua-prometheus/{nginx-lua-prometheus-0.1_pre20170610-r100.ebuild => nginx-lua-prometheus-0.1_pre20170610-r101.ebuild} (79%)
> create mode 100644 dev-lua/lua-resty-core/Manifest
> create mode 100644 dev-lua/lua-resty-core/lua-resty-core-0.1.30.ebuild
> create mode 100644 dev-lua/lua-resty-core/metadata.xml
> create mode 100644 dev-lua/lua-resty-lrucache/Manifest
> create mode 100644 dev-lua/lua-resty-lrucache/lua-resty-lrucache-0.15.ebuild
> create mode 100644 dev-lua/lua-resty-lrucache/metadata.xml
> create mode 100644 dev-lua/lua-resty-memcached/Manifest
> create mode 100644 dev-lua/lua-resty-memcached/lua-resty-memcached-0.17.ebuild
> create mode 100644 dev-lua/lua-resty-memcached/metadata.xml
> create mode 100644 dev-lua/lua-resty-mysql/Manifest
> create mode 100644 dev-lua/lua-resty-mysql/lua-resty-mysql-0.27.ebuild
> create mode 100644 dev-lua/lua-resty-mysql/metadata.xml
> create mode 100644 dev-lua/lua-resty-string/Manifest
> create mode 100644 dev-lua/lua-resty-string/lua-resty-string-0.16.ebuild
> create mode 100644 dev-lua/lua-resty-string/metadata.xml
> create mode 100644 dev-perl/Test-Nginx/Manifest
> create mode 100644 dev-perl/Test-Nginx/Test-Nginx-0.30.ebuild
> create mode 100644 dev-perl/Test-Nginx/files/Test-Nginx-0.30-preset-temp_path-directives.patch
> create mode 100644 dev-perl/Test-Nginx/files/Test-Nginx-0.30-set-default-error-log.patch
> create mode 100644 dev-perl/Test-Nginx/metadata.xml
> create mode 100644 eclass/nginx-module.eclass
> create mode 100644 eclass/nginx.eclass
> create mode 100644 www-nginx/metadata.xml
> create mode 100644 www-nginx/ngx-brotli/Manifest
> create mode 100644 www-nginx/ngx-brotli/metadata.xml
> create mode 100644 www-nginx/ngx-brotli/ngx-brotli-20231109.ebuild
> create mode 100644 www-nginx/ngx-echo/Manifest
> create mode 100644 www-nginx/ngx-echo/metadata.xml
> create mode 100644 www-nginx/ngx-echo/ngx-echo-0.63.ebuild
> create mode 100644 www-nginx/ngx-encrypted-session/Manifest
> create mode 100644 www-nginx/ngx-encrypted-session/metadata.xml
> create mode 100644 www-nginx/ngx-encrypted-session/ngx-encrypted-session-0.09.ebuild
> create mode 100644 www-nginx/ngx-eval/Manifest
> create mode 100644 www-nginx/ngx-eval/metadata.xml
> create mode 100644 www-nginx/ngx-eval/ngx-eval-0_p20240817.ebuild
> create mode 100644 www-nginx/ngx-headers-more/Manifest
> create mode 100644 www-nginx/ngx-headers-more/metadata.xml
> create mode 100644 www-nginx/ngx-headers-more/ngx-headers-more-0.37.ebuild
> create mode 100644 www-nginx/ngx-iconv/Manifest
> create mode 100644 www-nginx/ngx-iconv/files/ngx-iconv-0.14-skip-rds-json-tests.patch
> create mode 100644 www-nginx/ngx-iconv/metadata.xml
> create mode 100644 www-nginx/ngx-iconv/ngx-iconv-0.14.ebuild
> create mode 100644 www-nginx/ngx-lua-module/Manifest
> create mode 100644 www-nginx/ngx-lua-module/files/ngx-lua-module-0.10.27-always-define-NDK.patch
> create mode 100644 www-nginx/ngx-lua-module/files/ngx-lua-module-0.10.27-do-not-log-non-openresty-lua.patch
> create mode 100644 www-nginx/ngx-lua-module/metadata.xml
> create mode 100644 www-nginx/ngx-lua-module/ngx-lua-module-0.10.27.ebuild
> create mode 100644 www-nginx/ngx-lua-upstream/Manifest
> create mode 100644 www-nginx/ngx-lua-upstream/files/ngx-lua-upstream-0.07-skip-invalid-tests.patch
> create mode 100644 www-nginx/ngx-lua-upstream/metadata.xml
> create mode 100644 www-nginx/ngx-lua-upstream/ngx-lua-upstream-0.07.ebuild
> create mode 100644 www-nginx/ngx-memc/Manifest
> create mode 100644 www-nginx/ngx-memc/files/ngx-memc-0.20-stats_t-do-not-run-timeout-test.patch
> create mode 100644 www-nginx/ngx-memc/metadata.xml
> create mode 100644 www-nginx/ngx-memc/ngx-memc-0.20.ebuild
> create mode 100644 www-nginx/ngx-set-misc/Manifest
> create mode 100644 www-nginx/ngx-set-misc/files/ngx-set-misc-0.33-hmac-configurable.patch
> create mode 100644 www-nginx/ngx-set-misc/files/ngx-set-misc-0.33-skip-hashed-upstream_t-test.patch
> create mode 100644 www-nginx/ngx-set-misc/metadata.xml
> create mode 100644 www-nginx/ngx-set-misc/ngx-set-misc-0.33.ebuild
> create mode 100644 www-nginx/ngx-srcache/Manifest
> create mode 100644 www-nginx/ngx-srcache/files/ngx-srcache-0.33-disable-invalid-tests.patch
> create mode 100644 www-nginx/ngx-srcache/metadata.xml
> create mode 100644 www-nginx/ngx-srcache/ngx-srcache-0.33.ebuild
> create mode 100644 www-nginx/ngx-upload-progress/Manifest
> create mode 100644 www-nginx/ngx-upload-progress/metadata.xml
> create mode 100644 www-nginx/ngx-upload-progress/ngx-upload-progress-0.9.3.ebuild
> create mode 100644 www-nginx/ngx-xss/Manifest
> create mode 100644 www-nginx/ngx-xss/files/ngx-xss-0.06-add-dynamic-build-support.patch
> create mode 100644 www-nginx/ngx-xss/metadata.xml
> create mode 100644 www-nginx/ngx-xss/ngx-xss-0.06.ebuild
> create mode 100644 www-nginx/ngx_devel_kit/Manifest
> create mode 100644 www-nginx/ngx_devel_kit/metadata.xml
> create mode 100644 www-nginx/ngx_devel_kit/ngx_devel_kit-0.3.4.ebuild
> create mode 100644 www-servers/nginx/files/nginx-r1.confd
> create mode 100644 www-servers/nginx/files/nginx-r2.logrotate
> create mode 100644 www-servers/nginx/files/nginx-r2.service
> create mode 100644 www-servers/nginx/files/nginx-r4.conf
> create mode 100644 www-servers/nginx/files/nginx-r5.initd
> create mode 100644 www-servers/nginx/files/nginx.tmpfiles
> create mode 100644 www-servers/nginx/nginx-1.26.3-r1.ebuild
> create mode 100644 www-servers/nginx/nginx-1.27.4-r1.ebuild
> create mode 100644 www-servers/nginx/nginx-9999.ebuild
>
> --
> 2.45.3
>
>
--
Z. Liu
^ permalink raw reply [flat|nested] 42+ messages in thread