www-servers/nginx: Fix building of uploadprogress module; Add autotools depedencies

Ebuild changes:
===============
- Since nginx-upload-progress-module was bumped to v0.9.2 (commit
  f03aacc3dc) the module was only build as dynamic module so it wasn't
  useable in Gentoo. This is now fixed. (Bug #593450)

- Cherry-picked a patch for cURL detection in Mod_Security

- Added autotools depedencies (only necessary when you build
  nginx_modules_http_security)

Gentoo-Bug: https://bugs.gentoo.org/593450

Package-Manager: portage-2.3.2
This commit is contained in:
Thomas Deutschmann
2016-10-19 16:37:20 +02:00
parent 6bd3083a1e
commit d85eb428d8
4 changed files with 191 additions and 16 deletions

View File

@@ -0,0 +1,103 @@
From 2fa8ffea68498e02005e85c27e61bde30718ae3b Mon Sep 17 00:00:00 2001
From: Thomas Deutschmann <whissi@whissi.de>
Date: Sat, 11 Jun 2016 16:18:17 +0200
Subject: [PATCH 1/2] configure: Fix detection whether libcurl is linked
against gnutls
The find_curl macro is also checking whether libcurl is linked against
gnutls. However the check depends on "CURL_LIBS" which wasn't defined
by the macro.
This commit will define "CURL_LIBS" so that the check works as expected.
---
build/find_curl.m4 | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/build/find_curl.m4 b/build/find_curl.m4
index 6b23ad6..3310e40 100644
--- a/build/find_curl.m4
+++ b/build/find_curl.m4
@@ -2,6 +2,7 @@ dnl Check for CURL Libraries
dnl CHECK_CURL(ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
dnl Sets:
dnl CURL_CFLAGS
+dnl CURL_LDADD
dnl CURL_LIBS
CURL_CONFIG=""
@@ -57,7 +58,8 @@ if test -n "${curl_path}"; then
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(curl VERSION: $CURL_VERSION); fi
CURL_CFLAGS="`${CURL_CONFIG} --cflags`"
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(curl CFLAGS: $CURL_CFLAGS); fi
- CURL_LDADD="`${CURL_CONFIG} --libs`"
+ CURL_LIBS="`${CURL_CONFIG} --libs`"
+ CURL_LDADD="${CURL_LIBS}"
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(curl LDADD: $CURL_LIBS); fi
dnl # Check version is ok
From 67f98e7da04251a40a0172e3dfac2c5a6ac6f7dd Mon Sep 17 00:00:00 2001
From: Thomas Deutschmann <whissi@whissi.de>
Date: Sat, 11 Jun 2016 16:48:58 +0200
Subject: [PATCH 2/2] configure: Move verbose_output declaration up to the
beginning
Macros like "find_curl" are using "verbose_output" variable but because some
of them are called before we define the variable we are seeing errors like
./configure: line 13855: test: : integer expression expected
This commit will fix the problem by moving the "verbose_output" declaration
up to the beginning so that the variable is available for every macro.
---
configure.ac | 30 ++++++++++++++++--------------
1 file changed, 16 insertions(+), 14 deletions(-)
diff --git a/configure.ac b/configure.ac
index 7517885..0f32b01 100644
--- a/configure.ac
+++ b/configure.ac
@@ -70,6 +70,22 @@ AC_SUBST(MSC_REGRESSION_DOCROOT_DIR)
### Configure Options
+# Verbose output
+AC_ARG_ENABLE(verbose-output,
+ AS_HELP_STRING([--enable-verbose-output],
+ [Enable more verbose configure output.]),
+[
+ if test "$enableval" != "no"; then
+ verbose_output=1
+ else
+ verbose_output=0
+ fi
+],
+[
+ verbose_output=0
+])
+
+
#OS type
AC_CANONICAL_HOST
@@ -410,20 +426,6 @@ AC_ARG_ENABLE(errors,
report_errors=1
])
-# Verbose output
-AC_ARG_ENABLE(verbose-output,
- AS_HELP_STRING([--enable-verbose-output],
- [Enable more verbose configure output.]),
-[
- if test "$enableval" != "no"; then
- verbose_output=1
- else
- verbose_output=0
- fi
-],
-[
- verbose_output=0
-])
# Strict Compile
AC_ARG_ENABLE(strict-compile,

View File

@@ -0,0 +1,32 @@
From edd7e026fa992f58b04ea9d00b56239f37b3e320 Mon Sep 17 00:00:00 2001
From: Thomas Deutschmann <whissi@whissi.de>
Date: Wed, 19 Oct 2016 15:05:27 +0200
Subject: [PATCH] config: Only build as dynamic module when really requested
Since commit 37182ce2f3b6 the module was always build as dynamic module.
Probably because following a bad skeleton [1].
With this change we will only build a dynamic module when requested. Otherwise
we will fall back to static build.
Link: https://trac.nginx.org/nginx/ticket/1115
Gentoo-Bug: https://bugs.gentoo.org/593450
Fixes: https://github.com/masterzen/nginx-upload-progress-module/issues/50
---
config | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/config b/config
index 364af8c..d704460 100644
--- a/config
+++ b/config
@@ -1,5 +1,5 @@
ngx_addon_name=ngx_http_uploadprogress_module
-if test -n "$ngx_module_link"; then
+if [ $ngx_module_link = DYNAMIC ] ; then
ngx_module_type=FILTER
ngx_module_name=ngx_http_uploadprogress_module
ngx_module_srcs="$ngx_addon_dir/ngx_http_uploadprogress_module.c"
--
2.10.1

View File

@@ -140,8 +140,9 @@ HTTP_LDAP_MODULE_WD="${WORKDIR}/nginx-auth-ldap-${HTTP_LDAP_MODULE_PV}"
# We handle deps below ourselves
SSL_DEPS_SKIP=1
AUTOTOOLS_AUTO_DEPEND="no"
inherit ssl-cert toolchain-funcs perl-module flag-o-matic user systemd versionator multilib
inherit autotools ssl-cert toolchain-funcs perl-module flag-o-matic user systemd versionator multilib
DESCRIPTION="Robust, small and high performance http and reverse proxy server"
HOMEPAGE="http://nginx.org"
@@ -276,6 +277,7 @@ RDEPEND="${CDEPEND}
selinux? ( sec-policy/selinux-nginx )
!www-servers/nginx:mainline"
DEPEND="${CDEPEND}
nginx_modules_http_security? ( ${AUTOTOOLS_DEPEND} )
arm? ( dev-libs/libatomic_ops )
libatomic? ( dev-libs/libatomic_ops )"
PDEPEND="vim-syntax? ( app-vim/nginx-syntax )"
@@ -334,6 +336,28 @@ src_prepare() {
sed -i -e 's/-llua5.1/-llua/' "${HTTP_LUA_MODULE_WD}/config" || die
fi
if use nginx_modules_http_security; then
cd "${HTTP_SECURITY_MODULE_WD}" || die
eapply "${FILESDIR}"/http_security-pr_1158.patch
eautoreconf
if use luajit ; then
sed -i \
-e 's|^\(LUA_PKGNAMES\)=.*|\1="luajit"|' \
configure || die
fi
cd "${S}" || die
fi
if use nginx_modules_http_upload_progress; then
cd "${HTTP_UPLOAD_PROGRESS_MODULE_WD}" || die
eapply "${FILESDIR}"/http_uploadprogress-issue_50.patch
cd "${S}" || die
fi
find auto/ -type f -print0 | xargs -0 sed -i 's:\&\& make:\&\& \\$(MAKE):' || die
# We have config protection, don't rename etc files
sed -i 's:.default::' auto/install || die
@@ -355,20 +379,16 @@ src_configure() {
# mod_security needs to generate nginx/modsecurity/config before including it
if use nginx_modules_http_security; then
cd "${HTTP_SECURITY_MODULE_WD}" || die
if use luajit ; then
sed -i \
-e 's|^\(LUA_PKGNAMES\)=.*|\1="luajit"|' \
configure || die
fi
./configure \
--enable-standalone-module \
--disable-mlogc \
--with-ssdeep=no \
$(use_enable pcre-jit) \
$(use_with nginx_modules_http_lua lua) || die "configure failed for mod_security"
fi
cd "${S}" || die
cd "${S}" || die
fi
local myconf=() http_enabled= mail_enabled= stream_enabled=

View File

@@ -140,8 +140,9 @@ HTTP_LDAP_MODULE_WD="${WORKDIR}/nginx-auth-ldap-${HTTP_LDAP_MODULE_PV}"
# We handle deps below ourselves
SSL_DEPS_SKIP=1
AUTOTOOLS_AUTO_DEPEND="no"
inherit ssl-cert toolchain-funcs perl-module flag-o-matic user systemd versionator multilib
inherit autotools ssl-cert toolchain-funcs perl-module flag-o-matic user systemd versionator multilib
DESCRIPTION="Robust, small and high performance http and reverse proxy server"
HOMEPAGE="http://nginx.org"
@@ -283,6 +284,7 @@ RDEPEND="${CDEPEND}
selinux? ( sec-policy/selinux-nginx )
!www-servers/nginx:0"
DEPEND="${CDEPEND}
nginx_modules_http_security? ( ${AUTOTOOLS_DEPEND} )
arm? ( dev-libs/libatomic_ops )
libatomic? ( dev-libs/libatomic_ops )"
PDEPEND="vim-syntax? ( app-vim/nginx-syntax )"
@@ -342,6 +344,28 @@ src_prepare() {
sed -i -e 's/-llua5.1/-llua/' "${HTTP_LUA_MODULE_WD}/config" || die
fi
if use nginx_modules_http_security; then
cd "${HTTP_SECURITY_MODULE_WD}" || die
eapply "${FILESDIR}"/http_security-pr_1158.patch
eautoreconf
if use luajit ; then
sed -i \
-e 's|^\(LUA_PKGNAMES\)=.*|\1="luajit"|' \
configure || die
fi
cd "${S}" || die
fi
if use nginx_modules_http_upload_progress; then
cd "${HTTP_UPLOAD_PROGRESS_MODULE_WD}" || die
eapply "${FILESDIR}"/http_uploadprogress-issue_50.patch
cd "${S}" || die
fi
find auto/ -type f -print0 | xargs -0 sed -i 's:\&\& make:\&\& \\$(MAKE):' || die
# We have config protection, don't rename etc files
sed -i 's:.default::' auto/install || die
@@ -363,20 +387,16 @@ src_configure() {
# mod_security needs to generate nginx/modsecurity/config before including it
if use nginx_modules_http_security; then
cd "${HTTP_SECURITY_MODULE_WD}" || die
if use luajit ; then
sed -i \
-e 's|^\(LUA_PKGNAMES\)=.*|\1="luajit"|' \
configure || die
fi
./configure \
--enable-standalone-module \
--disable-mlogc \
--with-ssdeep=no \
$(use_enable pcre-jit) \
$(use_with nginx_modules_http_lua lua) || die "configure failed for mod_security"
fi
cd "${S}" || die
cd "${S}" || die
fi
local myconf=() http_enabled= mail_enabled= stream_enabled=