From 443cf00359955073f2772af17d86a40e18f9b4eb Mon Sep 17 00:00:00 2001 From: Clement Laforet Date: Wed, 18 Aug 2004 19:11:12 +0000 Subject: - Fix buil with apache13 + ipv6 Set APACHE_PORT or define WITH_APACHE_IPV6 PR: ports/68158 Submitted by: SoD Obtained from: NetBSD --- www/mod_perl/Makefile | 4 +++ www/mod_perl/files/patch-Makefile.PL | 15 +++++++++ www/mod_perl/files/patch-aa | 15 --------- .../files/patch-src:modules:perl:Connection.xs | 39 ++++++++++++++++++++++ 4 files changed, 58 insertions(+), 15 deletions(-) create mode 100644 www/mod_perl/files/patch-Makefile.PL delete mode 100644 www/mod_perl/files/patch-aa create mode 100644 www/mod_perl/files/patch-src:modules:perl:Connection.xs (limited to 'www/mod_perl') diff --git a/www/mod_perl/Makefile b/www/mod_perl/Makefile index e88fb95ad830..0d196c266410 100644 --- a/www/mod_perl/Makefile +++ b/www/mod_perl/Makefile @@ -40,6 +40,10 @@ MAN3= Apache.3 Apache::Constants.3 Apache::ExtUtils.3 \ mod_perl_cvs.3 mod_perl_method_handlers.3 mod_perl_traps.3 \ mod_perl_tuning.3 +.if defined(WITH_APACHE_IPV6) && ${APACHE_PORT:Mipv6} +CFLAGS+= -DAPACHE6 +.endif + .include post-install: diff --git a/www/mod_perl/files/patch-Makefile.PL b/www/mod_perl/files/patch-Makefile.PL new file mode 100644 index 000000000000..b8df70a4f89d --- /dev/null +++ b/www/mod_perl/files/patch-Makefile.PL @@ -0,0 +1,15 @@ +--- Makefile.PL.orig Thu Feb 15 12:39:35 2001 ++++ Makefile.PL Thu Feb 15 12:41:28 2001 +@@ -1300,7 +1300,11 @@ + my $string = $self->MM::install; + my $add = ""; + if($USE_APXS) { +- $add = "apxs_install"; ++# XXX The FreeBSD port for mod_perl takes care of installing libperl.so ++# itself via the pkg-install script. ++# ++# $add = "apxs_install"; ++ print "Disabling apxs_install target; deferred to pkg-install\n"; + } + elsif ($win32_auto and $win32_args{INSTALL_DLL}) { + $add = 'amp_install'; diff --git a/www/mod_perl/files/patch-aa b/www/mod_perl/files/patch-aa deleted file mode 100644 index b8df70a4f89d..000000000000 --- a/www/mod_perl/files/patch-aa +++ /dev/null @@ -1,15 +0,0 @@ ---- Makefile.PL.orig Thu Feb 15 12:39:35 2001 -+++ Makefile.PL Thu Feb 15 12:41:28 2001 -@@ -1300,7 +1300,11 @@ - my $string = $self->MM::install; - my $add = ""; - if($USE_APXS) { -- $add = "apxs_install"; -+# XXX The FreeBSD port for mod_perl takes care of installing libperl.so -+# itself via the pkg-install script. -+# -+# $add = "apxs_install"; -+ print "Disabling apxs_install target; deferred to pkg-install\n"; - } - elsif ($win32_auto and $win32_args{INSTALL_DLL}) { - $add = 'amp_install'; diff --git a/www/mod_perl/files/patch-src:modules:perl:Connection.xs b/www/mod_perl/files/patch-src:modules:perl:Connection.xs new file mode 100644 index 000000000000..22eea28838da --- /dev/null +++ b/www/mod_perl/files/patch-src:modules:perl:Connection.xs @@ -0,0 +1,39 @@ +--- src/modules/perl/Connection.xs.orig Fri Nov 23 06:19:44 2001 ++++ src/modules/perl/Connection.xs Fri Nov 23 10:29:44 2001 +@@ -78,7 +78,11 @@ + RETVAL = newSVpv((char *)&conn->remote_addr, + sizeof conn->remote_addr); + if(sv_addr) { ++#ifdef APACHE6 ++ struct sockaddr_storage addr; ++#else + struct sockaddr_in addr; ++#endif + STRLEN sockaddrlen; + char * new_addr = SvPV(sv_addr,sockaddrlen); + if (sockaddrlen != sizeof(addr)) { +@@ -106,7 +110,26 @@ + #else + conn->remote_ip = pstrdup(conn->pool, (char *)SvPV(ST(1),na)); + #endif ++#ifdef APACHE6 ++ { ++ struct addrinfo hints, *res0; ++ int error; ++ ++ memset(&hints, 0, sizeof(hints)); ++ hints.ai_family = PF_UNSPEC; ++ hints.ai_flags = AI_NUMERICHOST; ++ error = getaddrinfo(conn->remote_ip, NULL, &hints, &res0); ++ if (!error) { ++ memcpy(&conn->remote_addr, res0->ai_addr, res0->ai_addrlen); ++ freeaddrinfo(res0); ++ } else { ++ croak("Bad ip address in remote_ip getaddrinfo failed %s", ++ gai_strerror(error)); ++ } ++ } ++#else + conn->remote_addr.sin_addr.s_addr = inet_addr(conn->remote_ip); ++#endif + } -- cgit v1.2.3