Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tag: libwww-perl/5.…
Fetching contributors…

Cannot retrieve contributors at this time

159 lines (135 sloc) 4.01 kB
# This -*- perl -*- script writes the Makefile for libwww-perl
# $Id: Makefile.PL,v 1.23 1996/03/12 14:41:35 aas Exp $
#--- Configuration section ---
@programs_to_install = qw(lwp-request lwp-mirror);
@request_aliases = qw(GET HEAD POST);
#--- End Configuration - You should not have to change anything below this line
require 5.002; # LWP needs this perl version
# Allow us to suppress of all program installation with the -l (library only)
# option. This is for those that don't want to mess with this file.
use Getopt::Std;
$opt_n = undef; # avoid -w typo waring
unless (getopts("n")) {
die "Usage: $0 [-n]\n";
}
@programs_to_install = () if $opt_n;
# Find the perl executable
$PERL = find_perl(5.002, [ $^X, "perl", "perl5", "perl$]" ],
[split ":", $ENV{PATH}], 0);
$NAME = 'libwww-perl';
$VERSION = '5b10';
# Write findings to a file so that other .PL files can read them.
open(OUT, ">myConfig.out") or die "Can't open myConfig.out: $!";
print OUT <<"EOT";
# This file was generated by MakeFile.PL
\$PERL = "$PERL";
\$NAME = "$NAME";
\$VERSION = "$VERSION";
1;
EOT
close(OUT);
# Check for Net::FTP library
$| = 1;
print "Checking for Net::FTP...";
eval {
require Net::FTP;
Net::FTP->require_version('1.10');
};
if ($@) {
print " failed\n";
print <<EOT;
The libwww-perl library normally use the Net::FTP module when
accessing ftp servers. You would have to install this package or
configure your application to use a proxy server for making ftp
requests work.
$@
EOT
} else {
print " ok\n";
}
print "Checking for MD5 .......";
eval {
require MD5;
};
if ($@) {
print " failed\n";
print <<EOT;
The MD5 library is needed if you want to be able use the experimental
"Digest Access Authentication" scheme. Since very few servers implement
this authentication scheme, you should not worry too much about this.
EOT
} else {
print " ok\n";
}
# Generate Makefile
use ExtUtils::MakeMaker;
WriteMakefile(
NAME => $NAME,
VERSION => $VERSION,
#VERSION_FROM => 'lib/LWP.pm', # Can be enabled when the real thing is out
PL_FILES => {
'bin/lwp-request.PL' => 'bin/lwp-request',
'bin/lwp-mirror.PL' => 'bin/lwp-mirror',
},
EXE_FILES => [ map {"bin/$_"} @programs_to_install ],
'clean' => { FILES => '$(EXE_FILES)' },
'dist' => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
);
# Some code to install programs the way we want
sub MY::postamble {
my @m;
if (@request_aliases && grep($_ eq 'lwp-request', @programs_to_install)) {
push @m, "all ::\n";
push @m, "\t\$(FULLPERL) -e 'use Config; foreach (qw(@request_aliases)) {' \\\n";
push @m, <<'EOT';
-e 'unlink "$(INST_EXE)/$$_";' \
-e 'system("$$Config{\"lns\"} lwp-request $(INST_EXE)/$$_") && die; }'
EOT
}
join "", @m;
}
# What happens when we say 'make test'
sub MY::test {
q(
TEST_VERBOSE=0
test:
$(FULLPERL) -I$(INST_LIB) t/TEST $(TEST_VERBOSE)
);
}
# Point out things that should *not* be installed
sub MY::libscan {
return '' if m:/(RCS|CVS)/:;
return '' if m/~$/;
return '' if m/.pl$/;
$_;
}
# Borrowed from MakeMaker
sub find_perl {
my($ver, $names, $dirs, $trace) = @_;
my($name, $dir);
if ($trace >= 2){
print "Looking for perl $ver by these names: ";
print "@$names, ";
print "in these dirs:";
print "@$dirs";
}
foreach $dir (@$dirs){
next unless defined $dir; # $att{PERL_SRC} may be undefined
foreach $name (@$names){
my $abs;
if ($name =~ m|^/|) {
$abs = $name;
} else {
$abs = "$dir/$name";
}
print "Checking $abs " if ($trace >= 2);
next unless -x "$abs";
print "Executing $abs" if ($trace >= 2);
if (`$abs -e 'require $ver; print "VER_OK\n" ' 2>&1` =~ /VER_OK/) {
print "Using PERL=$abs" if $trace;
return $abs;
}
}
}
die "Unable to find a perl $ver (by these names: @$names, in these dirs: @$dirs)\n";
}
Jump to Line
Something went wrong with that request. Please try again.