summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--eclass/nginx-module.eclass26
-rw-r--r--www-nginx/ngx-naxsi/files/ngx-naxsi-1.7-use-ngx_module_libs.patch4
-rw-r--r--www-nginx/ngx-naxsi/ngx-naxsi-1.7-r1.ebuild7
3 files changed, 27 insertions, 10 deletions
diff --git a/eclass/nginx-module.eclass b/eclass/nginx-module.eclass
index d25c961af8fd..1c321cb80766 100644
--- a/eclass/nginx-module.eclass
+++ b/eclass/nginx-module.eclass
@@ -353,11 +353,21 @@ ngx_mod_link_module() {
# @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}.
+# Holds the path to the module source directory, used in various phase
+# functions. If unset at the time of inherit, defaults to ${S}.
: "${NGINX_MOD_S=${S}}"
+# @ECLASS_VARIABLE: NGINX_MOD_CONFIG_DIR
+# @DESCRIPTION:
+# Holds the path of the directory containing the config script relative to the
+# module source directory specified by the ${NGINX_MOD_S} variable. If unset at
+# the time of inherit, defaults to "" (an empty string, meaning the config
+# script is located at the root of the module source directory).
+#
+# For example, in www-nginx/njs, NGINX_MOD_S="${WORKDIR}/${P}" and
+# NGINX_MOD_CONFIG_DIR="nginx".
+: "${NGINX_MOD_CONFIG_DIR=""}"
+
# 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
@@ -583,7 +593,8 @@ nginx-module_src_unpack() {
# Then, default_src_prepare() is called.
nginx-module_src_prepare() {
debug-print-function "${FUNCNAME[0]}" "$@"
- pushd "${NGINX_MOD_S}" >/dev/null || die "pushd failed"
+ pushd "${NGINX_MOD_S}/${NGINX_MOD_CONFIG_DIR}" >/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
@@ -610,8 +621,13 @@ nginx-module_src_prepare() {
die "sed failed"
echo 'mv build/ngx_auto_config.h build/__ngx_gentoo_mod_config.h' \
>> config || die "echo failed"
+
+ # cd into module root and apply patches.
+ pushd "${NGINX_MOD_S}" >/dev/null || die "pushd failed"
default_src_prepare
popd >/dev/null || die "popd failed"
+
+ popd >/dev/null || die "popd failed"
}
# @FUNCTION: nginx-module_src_configure
@@ -637,7 +653,7 @@ nginx-module_src_configure() {
--with-cc-opt="-isystem src/modules"
--with-ld-opt="${LDFLAGS}"
--builddir=build
- --add-dynamic-module="${NGINX_MOD_S}"
+ --add-dynamic-module="${NGINX_MOD_S}/${NGINX_MOD_CONFIG_DIR}"
)
# NGINX build system adds directories under src/ to the include path based
diff --git a/www-nginx/ngx-naxsi/files/ngx-naxsi-1.7-use-ngx_module_libs.patch b/www-nginx/ngx-naxsi/files/ngx-naxsi-1.7-use-ngx_module_libs.patch
index 6a655c037a70..bc39212c81eb 100644
--- a/www-nginx/ngx-naxsi/files/ngx-naxsi-1.7-use-ngx_module_libs.patch
+++ b/www-nginx/ngx-naxsi/files/ngx-naxsi-1.7-use-ngx_module_libs.patch
@@ -14,8 +14,8 @@ Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
diff --git a/naxsi_src/config b/naxsi_src/config
index 0b8d438..cd27c20 100644
---- a/config
-+++ b/config
+--- a/naxsi_src/config
++++ b/naxsi_src/config
@@ -49,7 +49,7 @@ if [ "$LIBINJECTION_FOUND" != "0" ]; then
else
echo "Using system libinjection"
diff --git a/www-nginx/ngx-naxsi/ngx-naxsi-1.7-r1.ebuild b/www-nginx/ngx-naxsi/ngx-naxsi-1.7-r1.ebuild
index 9fd5a8493ceb..40bcb0ac229e 100644
--- a/www-nginx/ngx-naxsi/ngx-naxsi-1.7-r1.ebuild
+++ b/www-nginx/ngx-naxsi/ngx-naxsi-1.7-r1.ebuild
@@ -4,7 +4,8 @@
EAPI=8
MY_PN="naxsi"
-NGINX_MOD_S="${WORKDIR}/${MY_PN}-${PV}/naxsi_src"
+NGINX_MOD_S="${WORKDIR}/${MY_PN}-${PV}"
+NGINX_MOD_CONFIG_DIR="naxsi_src"
inherit nginx-module
@@ -31,7 +32,7 @@ PATCHES=(
src_install() {
nginx-module_src_install
insinto /etc/nginx/naxsi
- doins -r "${NGINX_MOD_S}"/../naxsi_rules/*
+ doins -r "${NGINX_MOD_S}"/naxsi_rules/*
docompress -x "/usr/share/doc/${PF}"
- dodoc -r "${NGINX_MOD_S}"/../docs/*
+ dodoc -r "${NGINX_MOD_S}"/docs/*
}