Add the original source packages to maemo, source lenny
[dh-make-perl] / dev / i386 / libwww-mechanize-perl / libwww-mechanize-perl-1.34 / Makefile.PL
1 package main;
2
3 require 5.006001;
4
5 use strict;
6 use warnings;
7 use ExtUtils::MakeMaker qw( WriteMakefile );
8 use File::Spec;
9 use Getopt::Long;
10
11 my $live = 1;
12 my $local = 1;
13 GetOptions(
14     'live!'         => \$live,
15     'local!'        => \$local,
16     'all'           => sub { print "All tests are on by default.  This option is deprecated.\n" },
17     'mech-dump!'    => sub { print "mech-dump is always installed now.  This option is deprecated.\n" },
18 );
19
20 my @tests = glob File::Spec->catfile( 't', '*.t' );
21 push( @tests, glob File::Spec->catfile( 't', 'local', '*.t' ) ) if $local;
22 push( @tests, glob File::Spec->catfile( 't', 'live', '*.t' ) ) if $live;
23 push( @tests, glob File::Spec->catfile( 't', 'mech-dump', '*.t' ) );
24
25 my $parms = {
26     NAME            => 'WWW::Mechanize',
27     VERSION_FROM    => 'lib/WWW/Mechanize.pm', # finds $VERSION
28     ABSTRACT_FROM   => 'lib/WWW/Mechanize.pm', # retrieve abstract from module
29     AUTHOR          => 'Andy Lester <andy@petdance.com>',
30     EXE_FILES       => [ 'bin/mech-dump' ],
31     PREREQ_PM       => {
32         'Carp'              => 0,
33         'File::Temp'        => 0,
34         'FindBin'           => 0,
35         'Getopt::Long'      => 0,
36         'HTML::Form'        => 1.038,
37         'HTML::HeadParser'  => 0,
38         'HTML::Parser'      => 3.33,
39         'HTML::TokeParser'  => 2.28,
40         'HTTP::Daemon'      => 0,
41         'HTTP::Request'     => 1.30,
42         'HTTP::Status'      => 0,
43         'LWP'               => 5.802,
44         'LWP::UserAgent'    => 2.024,
45         'Pod::Usage'        => 0,
46         'Test::More'        => 0.34,
47         'URI'               => 1.25,
48         'URI::URL'          => 0,
49         'URI::file'         => 0,
50     },
51     test            => { TESTS => join( ' ', @tests ) },
52     clean           => { FILES => 'WWW-Mechanize-*' },
53 };
54
55 if ( $ExtUtils::MakeMaker::VERSION eq '6.36' ) {
56     $parms->{EXTRA_META} = <<EOF;
57 resources:
58     license: http://dev.perl.org/licenses/
59     homepage: http://code.google.com/p/www-mechanize/
60     bugtracker: http://code.google.com/p/www-mechanize/issues/list
61     Repository: http://code.google.com/p/www-mechanize/source
62     MailingList: http://groups.google.com/group/www-mechanize-users
63 EOF
64     }
65
66
67 eval { require LWP; };
68 if (!$@) {
69     if ( ! LWP::Protocol::implementor('https') ) {
70         print <<EOT;
71
72 It looks like you don't have SSL capability (like IO::Socket::SSL) installed. 
73 You will not be able to process https:// URLs correctly.
74
75 EOT
76     }
77 }
78
79 my @missing;
80 my @nice = qw( Test::Pod Test::Memory::Cycle Test::Warn Test::Taint );
81 for my $nice ( @nice ) {
82     eval "require $nice";
83     push( @missing, $nice ) if $@;
84 }
85
86 if ( @missing ) {
87     @missing = map { "\t$_\n" } @missing;
88     print <<EOT;
89
90 WWW::Mechanize likes to have a lot of test modules for some of its tests.
91 The following are modules that would be nice to have, but not required.
92
93 @missing
94
95 EOT
96 }
97
98 WriteMakefile( %$parms );
99
100 sub MY::postamble {
101     return <<'MAKE_FRAG';
102 .PHONY: tags critic
103
104 tags:
105         ctags -f tags --recurse --totals \
106                 --exclude=blib \
107                 --exclude=.svn \
108                 --exclude='*~' \
109                 --languages=Perl --langmap=Perl:+.t \
110
111 critic:
112         perlcritic -1 -q -profile perlcriticrc bin/ lib/ t/
113
114 MAKE_FRAG
115 }
116
117 1;