Make Apache::MP3 work under apache2 and mod_perl2.

PR:		54635
Submitted by:	Dominic Mitchell <dom@happygiraffe.net>
This commit is contained in:
Christian Weisgerber 2003-07-23 23:57:52 +00:00
parent b85aa01a83
commit 641d5ad108
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=85497
2 changed files with 63 additions and 2 deletions

View File

@ -7,6 +7,7 @@
PORTNAME= Apache-MP3 PORTNAME= Apache-MP3
PORTVERSION= 3.04 PORTVERSION= 3.04
PORTREVISION= 1
CATEGORIES= www audio perl5 CATEGORIES= www audio perl5
MASTER_SITES= ${MASTER_SITE_PERL_CPAN} MASTER_SITES= ${MASTER_SITE_PERL_CPAN}
MASTER_SITE_SUBDIR=Apache MASTER_SITE_SUBDIR=Apache
@ -15,8 +16,7 @@ PKGNAMEPREFIX= p5-
MAINTAINER= dom@happygiraffe.net MAINTAINER= dom@happygiraffe.net
COMMENT= MP3 browsing and streaming under mod_perl and Apache COMMENT= MP3 browsing and streaming under mod_perl and Apache
BUILD_DEPENDS= ${SITE_PERL}/${PERL_ARCH}/mod_perl.pm:${PORTSDIR}/www/mod_perl \ BUILD_DEPENDS= ${SITE_PERL}/Audio/Wav.pm:${PORTSDIR}/audio/p5-Audio-Wav \
${SITE_PERL}/Audio/Wav.pm:${PORTSDIR}/audio/p5-Audio-Wav \
${SITE_PERL}/MPEG/MP3Info.pm:${PORTSDIR}/audio/p5-MP3-Info \ ${SITE_PERL}/MPEG/MP3Info.pm:${PORTSDIR}/audio/p5-MP3-Info \
${SITE_PERL}/${PERL_ARCH}/Ogg/Vorbis.pm:${PORTSDIR}/audio/p5-libvorbis ${SITE_PERL}/${PERL_ARCH}/Ogg/Vorbis.pm:${PORTSDIR}/audio/p5-libvorbis
@ -44,4 +44,13 @@ BUILD_DEPENDS+= ${SITE_PERL}/Locale/Maketext.pm:${PORTSDIR}/devel/p5-Locale-Make
RUN_DEPENDS+= ${SITE_PERL}/Locale/Maketext.pm:${PORTSDIR}/devel/p5-Locale-Maketext RUN_DEPENDS+= ${SITE_PERL}/Locale/Maketext.pm:${PORTSDIR}/devel/p5-Locale-Maketext
.endif .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> .include <bsd.port.post.mk>

View File

@ -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);
}