1BEGIN { require 5.006 } # our
2
3use ExtUtils::MakeMaker;
4
5my $required_mech_version
6 =	eval {
7	   require LWP::UserAgent and
8	      LWP::UserAgent->VERSION < 5.815 && LWP::UserAgent->VERSION >= 5
9	   and require HTTP::Message and HTTP::Message->VERSION >= 1.34
10	   and require HTTP::Request and HTTP::Request->VERSION >= 1.29
11	   and require HTTP::Response and HTTP::Response->VERSION >= 1.35
12	}
13	   ? 1.2 # cookie cloning
14	   : 1.52 # compatibility with LWP 5.815 with regard to credentials
15;
16
17my %prereq = (
18	CSS::DOM::Interface          => 0,
19	Encode                     => 0,
20	Exporter                   => 5.57,
21# For data: URLs with fragments, we need HTML::DOM .057, to work around
22# URI bug #115339.  When the URI bug is fixed, we can revert the required
23# version of HTML::DOM and depend on a newer URI (or do it conditionally
24# based on whether the newer HTML::DOM is installed).
25#	HTML::DOM                  =>  .045, # weaken_response
26	HTML::DOM                   =>  .057, # data: and fragments
27	HTML::DOM::Collection        => 0,
28	HTML::DOM::EventTarget       =>  .053, # DOMAttrModified events with
29	                                            # correct type and can-
30	HTML::DOM::Interface       =>  .019, # EventTarget  # cellability
31	HTML::DOM::NodeList::Magic =>  .020, # 2nd arg to new
32	HTML::DOM::View              =>  .018, # inside-out; writa-
33	HTTP::Headers::Util        => 0,     # ble document
34	HTTP::Message              => 1.34, # array ref headers
35	HTTP::Request              => 1.29, # URI instead of URI::URL
36	HTTP::Response              => 1.35, # likewise
37	IO::Uncompress::Gunzip      => 0,
38	List::Util                  => 0,
39	LWP                        => 5,
40	LWP::Protocol              => 0, # version 1.22 at the earliest
41	                                      # (LWP 5), for the collect
42	overload                   => 0,           # method, but that ver-
43	Scalar::Util               => 1.09, # reftype  # sion  didn’t  in-
44	strict                     => 0,                  # clude $VERSION
45	eval { require Hash::Util::FieldHash } ? () : (
46	 Tie::RefHash::Weak          => 0.08, # fieldhash
47	),
48	Time::HiRes                 => 0,
49	URI                        => 0,
50	warnings                   => 0,
51	WWW::Mechanize           => $required_mech_version,
52	WWW::Mechanize::Image    => 0,
53	WWW::Mechanize::Link     => 0,
54# for testing:
55#	HTML'DOM      =>  .03, # doc->title when title elem is empty
56	HTML::DOM::Element::Form => .039, # make_request with GET and data:
57	lib           => 0,
58	Scalar::Util   => 1.09, # refaddr
59	Test::More    => 0,
60	URI::data     => 0,
61	URI::file     => 0,
62	utf8          => 0,
63);
64
65my %m = (
66 resources =>
67  { repository => 'https://github.com/cpansprout/www-scripter' }
68);
69
70WriteMakefile(
71    NAME            => 'WWW::Scripter',
72    AUTHOR          => 'Father Chrysostomos <sprout at, um, cpan dot org>',
73    VERSION_FROM    => 'lib/WWW/Scripter.pm',
74    ABSTRACT_FROM   => 'lib/WWW/Scripter.pod',
75    PL_FILES            => {},
76    PREREQ_PM          => \%prereq,
77    META_MERGE         => \%m,
78    dist               => { COMPRESS => 'gzip -9f', SUFFIX => 'gz',
79                            TAR => 'COPYFILE_DISABLE=1 tar' },
80    clean              => { FILES => 'WWW-Scripter-*' },
81);
82