File: Makefile.PL

package info (click to toggle)
www-search 1.007-1
  • links: PTS
  • area: main
  • in suites: hamm, slink
  • size: 220 kB
  • ctags: 78
  • sloc: perl: 1,075; makefile: 36
file content (100 lines) | stat: -rw-r--r-- 2,493 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# This -*- perl -*- script writes the Makefile for libwww-perl
# $Id: Makefile.PL,v 1.5 1996/10/29 21:28:08 johnh Exp $

#--- Configuration section ---

@programs_to_install = qw(search AutoSearch);

#--- End Configuration - You should not have to change anything below this line

require 5.002;  # LWP needs this perl version

# Allow us to suppress all program installation with the -n (library only)
# option.  This is for those that don't want to mess with the configuration
# section of 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;


# Check for non-standard modules that are used by this library.
$| = 1;
my $missing_modules = 0;

print "Checking for LWP...";
eval {
    require LWP::UserAgent;
};
if ($@) {
    print " failed\n";
    $missing_modules++;
    print <<EOT;
$@
The WWW::Search library requires the libwww-perl module.

EOT
    sleep(2);  # Don't hurry too much
} else {
    print " ok\n";
}

print <<EOT if $missing_modules;
The missing modules can be obtained from CPAN.  Visit
<URL:http://www.perl.com/CPAN/> to find a CPAN site near you.

EOT


# Ok, now it is time to really generate the Makefile
use ExtUtils::MakeMaker;

WriteMakefile(
   NAME          => 'WWW::Search',
   VERSION_FROM  => 'lib/WWW/Search.pm',
   PL_FILES      => {
                      'bin/search.PL' => 'bin/search',
                      'bin/AutoSearch.PL' => 'bin/AutoSearch',
	            },
   EXE_FILES     => [ map {"bin/$_"} @programs_to_install ],
   'clean'       => { FILES => '$(EXE_FILES)' },
   'dist'	 => { COMPRESS => 'gzip', 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) t/TEST $(TEST_VERBOSE)
# 
# );
# }


# Determine things that should *not* be installed
sub MY::libscan {
    my($self, $path) = @_;
    return '' if $path =~ m/.(pl|dtd|sgml)$/;
    return '' if $path =~ m:\bCVS/:;
    return '' if $path =~ m/~$/;
    $path;
}