From 9b921f0a27acb73f29835bcf94b91bbdef87e9de Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Wed, 14 Dec 2022 15:30:24 +0000 Subject: gentoo auto-resync : 14:12:2022 - 15:30:24 --- eclass/apache-2.eclass | 82 ++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 63 insertions(+), 19 deletions(-) (limited to 'eclass/apache-2.eclass') diff --git a/eclass/apache-2.eclass b/eclass/apache-2.eclass index 583657b35ffd..71fcb5428699 100644 --- a/eclass/apache-2.eclass +++ b/eclass/apache-2.eclass @@ -36,6 +36,12 @@ esac # INTERNAL VARIABLES # ============================================================================== +# @ECLASS_VARIABLE: GENTOO_USE_PCRE1 +# @DESCRIPTION: +# Temporary variable to allow older Apache versions to force using legacy +# dev-libs/libpcre. This will be removed once ebuilds using dev-libs/libpcre2 +# ar stable. + # @ECLASS_VARIABLE: GENTOO_PATCHNAME # @DESCRIPTION: # This internal variable contains the prefix for the patch tarball. @@ -138,7 +144,6 @@ RDEPEND=" dev-lang/perl >=dev-libs/apr-1.5.1:= =dev-libs/apr-util-1*:=[gdbm=,ldap?] - dev-libs/libpcre virtual/libcrypt:= apache2_modules_brotli? ( >=app-arch/brotli-0.6.0:= ) apache2_modules_deflate? ( sys-libs/zlib ) @@ -166,6 +171,12 @@ RDEPEND=" systemd? ( sys-apps/systemd ) " +if [[ -n ${GENTOO_USE_PCRE1} ]] ; then + RDEPEND+=" dev-libs/libpcre" +else + RDEPEND+=" dev-libs/libpcre2" +fi + DEPEND="${RDEPEND}" BDEPEND=" virtual/pkgconfig @@ -517,20 +528,37 @@ apache-2_src_prepare() { # ${T} must be not group-writable, else grsec TPE will block it chmod g-w "${T}" || die - # This package really should upgrade to using pcre's .pc file. - cat <<-\EOF >"${T}"/pcre-config - #!/bin/bash - flags=() - for flag; do - if [[ ${flag} == "--version" ]]; then - flags+=( --modversion ) - else - flags+=( "${flag}" ) - fi - done - exec ${PKG_CONFIG} libpcre "${flags[@]}" - EOF - chmod a+x "${T}"/pcre-config || die + if [[ -n ${GENTOO_USE_PCRE1} ]] ; then + # This package really should upgrade to using pcre's .pc file. + cat <<-\EOF > "${T}"/pcre-config + #!/usr/bin/env bash + flags=() + for flag; do + if [[ ${flag} == "--version" ]]; then + flags+=( --modversion ) + else + flags+=( "${flag}" ) + fi + done + exec ${PKG_CONFIG} libpcre "${flags[@]}" + EOF + chmod a+x "${T}"/pcre-config || die + else + # This package really should upgrade to using pcre's .pc file. + cat <<-\EOF > "${T}"/pcre2-config + #!/usr/bin/env bash + flags=() + for flag; do + if [[ ${flag} == "--version" ]]; then + flags+=( --modversion ) + else + flags+=( "${flag}" ) + fi + done + exec ${PKG_CONFIG} libpcre2-8 "${flags[@]}" + EOF + chmod a+x "${T}"/pcre2-config || die + fi } # @FUNCTION: apache-2_src_configure @@ -539,10 +567,11 @@ apache-2_src_prepare() { # MY_CONF apache-2_src_configure() { tc-export PKG_CONFIG + export ac_cv_path_PKGCONFIG="${PKG_CONFIG}" # Sanity check in case people have bad mounts/TPE settings. #500928 - if ! "${T}"/pcre-config --help >/dev/null ; then - eerror "Could not execute ${T}/pcre-config; do you have bad mount" + if ! "${T}"/pcre-config --help >/dev/null && ! "${T}"/pcre2-config --help >/dev/null ; then + eerror "Could not execute ${T}/pcre-config (or pcre2-config); do you have bad mount" eerror "permissions in ${T} or have TPE turned on in your kernel?" die "check your runtime settings #500928" fi @@ -567,13 +596,28 @@ apache-2_src_configure() { --with-mpm=${MY_MPM} --with-apr="${SYSROOT}${EPREFIX}"/usr --with-apr-util="${SYSROOT}${EPREFIX}"/usr - --with-pcre="${T}"/pcre-config --with-z="${EPREFIX}"/usr --with-port=80 --with-program-name=apache2 --enable-layout=Gentoo ) - ac_cv_path_PKGCONFIG=${PKG_CONFIG} \ + + if [[ -n ${GENTOO_USE_PCRE1} ]] ; then + export ac_cv_prog_ac_ct_PCRE_CONFIG="${T}"/pcre-config + + MY_CONF+=( + --without-pcre2 + --with-pcre="${T}"/pcre-config + ) + else + export ac_cv_prog_ac_ct_PCRE_CONFIG="${T}"/pcre2-config + + MY_CONF+=( + --without-pcre + --with-pcre2="${T}"/pcre2-config + ) + fi + econf "${MY_CONF[@]}" sed -i -e 's:apache2\.conf:httpd.conf:' include/ap_config_auto.h || die -- cgit v1.2.3