CHANGES 0100644 0000000 0000000 00000000211 07651133624 010551 0 ustar root root Version 0.50 April 19, 2003
- First official release
- Stable version
- TODO: centralize holding of information or put with file itself
DirList.pm 0100755 0000000 0000000 00000021637 07651133516 011510 0 ustar root root package Apache::DirList;
use strict;
use Apache::Constants ':common';
use Apache::Constants 'REDIRECT';
use Apache::File;
use vars qw/$VERSION/;
use File::Basename;
require DynaLoader;
$VERSION = '0.50';
sub handler {
my $r=shift;
my $uri=$r->uri;
$uri = ( $uri . "/" ) unless ($uri =~ m/\/$/);
my $path = ($r -> document_root . $uri);
return DECLINED unless (opendir(DIRECTORY, $path));
if (opendir(DIRECTORY, $path)) {
my $hash = make_dir_hash($path);
my $indexing_file = find_indexing_file($hash);
if ($indexing_file =~ /index.html?|index.php/) {
my $redirection_url = $uri . $indexing_file;
my $server_name = $r->get_server_name;
$r->warn("redirecting to http://$server_name$redirection_url");
$r->filename($r->document_root . $redirection_url);
return OK;
} else {
$r->handler("perl-script");
$r->push_handlers(PerlHandler => \&sub_handler);
return OK;
}
}
}
sub sub_handler {
my $r = shift;
my $uri=$r->uri;
$uri = ( $uri . "/" ) unless ($uri =~ m/\/$/);
my $path = ($r -> document_root . $uri);
return OK if $r->header_only;
my $hash = make_dir_hash($path);
my $indexing_file = find_indexing_file($hash);
if ($indexing_file =~ /index.html?|index.php/) {
return;
}
my $fh = new IO::File;
if ($indexing_file =~ m/index.conf/) {
$r->log_error("being sent to object1 => $path");
my $object1 = Class1->new("$path$indexing_file");
my $description_hash = $object1->return_hash_object;
my $final_hash = add_hash_key($hash, $description_hash);
my $table = make_table($final_hash, $uri);
my @a = @$table;
my $tmpfile = "$path" . "decoy.htm";
$fh->open(">$tmpfile") or $r->log_error("couldn't open $path . \"decoy.htm\"");
$fh->print(join('', @a));
my $server_name = $r->get_server_name;
$tmpfile =~ s!/var/www!http://$server_name!g;
$r->warn("redirecting to $tmpfile");
$r->header_out(Location => "$tmpfile");
return REDIRECT;
} else {
my $table = make_table($hash, $uri);
my @a = @$table;
my $tmpfile = "$path" . "decoy.htm";
$fh->open(">$tmpfile") or $r->log_error("couldn't open $tmpfile");
$fh->print(join('', @a));
$tmpfile =~ s!/var/www!http://www.sirfsup.com!g;
$r->warn("redirecting to $tmpfile");
$r->header_out(Location => "$tmpfile");
return REDIRECT;
}
}
sub make_dir_hash {
my $dir = shift;
my %self = ();
if (opendir(DIRECTORY, $dir)) {
opendir(DIRECTORY, $dir);
while ( defined (my $entity = readdir(DIRECTORY)) ) {
if ($entity =~ m/^[\.|\.\.]/) {next;}
$self{$entity} = {};
my $filelocation = join ("/", $dir, $entity);
if (opendir(SUB_DIRECTORY, $filelocation)){
$self{$entity} = {dir => 1};
}
}
}
return \%self;
}
sub find_indexing_file {
my $HoH = shift;
my %hash = %$HoH;
if ( exists ($hash{'index.conf'})) {
return "index.conf";
} elsif (exists ($hash{'index.htm'})) {
return "index.htm";
} elsif (exists ($hash{'index.php'})) {
return "index.php";
} elsif (exists ($hash{'index.html'})) {
return "index.html";
} else {
return;
}
}
sub print_hash {
my $indexer = shift;
my $hash = shift;
my %HoH = %$hash;
print "indexing file is $indexer\n";
for my $entity ( sort keys %HoH) {
print "$entity: ";
for my $role (sort keys %{ $HoH{$entity}}) {
print " $role=$HoH{$entity}{$role} ";
}
print "\n";
}
}
# for debugging
sub print_desc_hash {
my $hash = shift;
my %HoH = %$hash;
print "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
for my $key (sort keys %HoH) {
print "$key => $HoH{$key}\n";
}
}
sub add_hash_key {
my $hash = shift;
my $object1 = shift;
my %deref_hash = %$hash;
my %deref_object1 = %$object1;
for my $file_entity ( sort keys %deref_hash) {
$deref_hash{$file_entity}{'description'} = $deref_object1{$file_entity};
}
return \%deref_hash;
}
sub make_table {
my $hash_ref = shift;
my %hash = %$hash_ref;
my $v_path = shift; # uris come with a preceding slash
my (@cells, $file_name);
push(@cells, qq(
\n));
push(@cells,qq(\n));
push(@cells, qq(directory listing for http://www.sirfsup.com$v_path
filename | description |
|
));
for $file_name (sort keys %hash) {
if (exists ($hash{$file_name}{"dir"})) {
if ($v_path) {
push(@cells, qq(
$file_name | ));
} else {
push(@cells, qq( |
$file_name | ));
}
} else {
if ( $file_name =~ m/decoy.htm/) {}
elsif ( $file_name =~ m/index.conf/) {}
elsif( $file_name =~ m/template.htm/) {}
else {
if ($v_path) {
push(@cells, qq( |
$file_name | \n));
} else {
push(@cells, qq( |
$file_name | \n));
}
if (exists ($hash{$file_name}{'description'})) {
push(@cells, qq($hash{$file_name}{description} |
\n));
} else {
push(@cells, qq(\n));
}
push(@cells, qw());
} }
}
push(@cells, qq(
));
return \@cells;
}
1;
# adapted from the eagle book
package Class1;
use IO::File;
use File::Basename;
sub new {
shift;
my $file = shift;
my @directory_listing;
my $fh = new IO::File;
$fh->open("<$file") or die "Cannot open $file";
while (<$fh>) {
chomp;
s/^\s+//; s/\s+$//; #fold leading and trailing white spaces
if (/^#/ || /^$/) { #skip comments and empty lines
}
if (m/.*/) {
push(@directory_listing,$_ );
}
}
my @loop_array = @directory_listing;
my (%self);
for (my $i=0;$i<=$#directory_listing;$i++) {
my $line = shift(@loop_array);
my($url, $label) = split /=/, $line, 2;
$self{$url} = $label;
}
return bless{'hash'=>\%self};
}
sub return_hash_object {return $_[0]->{'hash'};}
1;
__END__
=head1 NAME
B - Apache mod_perl PerlHandler for displaying a description with all files using a simple "index.conf" file in the same directory for which you wish to provide a listing.
=head1 SYNOPSIS
You must be using mod_perl and Apache-1.3.x.
For the correct work your apache configuration would contain the following PerlTransHandler directive look like these:
# in httpd.conf (or any other apache configuration file)
PerlTransHandler Apache::FileOrganizer
It is possible to nest that inside a virtual host directive, so the virtual sites will not be affected by it.
You should also not install the c code for it's mod_dir module, as they are contradictory, I don't know what would happen there.
=head1 DESCRIPTION
This is a PerlTransHandler module, so you will not need to chain it to provide headers and footers.
This has not been ported to Apache2.
This will not be ported in fact. OpenInteract provides more functionality in the behind-the-scenes area, and I plan instead of working on packages for that distribution. The fault of this code is its inability to move the description when you move the file to another directory. With the OpenInteract code, it will be possible to use the database to store urls which invoke handlers, etc.
A sample "index.conf" is like this:
createdb.txt=results of asuccessful installation to stdout
installed_pkgs.txt=results of oi_manage install_packages command
openinteract.htm=details installation of openinteract
Fruit.pm=the sample handler after cutting out comments
there is no space between createdb.txt and the first letter of the file. The syntax of this file is to put the filename on the left and the description on the right, followed by an equals sign. Output in browser will look like mod_dir.c's but it will contain the right-side in the description column of the directory listing.
The index will ignore files named decoy.htm, index.conf, and template.htm. YOu can add your files in that same spot if you want them to be "invisible." Possible additions are anything with a .conf ending.
The directory listing is output to the disk, so to use the handler the web server will need write permissions on that directory.
=head1 CONFIGURATION DIRECTIVES
none
=head1 SEE ALSO
perl(1), mod_perl(3), Apache(3)
=head1 THANKS
Roman Kosenko for a module submission template.
The eagle book for its 'class1' code used in the file.
Chris Winters for writing clean(er) code.
=head1 AUTHOR
Joseph Speigle
=head2 Contact info
E-mail: joe@jklh.us
Home page: http://www.sirfsup.com
=head2 Copyright
Copyright (c) 2003 Joseph Speigle
All rights reserved. This package is free software;
you can redistribute it and/or modify it under the same
terms as Perl itself.
MANIFEST 0100644 0000000 0000000 00000000050 07651133650 010707 0 ustar root root CHANGES
MANIFEST
Makefile.PL
DirList.pm
Makefile 0100644 0000000 0000000 00000043334 07651133662 011235 0 ustar root root # This Makefile is for the Apache::DirList extension to perl.
#
# It was generated automatically by MakeMaker version
# 6.03 (Revision: 1.63) from the contents of
# Makefile.PL. Don't edit this file, edit Makefile.PL instead.
#
# ANY CHANGES MADE HERE WILL BE LOST!
#
# MakeMaker ARGV: ()
#
# MakeMaker Parameters:
# NAME => q[Apache::DirList]
# VERSION_FROM => q[DirList.pm]
# --- MakeMaker post_initialize section:
# --- MakeMaker const_config section:
# These definitions are from config.sh (via /usr/lib/perl5/5.8.0/athlon-linux-thread-multi/Config.pm)
# They may have been overridden via Makefile.PL or on the command line
AR = ar
CC = gcc
CCCDLFLAGS = -fpic
CCDLFLAGS = -rdynamic -Wl,-rpath,/usr/lib/perl5/5.8.0/athlon-linux-thread-multi/CORE
DLEXT = so
DLSRC = dl_dlopen.xs
LD = gcc
LDDLFLAGS = -shared -L/usr/local/lib
LDFLAGS = -L/usr/local/lib
LIBC = /lib/libc-2.2.93.so
LIB_EXT = .a
OBJ_EXT = .o
OSNAME = linux
OSVERS = 2.4.18-14
RANLIB = :
SO = so
EXE_EXT =
FULL_AR = /usr/bin/ar
# --- MakeMaker constants section:
AR_STATIC_ARGS = cr
NAME = Apache::DirList
DISTNAME = Apache-DirList
NAME_SYM = Apache_DirList
VERSION = 0.50
VERSION_SYM = 0_50
XS_VERSION = 0.50
INST_ARCHLIB = blib/arch
INST_SCRIPT = blib/script
INST_BIN = blib/bin
INST_LIB = blib/lib
INSTALLDIRS = site
PREFIX = /usr
SITEPREFIX = /usr
VENDORPREFIX = /usr
INSTALLPRIVLIB = /usr/lib/perl5/5.8.0
INSTALLSITELIB = /usr/lib/perl5/site_perl/5.8.0
INSTALLVENDORLIB = /usr/lib/perl5/vendor_perl/5.8.0
INSTALLARCHLIB = /usr/lib/perl5/5.8.0/athlon-linux-thread-multi
INSTALLSITEARCH = /usr/lib/perl5/site_perl/5.8.0/athlon-linux-thread-multi
INSTALLVENDORARCH = /usr/lib/perl5/vendor_perl/5.8.0/athlon-linux-thread-multi
INSTALLBIN = /usr/bin
INSTALLSITEBIN = /usr/bin
INSTALLVENDORBIN = /usr/bin
INSTALLSCRIPT = /usr/bin
PERL_LIB = /usr/lib/perl5/5.8.0
PERL_ARCHLIB = /usr/lib/perl5/5.8.0/athlon-linux-thread-multi
SITELIBEXP = /usr/lib/perl5/site_perl/5.8.0
SITEARCHEXP = /usr/lib/perl5/site_perl/5.8.0/athlon-linux-thread-multi
LIBPERL_A = libperl.a
FIRST_MAKEFILE = Makefile
MAKE_APERL_FILE = Makefile.aperl
PERLMAINCC = $(CC)
PERL_INC = /usr/lib/perl5/5.8.0/athlon-linux-thread-multi/CORE
PERL = /usr/bin/perl
FULLPERL = /usr/bin/perl
PERLRUN = $(PERL)
FULLPERLRUN = $(FULLPERL)
PERLRUNINST = $(PERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)"
FULLPERLRUNINST = $(FULLPERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)"
ABSPERL = $(PERL)
ABSPERLRUN = $(ABSPERL)
ABSPERLRUNINST = $(ABSPERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)"
FULL_AR = /usr/bin/ar
PERL_CORE = 0
NOOP = $(SHELL) -c true
NOECHO = @
VERSION_MACRO = VERSION
DEFINE_VERSION = -D$(VERSION_MACRO)=\"$(VERSION)\"
XS_VERSION_MACRO = XS_VERSION
XS_DEFINE_VERSION = -D$(XS_VERSION_MACRO)=\"$(XS_VERSION)\"
PERL_MALLOC_DEF = -DPERL_EXTMALLOC_DEF -Dmalloc=Perl_malloc -Dfree=Perl_mfree -Drealloc=Perl_realloc -Dcalloc=Perl_calloc
MAKEMAKER = /usr/lib/perl5/5.8.0/ExtUtils/MakeMaker.pm
MM_VERSION = 6.03
# FULLEXT = Pathname for extension directory (eg Foo/Bar/Oracle).
# BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT. (eg Oracle)
# PARENT_NAME = NAME without BASEEXT and no trailing :: (eg Foo::Bar)
# DLBASE = Basename part of dynamic library. May be just equal BASEEXT.
FULLEXT = Apache/DirList
BASEEXT = DirList
PARENT_NAME = Apache
DLBASE = $(BASEEXT)
VERSION_FROM = DirList.pm
OBJECT =
LDFROM = $(OBJECT)
LINKTYPE = dynamic
# Handy lists of source code files:
XS_FILES=
C_FILES =
O_FILES =
H_FILES =
MAN1PODS =
MAN3PODS = DirList.pm
INST_MAN1DIR = blib/man1
MAN1EXT = 1
INSTALLMAN1DIR = /usr/share/man/man1
INSTALLSITEMAN1DIR = /usr/share/man/man1
INSTALLVENDORMAN1DIR = /usr/share/man/man1
INST_MAN3DIR = blib/man3
MAN3EXT = 3pm
INSTALLMAN3DIR = /usr/share/man/man3
INSTALLSITEMAN3DIR = /usr/share/man/man3
INSTALLVENDORMAN3DIR = /usr/share/man/man3
PERM_RW = 644
PERM_RWX = 755
# work around a famous dec-osf make(1) feature(?):
makemakerdflt: all
.SUFFIXES: .xs .c .C .cpp .i .s .cxx .cc $(OBJ_EXT)
# Nick wanted to get rid of .PRECIOUS. I don't remember why. I seem to recall, that
# some make implementations will delete the Makefile when we rebuild it. Because
# we call false(1) when we rebuild it. So make(1) is not completely wrong when it
# does so. Our milage may vary.
# .PRECIOUS: Makefile # seems to be not necessary anymore
.PHONY: all config static dynamic test linkext manifest
# Where is the Config information that we are using/depend on
CONFIGDEP = $(PERL_ARCHLIB)/Config.pm $(PERL_INC)/config.h
# Where to put things:
INST_LIBDIR = $(INST_LIB)/Apache
INST_ARCHLIBDIR = $(INST_ARCHLIB)/Apache
INST_AUTODIR = $(INST_LIB)/auto/$(FULLEXT)
INST_ARCHAUTODIR = $(INST_ARCHLIB)/auto/$(FULLEXT)
INST_STATIC =
INST_DYNAMIC =
INST_BOOT =
EXPORT_LIST =
PERL_ARCHIVE =
PERL_ARCHIVE_AFTER =
TO_INST_PM = DirList.pm
PM_TO_BLIB = DirList.pm \
blib/lib/Apache/DirList.pm
# --- MakeMaker tool_autosplit section:
# Usage: $(AUTOSPLITFILE) FileToSplit AutoDirToSplitInto
AUTOSPLITFILE = $(PERLRUN) -e 'use AutoSplit; autosplit($$ARGV[0], $$ARGV[1], 0, 1, 1) ;'
# --- MakeMaker tool_xsubpp section:
# --- MakeMaker tools_other section:
SHELL = /bin/sh
CHMOD = chmod
CP = cp
LD = gcc
MV = mv
NOOP = $(SHELL) -c true
RM_F = rm -f
RM_RF = rm -rf
TEST_F = test -f
TOUCH = touch
UMASK_NULL = umask 0
DEV_NULL = > /dev/null 2>&1
# The following is a portable way to say mkdir -p
# To see which directories are created, change the if 0 to if 1
MKPATH = $(PERLRUN) "-MExtUtils::Command" -e mkpath
# This helps us to minimize the effect of the .exists files A yet
# better solution would be to have a stable file in the perl
# distribution with a timestamp of zero. But this solution doesn't
# need any changes to the core distribution and works with older perls
EQUALIZE_TIMESTAMP = $(PERLRUN) "-MExtUtils::Command" -e eqtime
# Here we warn users that an old packlist file was found somewhere,
# and that they should call some uninstall routine
WARN_IF_OLD_PACKLIST = $(PERL) -we 'exit unless -f $$ARGV[0];' \
-e 'print "WARNING: I have found an old package in\n";' \
-e 'print "\t$$ARGV[0].\n";' \
-e 'print "Please make sure the two installations are not conflicting\n";'
UNINST=0
VERBINST=0
MOD_INSTALL = $(PERL) "-I$(INST_LIB)" "-I$(PERL_LIB)" "-MExtUtils::Install" \
-e "install({@ARGV},'$(VERBINST)',0,'$(UNINST)');"
DOC_INSTALL = $(PERL) -e '$$\="\n\n";' \
-e 'print "=head2 ", scalar(localtime), ": C<", shift, ">", " L<", $$arg=shift, "|", $$arg, ">";' \
-e 'print "=over 4";' \
-e 'while (defined($$key = shift) and defined($$val = shift)){print "=item *";print "C<$$key: $$val>";}' \
-e 'print "=back";'
UNINSTALL = $(PERLRUN) "-MExtUtils::Install" \
-e 'uninstall($$ARGV[0],1,1); print "\nUninstall is deprecated. Please check the";' \
-e 'print " packlist above carefully.\n There may be errors. Remove the";' \
-e 'print " appropriate files manually.\n Sorry for the inconveniences.\n"'
# --- MakeMaker dist section:
ZIPFLAGS = -r
TO_UNIX = @$(NOOP)
TAR = tar
POSTOP = @$(NOOP)
ZIP = zip
DIST_DEFAULT = tardist
CI = ci -u
SHAR = shar
COMPRESS = gzip --best
DIST_CP = best
PREOP = @$(NOOP)
TARFLAGS = cvf
DISTVNAME = $(DISTNAME)-$(VERSION)
SUFFIX = .gz
RCS_LABEL = rcs -Nv$(VERSION_SYM): -q
# --- MakeMaker macro section:
# --- MakeMaker depend section:
# --- MakeMaker cflags section:
# --- MakeMaker const_loadlibs section:
# --- MakeMaker const_cccmd section:
# --- MakeMaker post_constants section:
# --- MakeMaker pasthru section:
PASTHRU = LIB="$(LIB)"\
LIBPERL_A="$(LIBPERL_A)"\
LINKTYPE="$(LINKTYPE)"\
PREFIX="$(PREFIX)"\
OPTIMIZE="$(OPTIMIZE)"\
PASTHRU_DEFINE="$(PASTHRU_DEFINE)"\
PASTHRU_INC="$(PASTHRU_INC)"
# --- MakeMaker c_o section:
# --- MakeMaker xs_c section:
# --- MakeMaker xs_o section:
# --- MakeMaker top_targets section:
all :: pure_all manifypods
@$(NOOP)
pure_all :: config pm_to_blib subdirs linkext
@$(NOOP)
subdirs :: $(MYEXTLIB)
@$(NOOP)
config :: Makefile $(INST_LIBDIR)/.exists
@$(NOOP)
config :: $(INST_ARCHAUTODIR)/.exists
@$(NOOP)
config :: $(INST_AUTODIR)/.exists
@$(NOOP)
$(INST_AUTODIR)/.exists :: /usr/lib/perl5/5.8.0/athlon-linux-thread-multi/CORE/perl.h
@$(MKPATH) $(INST_AUTODIR)
@$(EQUALIZE_TIMESTAMP) /usr/lib/perl5/5.8.0/athlon-linux-thread-multi/CORE/perl.h $(INST_AUTODIR)/.exists
-@$(CHMOD) $(PERM_RWX) $(INST_AUTODIR)
$(INST_LIBDIR)/.exists :: /usr/lib/perl5/5.8.0/athlon-linux-thread-multi/CORE/perl.h
@$(MKPATH) $(INST_LIBDIR)
@$(EQUALIZE_TIMESTAMP) /usr/lib/perl5/5.8.0/athlon-linux-thread-multi/CORE/perl.h $(INST_LIBDIR)/.exists
-@$(CHMOD) $(PERM_RWX) $(INST_LIBDIR)
$(INST_ARCHAUTODIR)/.exists :: /usr/lib/perl5/5.8.0/athlon-linux-thread-multi/CORE/perl.h
@$(MKPATH) $(INST_ARCHAUTODIR)
@$(EQUALIZE_TIMESTAMP) /usr/lib/perl5/5.8.0/athlon-linux-thread-multi/CORE/perl.h $(INST_ARCHAUTODIR)/.exists
-@$(CHMOD) $(PERM_RWX) $(INST_ARCHAUTODIR)
config :: $(INST_MAN3DIR)/.exists
@$(NOOP)
$(INST_MAN3DIR)/.exists :: /usr/lib/perl5/5.8.0/athlon-linux-thread-multi/CORE/perl.h
@$(MKPATH) $(INST_MAN3DIR)
@$(EQUALIZE_TIMESTAMP) /usr/lib/perl5/5.8.0/athlon-linux-thread-multi/CORE/perl.h $(INST_MAN3DIR)/.exists
-@$(CHMOD) $(PERM_RWX) $(INST_MAN3DIR)
help:
perldoc ExtUtils::MakeMaker
# --- MakeMaker linkext section:
linkext :: $(LINKTYPE)
@$(NOOP)
# --- MakeMaker dlsyms section:
# --- MakeMaker dynamic section:
## $(INST_PM) has been moved to the all: target.
## It remains here for awhile to allow for old usage: "make dynamic"
#dynamic :: Makefile $(INST_DYNAMIC) $(INST_BOOT) $(INST_PM)
dynamic :: Makefile $(INST_DYNAMIC) $(INST_BOOT)
@$(NOOP)
# --- MakeMaker dynamic_bs section:
BOOTSTRAP =
# --- MakeMaker dynamic_lib section:
# --- MakeMaker static section:
## $(INST_PM) has been moved to the all: target.
## It remains here for awhile to allow for old usage: "make static"
#static :: Makefile $(INST_STATIC) $(INST_PM)
static :: Makefile $(INST_STATIC)
@$(NOOP)
# --- MakeMaker static_lib section:
# --- MakeMaker manifypods section:
POD2MAN_EXE = /usr/bin/pod2man
POD2MAN = $(PERL) -we '%m=@ARGV;for (keys %m){' \
-e 'next if -e $$m{$$_} && -M $$m{$$_} < -M $$_ && -M $$m{$$_} < -M "Makefile";' \
-e 'print "Manifying $$m{$$_}\n";' \
-e 'system(q[$(PERLRUN) $(POD2MAN_EXE) ].qq[$$_>$$m{$$_}])==0 or warn "Couldn\047t install $$m{$$_}\n";' \
-e 'chmod(oct($(PERM_RW)), $$m{$$_}) or warn "chmod $(PERM_RW) $$m{$$_}: $$!\n";}'
manifypods : pure_all DirList.pm
@$(POD2MAN) \
DirList.pm \
$(INST_MAN3DIR)/Apache::DirList.$(MAN3EXT)
# --- MakeMaker processPL section:
# --- MakeMaker installbin section:
# --- MakeMaker subdirs section:
# none
# --- MakeMaker clean section:
# Delete temporary files but do not touch installed files. We don't delete
# the Makefile here so a later make realclean still has a makefile to use.
clean ::
-rm -rf ./blib $(MAKE_APERL_FILE) $(INST_ARCHAUTODIR)/extralibs.all perlmain.c tmon.out mon.out so_locations pm_to_blib *$(OBJ_EXT) *$(LIB_EXT) perl.exe perl perl$(EXE_EXT) $(BOOTSTRAP) $(BASEEXT).bso $(BASEEXT).def lib$(BASEEXT).def $(BASEEXT).exp $(BASEEXT).x core core.*perl.*.? *perl.core
-mv Makefile Makefile.old $(DEV_NULL)
# --- MakeMaker realclean section:
# Delete temporary files (via clean) and also delete installed files
realclean purge :: clean
rm -rf $(INST_AUTODIR) $(INST_ARCHAUTODIR)
rm -rf $(DISTVNAME)
rm -f blib/lib/Apache/DirList.pm
rm -rf Makefile Makefile.old
# --- MakeMaker dist_basics section:
distclean :: realclean distcheck
$(NOECHO) $(NOOP)
distcheck :
$(PERLRUN) "-MExtUtils::Manifest=fullcheck" -e fullcheck
skipcheck :
$(PERLRUN) "-MExtUtils::Manifest=skipcheck" -e skipcheck
manifest :
$(PERLRUN) "-MExtUtils::Manifest=mkmanifest" -e mkmanifest
veryclean : realclean
$(RM_F) *~ *.orig */*~ */*.orig
# --- MakeMaker dist_core section:
dist : $(DIST_DEFAULT)
@$(PERL) -le 'print "Warning: Makefile possibly out of date with $$vf" if ' \
-e '-e ($$vf="$(VERSION_FROM)") and -M $$vf < -M "Makefile";'
tardist : $(DISTVNAME).tar$(SUFFIX)
zipdist : $(DISTVNAME).zip
$(DISTVNAME).tar$(SUFFIX) : distdir
$(PREOP)
$(TO_UNIX)
$(TAR) $(TARFLAGS) $(DISTVNAME).tar $(DISTVNAME)
$(RM_RF) $(DISTVNAME)
$(COMPRESS) $(DISTVNAME).tar
$(POSTOP)
$(DISTVNAME).zip : distdir
$(PREOP)
$(ZIP) $(ZIPFLAGS) $(DISTVNAME).zip $(DISTVNAME)
$(RM_RF) $(DISTVNAME)
$(POSTOP)
uutardist : $(DISTVNAME).tar$(SUFFIX)
uuencode $(DISTVNAME).tar$(SUFFIX) \
$(DISTVNAME).tar$(SUFFIX) > \
$(DISTVNAME).tar$(SUFFIX)_uu
shdist : distdir
$(PREOP)
$(SHAR) $(DISTVNAME) > $(DISTVNAME).shar
$(RM_RF) $(DISTVNAME)
$(POSTOP)
# --- MakeMaker dist_dir section:
distdir :
$(RM_RF) $(DISTVNAME)
$(PERLRUN) "-MExtUtils::Manifest=manicopy,maniread" \
-e "manicopy(maniread(),'$(DISTVNAME)', '$(DIST_CP)');"
# --- MakeMaker dist_test section:
disttest : distdir
cd $(DISTVNAME) && $(ABSPERLRUN) Makefile.PL
cd $(DISTVNAME) && $(MAKE) $(PASTHRU)
cd $(DISTVNAME) && $(MAKE) test $(PASTHRU)
# --- MakeMaker dist_ci section:
ci :
$(PERLRUN) "-MExtUtils::Manifest=maniread" \
-e "@all = keys %{ maniread() };" \
-e 'print("Executing $(CI) @all\n"); system("$(CI) @all");' \
-e 'print("Executing $(RCS_LABEL) ...\n"); system("$(RCS_LABEL) @all");'
# --- MakeMaker install section:
install :: all pure_install doc_install
install_perl :: all pure_perl_install doc_perl_install
install_site :: all pure_site_install doc_site_install
install_vendor :: all pure_vendor_install doc_vendor_install
pure_install :: pure_$(INSTALLDIRS)_install
doc_install :: doc_$(INSTALLDIRS)_install
@echo Appending installation info to $(INSTALLARCHLIB)/perllocal.pod
pure__install : pure_site_install
@echo INSTALLDIRS not defined, defaulting to INSTALLDIRS=site
doc__install : doc_site_install
@echo INSTALLDIRS not defined, defaulting to INSTALLDIRS=site
pure_perl_install ::
@$(MOD_INSTALL) \
read $(PERL_ARCHLIB)/auto/$(FULLEXT)/.packlist \
write $(INSTALLARCHLIB)/auto/$(FULLEXT)/.packlist \
$(INST_LIB) $(INSTALLPRIVLIB) \
$(INST_ARCHLIB) $(INSTALLARCHLIB) \
$(INST_BIN) $(INSTALLBIN) \
$(INST_SCRIPT) $(INSTALLSCRIPT) \
$(INST_MAN1DIR) $(INSTALLMAN1DIR) \
$(INST_MAN3DIR) $(INSTALLMAN3DIR)
@$(WARN_IF_OLD_PACKLIST) \
$(SITEARCHEXP)/auto/$(FULLEXT)
pure_site_install ::
@$(MOD_INSTALL) \
read $(SITEARCHEXP)/auto/$(FULLEXT)/.packlist \
write $(INSTALLSITEARCH)/auto/$(FULLEXT)/.packlist \
$(INST_LIB) $(INSTALLSITELIB) \
$(INST_ARCHLIB) $(INSTALLSITEARCH) \
$(INST_BIN) $(INSTALLSITEBIN) \
$(INST_SCRIPT) $(INSTALLSCRIPT) \
$(INST_MAN1DIR) $(INSTALLSITEMAN1DIR) \
$(INST_MAN3DIR) $(INSTALLSITEMAN3DIR)
@$(WARN_IF_OLD_PACKLIST) \
$(PERL_ARCHLIB)/auto/$(FULLEXT)
pure_vendor_install ::
@$(MOD_INSTALL) \
$(INST_LIB) $(INSTALLVENDORLIB) \
$(INST_ARCHLIB) $(INSTALLVENDORARCH) \
$(INST_BIN) $(INSTALLVENDORBIN) \
$(INST_SCRIPT) $(INSTALLSCRIPT) \
$(INST_MAN1DIR) $(INSTALLVENDORMAN1DIR) \
$(INST_MAN3DIR) $(INSTALLVENDORMAN3DIR)
doc_perl_install ::
-@$(MKPATH) $(INSTALLARCHLIB)
-@$(DOC_INSTALL) \
"Module" "$(NAME)" \
"installed into" "$(INSTALLPRIVLIB)" \
LINKTYPE "$(LINKTYPE)" \
VERSION "$(VERSION)" \
EXE_FILES "$(EXE_FILES)" \
>> $(INSTALLARCHLIB)/perllocal.pod
doc_site_install ::
-@$(MKPATH) $(INSTALLARCHLIB)
-@$(DOC_INSTALL) \
"Module" "$(NAME)" \
"installed into" "$(INSTALLSITELIB)" \
LINKTYPE "$(LINKTYPE)" \
VERSION "$(VERSION)" \
EXE_FILES "$(EXE_FILES)" \
>> $(INSTALLSITEARCH)/perllocal.pod
doc_vendor_install ::
uninstall :: uninstall_from_$(INSTALLDIRS)dirs
uninstall_from_perldirs ::
@$(UNINSTALL) $(PERL_ARCHLIB)/auto/$(FULLEXT)/.packlist
uninstall_from_sitedirs ::
@$(UNINSTALL) $(SITEARCHEXP)/auto/$(FULLEXT)/.packlist
# --- MakeMaker force section:
# Phony target to force checking subdirectories.
FORCE:
@$(NOOP)
# --- MakeMaker perldepend section:
# --- MakeMaker makefile section:
# We take a very conservative approach here, but it\'s worth it.
# We move Makefile to Makefile.old here to avoid gnu make looping.
Makefile : Makefile.PL $(CONFIGDEP)
@echo "Makefile out-of-date with respect to $?"
@echo "Cleaning current config before rebuilding Makefile..."
-@$(RM_F) Makefile.old
-@$(MV) Makefile Makefile.old
-$(MAKE) -f Makefile.old clean $(DEV_NULL) || $(NOOP)
$(PERLRUN) Makefile.PL
@echo "==> Your Makefile has been rebuilt. <=="
@echo "==> Please rerun the make command. <=="
false
# --- MakeMaker staticmake section:
# --- MakeMaker makeaperl section ---
MAP_TARGET = perl
FULLPERL = /usr/bin/perl
$(MAP_TARGET) :: static $(MAKE_APERL_FILE)
$(MAKE) -f $(MAKE_APERL_FILE) $@
$(MAKE_APERL_FILE) : $(FIRST_MAKEFILE)
@echo Writing \"$(MAKE_APERL_FILE)\" for this $(MAP_TARGET)
@$(PERLRUNINST) \
Makefile.PL DIR= \
MAKEFILE=$(MAKE_APERL_FILE) LINKTYPE=static \
MAKEAPERL=1 NORECURS=1 CCCDLFLAGS=
# --- MakeMaker test section:
TEST_VERBOSE=0
TEST_TYPE=test_$(LINKTYPE)
TEST_FILE = test.pl
TEST_FILES =
TESTDB_SW = -d
testdb :: testdb_$(LINKTYPE)
test :: $(TEST_TYPE)
@echo 'No tests defined for $(NAME) extension.'
test_dynamic :: pure_all
testdb_dynamic :: pure_all
PERL_DL_NONLAZY=1 $(FULLPERLRUN) $(TESTDB_SW) "-I$(INST_LIB)" "-I$(INST_ARCHLIB)" $(TEST_FILE)
test_ : test_dynamic
test_static :: test_dynamic
testdb_static :: testdb_dynamic
# --- MakeMaker ppd section:
# Creates a PPD (Perl Package Description) for a binary distribution.
ppd:
@$(PERL) -e "print qq{\n\t$(DISTNAME)\n\t\n\t\n}" > $(DISTNAME).ppd
@$(PERL) -e "print qq{\t\n}" >> $(DISTNAME).ppd
@$(PERL) -e "print qq{\t\t\n\t\t\n\t\t\n\t\n\n}" >> $(DISTNAME).ppd
# --- MakeMaker pm_to_blib section:
pm_to_blib: $(TO_INST_PM)
@$(PERLRUNINST) "-MExtUtils::Install" \
-e "pm_to_blib({qw{DirList.pm blib/lib/Apache/DirList.pm}},'$(INST_LIB)/auto','$(PM_FILTER)')"
@$(TOUCH) $@
# --- MakeMaker selfdocument section:
# --- MakeMaker postamble section:
# End.
Makefile.PL 0100644 0000000 0000000 00000000337 07651133551 011540 0 ustar root root use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
WriteMakefile(
'NAME' => 'Apache::DirList',
'VERSION_FROM' => 'DirList.pm'
);