source: main/trunk/greenstone2/build-src/packages/w3mir/libwww-perl-5.36/Makefile.PL@ 27132

Last change on this file since 27132 was 720, checked in by davidb, 25 years ago

added w3mir package

  • Property svn:keywords set to Author Date Id Revision
File size: 4.1 KB
Line 
1# This -*- perl -*- script writes the Makefile for libwww-perl
2# $Id: Makefile.PL 720 1999-10-19 03:17:57Z davidb $
3
4require 5.004;
5use strict;
6
7#--- Configuration section ---
8
9my @programs_to_install = qw(lwp-request lwp-mirror lwp-rget lwp-download);
10my @request_aliases = qw(GET HEAD POST);
11
12#--- End Configuration - You should not have to change anything below this line
13
14
15# Allow us to suppress all program installation with the -n (library only)
16# option. This is for those that don't want to mess with the configuration
17# section of this file.
18use Getopt::Std;
19use vars qw($opt_n);
20unless (getopts("n")) {
21 die "Usage: $0 [-n]\n";
22}
23@programs_to_install = () if $opt_n;
24
25
26# Check for non-standard modules that are used by this library.
27$| = 1;
28my $missing_modules = 0;
29
30print "Checking for HTML::Parser..";
31eval {
32 require HTML::HeadParser;
33};
34if ($@) {
35 print " failed\n";
36 $missing_modules++;
37 print <<EOT;
38$@
39The HTML::Parser is needed to extract correct <BASE> information from
40HTML so that we can resolv relative links correctly.
41
42EOT
43 sleep(2); # Don't hurry too much
44} else {
45 print " ok\n";
46}
47
48print "Checking for MIME::Base64..";
49eval {
50 require MIME::Base64;
51 #MIME::Base64->require_version('2.00');
52};
53if ($@) {
54 print " failed\n";
55 $missing_modules++;
56 print <<EOT;
57$@
58The Base64 encoding is used in authentication headers in HTTP.
59
60EOT
61 sleep(2); # Don't hurry too much
62} else {
63 print " ok\n";
64}
65
66print "Checking for Net::FTP......";
67eval {
68 require Net::FTP;
69 Net::FTP->require_version('2.00');
70};
71if ($@) {
72 print " failed\n";
73 $missing_modules++;
74 print <<EOT;
75$@
76The libwww-perl library normally use the Net::FTP module when
77accessing ftp servers. You would have to install this package or
78configure your application to use a proxy server for making ftp
79requests work. Net::FTP is part of the 'libnet' distribution.
80
81EOT
82 sleep(2); # Don't hurry too much
83} else {
84 print " ok\n";
85}
86
87print "Checking for MD5 ..........";
88eval {
89 require MD5;
90};
91if ($@) {
92 print " failed\n";
93 $missing_modules++;
94 print <<EOT;
95$@
96The MD5 library is needed if you want to be able use the experimental
97"Digest Access Authentication" scheme. Since very few servers
98implement this authentication scheme, you should normally not worry
99too much about this.
100
101EOT
102} else {
103 print " ok\n";
104}
105
106print <<EOT if $missing_modules;
107The missing modules can be obtained from CPAN. Visit
108<URL:http://www.perl.com/CPAN/> to find a CPAN site near you.
109
110EOT
111
112
113# Ok, now it is time to really generate the Makefile
114use ExtUtils::MakeMaker;
115
116WriteMakefile(
117 NAME => 'libwww-perl',
118 VERSION_FROM => 'lib/LWP.pm',
119 PL_FILES => { map {("bin/$_.PL" => "bin/$_")} @programs_to_install },
120 EXE_FILES => [ map {"bin/$_"} @programs_to_install ],
121 'clean' => { FILES => '$(EXE_FILES)' },
122 'dist' => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
123);
124
125
126
127package MY;
128
129sub postamble
130{
131 my @m;
132 if (@request_aliases && grep($_ eq 'lwp-request', @programs_to_install)) {
133 push @m, "all ::\n";
134 if ($^O eq 'MSWin32') {
135 push @m, "\t\$(FULLPERL) -e \"use Config; chdir q[\$(INST_EXE)]; "
136 ."foreach (qw(@request_aliases)) { \" \\\n";
137 push @m, <<'EOT';
138 -e "unlink \"$$_\"; " \
139 -e "system(\"copy lwp-request $$_\") && die; }"
140EOT
141 } else {
142 push @m, "\t\$(FULLPERL) -e 'use Config; chdir q{\$(INST_EXE)}; "
143 ."foreach (qw(@request_aliases)) {' \\\n";
144 push @m, <<'EOT';
145 -e 'unlink "$$_";' \
146 -e 'system("$$Config{\"lns\"} lwp-request $$_") && die; }'
147EOT
148 }
149 }
150 join "", @m;
151}
152
153# What happens when we say 'make test'
154sub test
155{
156 q(
157TEST_VERBOSE=0
158
159test: all
160 $(FULLPERL) t/TEST $(TEST_VERBOSE)
161
162);
163}
164
165
166# Determine things that should *not* be installed
167sub libscan
168{
169 my($self, $path) = @_;
170 return '' if $path =~ m/.(pl|dtd|sgml)$/;
171 return '' if $path =~ m:\bCVS/:;
172 return '' if $path =~ m/~$/;
173 $path;
174}
175
176# Pass libwww-perl version number to pod2man
177sub manifypods
178{
179 my $self = shift;
180 my $ver = $self->{VERSION} || "";
181 local($_) = $self->SUPER::manifypods(@_);
182 s/pod2man\s*$/pod2man --release libwww-perl-$ver/m;
183 $_;
184}
Note: See TracBrowser for help on using the repository browser.