commit:     a11f317df653e64a0d672366cd6ff4642a2b8ee4
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 24 03:20:12 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jun 24 03:20:12 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a11f317d

www-apache/libapreq2: EAPI 8, fix runtime w/ BIND_NOW

Closes: https://bugs.gentoo.org/934379
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/libapreq2-2.08-fix-linkage.patch         | 51 +++++++++++++
 www-apache/libapreq2/libapreq2-2.17-r1.ebuild      | 83 ++++++++++++++++++++++
 2 files changed, 134 insertions(+)

diff --git a/www-apache/libapreq2/files/libapreq2-2.08-fix-linkage.patch 
b/www-apache/libapreq2/files/libapreq2-2.08-fix-linkage.patch
new file mode 100644
index 000000000000..c77fceb0640e
--- /dev/null
+++ b/www-apache/libapreq2/files/libapreq2-2.08-fix-linkage.patch
@@ -0,0 +1,51 @@
+https://bugs.gentoo.org/934379
+https://src.fedoraproject.org/rpms/libapreq2/blob/rawhide/f/libapreq2-2.12-install.patch
+
+From: Lubomir Rintel <lkund...@v3.sk>
+
+APR shared objects were not properly linked when they were installed to a
+specific DESTDIR. This was broken in r733406, which attempted to fix
+rpaths for the obscure platforms that still use them.
+
+With this applied, we call apreq2-config we just installed and add a library
+path of libraries in DESTDIR to linker.
+
+$ perl -MAPR::Request
+Can't load '/usr/lib/perl5/auto/APR/Request/Request.so' for module 
APR::Request: /usr/lib/perl5/auto/APR/Request/Request.so: undefined symbol: 
apreq_hook_disable_uploads at /usr/lib/perl5/DynaLoader.pm line 200.
+ at - line 0
+Compilation failed in require.
+BEGIN failed--compilation aborted.
+
+--- a/glue/Makefile.am
++++ b/glue/Makefile.am
+@@ -15,7 +15,9 @@ perl_test: perl/Makefile
+       cd perl; $(MAKE) test
+ 
+ perl_install:
+-      cd perl; INSTALL=1 @PERL@ @PERL_OPTS@ Makefile.PL -apxs @APACHE2_APXS@ 
@MM_OPTS@
++      cd perl; INSTALL=1 PKG_CONFIG_PATH=$(DESTDIR)$(libdir)/pkgconfig \
++              DESTDIR=$(DESTDIR) LIBDIR=$(libdir) \
++              @PERL@ @PERL_OPTS@ Makefile.PL -apxs @APACHE2_APXS@ @MM_OPTS@
+       cd perl; $(MAKE) install
+ 
+ perl_clean:
+--- a/glue/perl/Makefile.PL
++++ b/glue/perl/Makefile.PL
+@@ -136,10 +136,15 @@ if (WIN32) {
+     my $apreq2_config = "$base_dir/apreq2-config";
+     my $bindir = qx{$apreq2_config --bindir};
+     chomp $bindir;
+-    $apreq2_config = "$bindir/apreq2-config" if $ENV{INSTALL};
++    $apreq2_config = "PKG_CONFIG_PATH=$ENV{PKG_CONFIG_PATH} ".
++                     $ENV{DESTDIR}."$bindir/apreq2-config"
++                     if $ENV{INSTALL};
+     $apreq_libs = qx{$apreq2_config --link-ld --ldflags --libs};
++    die "Failed to run $apreq2_config" if $?;
+     chomp $apreq_libs;
++    $apreq_libs = " -L".$ENV{DESTDIR}.$ENV{LIBDIR}." ".$apreq_libs
++                  if $ENV{INSTALL};
+ }
+ 
+ my $mp2_typemaps = Apache2::Build->new->typemaps;
+
+

diff --git a/www-apache/libapreq2/libapreq2-2.17-r1.ebuild 
b/www-apache/libapreq2/libapreq2-2.17-r1.ebuild
new file mode 100644
index 000000000000..c379b136f230
--- /dev/null
+++ b/www-apache/libapreq2/libapreq2-2.17-r1.ebuild
@@ -0,0 +1,83 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit apache-module perl-module
+
+DESCRIPTION="A library for manipulating client request data via the Apache API"
+HOMEPAGE="https://httpd.apache.org/apreq/";
+SRC_URI="mirror://apache/httpd/libapreq/${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="2"
+KEYWORDS="~amd64 ~ppc ~ppc64 ~riscv ~x86"
+IUSE="perl test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+       || (
+               dev-libs/apr-util[openssl]
+               dev-libs/apr-util[nss]
+       )
+       perl? (
+               >=dev-perl/ExtUtils-XSBuilder-0.23
+               virtual/perl-version
+               >=www-apache/mod_perl-2
+       )
+       virtual/libcrypt:="
+DEPEND="
+       ${RDEPEND}
+       test? ( dev-perl/Apache-Test )"
+BDEPEND="sys-apps/file"
+
+PATCHES=(
+       "${FILESDIR}"/libapreq2-2.08-doc.patch
+       "${FILESDIR}"/libapreq2-2.08-fix-linkage.patch
+)
+
+APACHE2_MOD_FILE="module/apache2/.libs/mod_apreq2.so"
+APACHE2_MOD_CONF="76_mod_apreq"
+APACHE2_MOD_DEFINE="APREQ"
+
+need_apache2
+
+pkg_setup() {
+       perl_set_version
+}
+
+src_prepare() {
+       default
+
+       sed -i -e "s/PERL \$PERL_OPTS/PERL/" acinclude.m4 aclocal.m4 configure 
|| die
+}
+
+src_configure() {
+       econf \
+               --disable-static \
+               --with-apache2-apxs=${APXS} \
+               $(use_enable perl perl-glue)
+}
+
+src_install() {
+       APACHE_MODULESDIR="/usr/$(get_libdir)/apache2/modules"
+       apache-module_src_install
+
+       emake DESTDIR="${D}" INSTALLDIRS=vendor install
+       doman docs/man/man3/*.3
+
+       perl_delete_localpod
+
+       HTML_DOCS=( docs/html/. )
+       einstalldocs
+       dodoc INSTALL MANIFEST
+
+       local f
+       while IFS="" read -d $'\0' -r f ; do
+               if file "${f}" | grep -i " text"; then
+                       sed -i -e "s:${ED}:/:g" "${f}" || die
+               fi
+       done < <(find "${ED}" -type f -not -name '*.so' -print0)
+
+       find "${ED}" -name '*.la' -delete || die
+}

Reply via email to