Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 Jul 2003 13:37:12 +0100 (BST)
From:      Dominic Mitchell <dom@happygiraffe.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/54635: make www/p5-Apache-MP3 work with apache2
Message-ID:  <20030719123712.14E4D5C79@happygiraffe.net>
Resent-Message-ID: <200307191240.h6JCeBAo016799@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         54635
>Category:       ports
>Synopsis:       make www/p5-Apache-MP3 work with apache2
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jul 19 05:40:10 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator:     Dominic Mitchell
>Release:        FreeBSD 5.1-CURRENT i386
>Organization:
>Environment:
System: FreeBSD ppe.happygiraffe.net 5.1-CURRENT FreeBSD 5.1-CURRENT #1: Fri Jul 4 17:38:19 BST 2003 root@ppe.happygiraffe.net:/usr/obj/usr/src/sys/PPE i386

	mod_perl2 (1.99_09)
	apache 2.0.47
	perl 5.8.0

>Description:

	This update applies patches to Apache::MP3 to make it work under
	mod_perl2 / apache2.
	
>How-To-Repeat:
	n/a
>Fix:

	Here's the patch.  Beware that it creates the "files" directory
	and puts a new patch in it.

diff -urN /usr/ports/www/p5-Apache-MP3/Makefile p5-Apache-MP3/Makefile
--- /usr/ports/www/p5-Apache-MP3/Makefile	Fri Jun  6 00:47:47 2003
+++ p5-Apache-MP3/Makefile	Sat Jul 19 13:34:38 2003
@@ -7,6 +7,7 @@
 
 PORTNAME=	Apache-MP3
 PORTVERSION=	3.04
+PORTREVISION=	1
 CATEGORIES=	www audio perl5
 MASTER_SITES=	${MASTER_SITE_PERL_CPAN}
 MASTER_SITE_SUBDIR=Apache
@@ -15,8 +16,7 @@
 MAINTAINER=	dom@happygiraffe.net
 COMMENT=	MP3 browsing and streaming under mod_perl and Apache
 
-BUILD_DEPENDS=	${SITE_PERL}/${PERL_ARCH}/mod_perl.pm:${PORTSDIR}/www/mod_perl \
-		${SITE_PERL}/Audio/Wav.pm:${PORTSDIR}/audio/p5-Audio-Wav \
+BUILD_DEPENDS=	${SITE_PERL}/Audio/Wav.pm:${PORTSDIR}/audio/p5-Audio-Wav \
 		${SITE_PERL}/MPEG/MP3Info.pm:${PORTSDIR}/audio/p5-MP3-Info \
 		${SITE_PERL}/${PERL_ARCH}/Ogg/Vorbis.pm:${PORTSDIR}/audio/p5-libvorbis
 
@@ -42,6 +42,15 @@
 .if ${PERL_LEVEL} < 500800
 BUILD_DEPENDS+=	${SITE_PERL}/Locale/Maketext.pm:${PORTSDIR}/devel/p5-Locale-Maketext
 RUN_DEPENDS+=	${SITE_PERL}/Locale/Maketext.pm:${PORTSDIR}/devel/p5-Locale-Maketext
+.endif
+
+.if defined(WITH_APACHE2)
+BUILD_DEPENDS+=	${SITE_PERL}/${PERL_ARCH}/Apache2/mod_perl.pm:${PORTSDIR}/www/mod_perl2
+RUN_DEPENDS+=	${SITE_PERL}/${PERL_ARCH}/Apache2/mod_perl.pm:${PORTSDIR}/www/mod_perl2
+EXTRA_PATCHES=	${PATCHDIR}/mod_perl2.patch
+.else
+BUILD_DEPENDS+=	${SITE_PERL}/${PERL_ARCH}/mod_perl.pm:${PORTSDIR}/www/mod_perl
+RUN_DEPENDS+=	${SITE_PERL}/${PERL_ARCH}/mod_perl.pm:${PORTSDIR}/www/mod_perl
 .endif
 
 .include <bsd.port.post.mk>
diff -urN /usr/ports/www/p5-Apache-MP3/files/mod_perl2.patch p5-Apache-MP3/files/mod_perl2.patch
--- /usr/ports/www/p5-Apache-MP3/files/mod_perl2.patch	Thu Jan  1 01:00:00 1970
+++ p5-Apache-MP3/files/mod_perl2.patch	Sat Jul 19 13:21:58 2003
@@ -0,0 +1,52 @@
+--- MP3.pm.orig	Sat Feb 15 00:47:48 2003
++++ MP3.pm	Sat Jul 19 13:21:56 2003
+@@ -9,7 +9,7 @@
+ }
+ 
+ use Apache;
+-use Apache::Constants qw(:common REDIRECT HTTP_NO_CONTENT DIR_MAGIC_TYPE HTTP_NOT_MODIFIED);
++use Apache::Constants qw(:common REDIRECT HTTP_NO_CONTENT HTTP_NOT_MODIFIED);
+ use Apache::MP3::L10N;
+ use IO::File;
+ use Socket 'sockaddr_in';
+@@ -25,6 +25,8 @@
+ 
+ use constant DEBUG => 0;
+ 
++use constant DIR_MAGIC_TYPE => 'httpd/unix-directory';
++
+ # defaults:
+ use constant BASE_DIR     => '/apache_mp3';
+ use constant STYLESHEET   => 'apache_mp3.css';
+@@ -75,7 +77,7 @@
+ }
+ END
+ 
+-sub handler ($$) {
++sub handler : method {
+   my $class = shift;
+   my $obj = $class->new(@_) or die "Can't create object: $!";
+   return $obj->run();
+@@ -395,14 +397,14 @@
+   my $self = shift;
+   my $dir = shift;
+ 
+-  unless ($self->r->path_info){
+-    #Issue an external redirect if the dir isn't tailed with a '/'
+-    my $uri = $self->r->uri;
+-    my $query = $self->r->args;
+-    $query = "?" . $query if defined $query;
+-    $self->r->header_out(Location => "$uri/$query");
+-    return REDIRECT;
+-  }
++# unless ($self->r->path_info){
++#   #Issue an external redirect if the dir isn't tailed with a '/'
++#   my $uri = $self->r->uri;
++#   my $query = $self->r->args;
++#   $query = "?" . $query if defined $query;
++#   $self->r->header_out(Location => "$uri/$query");
++#   return REDIRECT;
++# }
+ 
+   return $self->list_directory($dir);
+ }
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030719123712.14E4D5C79>