Need newer LWP for tests to pass as suggested on list by Jose Luis Martinez
[catagits/Catalyst-Runtime.git] / Makefile.PL
1 use strict;
2 use warnings;
3 use inc::Module::Install 0.87;
4 {   # Ensure that these get used - yes, M::I loads them for us, but if you're
5     # in author mode and don't have them installed, then the error is tres
6     # cryptic.
7     no warnings 'redefine';
8     use Module::Install::AuthorRequires;
9     use Module::Install::CheckConflicts;
10     use Module::Install::AuthorTests;
11 }
12
13 perl_version '5.008004';
14
15 name 'Catalyst-Runtime';
16 all_from 'lib/Catalyst/Runtime.pm';
17
18 requires 'List::MoreUtils';
19 requires 'namespace::autoclean' => '0.09';
20 requires 'namespace::clean';
21 requires 'B::Hooks::EndOfScope' => '0.08';
22 requires 'MooseX::Emulate::Class::Accessor::Fast' => '0.00903';
23 requires 'Class::MOP' => '0.83';
24 requires 'Moose' => '0.90';
25 requires 'MooseX::MethodAttributes::Inheritable' => '0.17';
26 requires 'Carp';
27 requires 'Class::C3::Adopt::NEXT' => '0.07';
28 requires 'CGI::Simple::Cookie';
29 requires 'Data::Dump';
30 requires 'HTML::Entities';
31 requires 'HTTP::Body'    => '1.04'; # makes uploadtmp work
32 requires 'HTTP::Headers' => '1.64';
33 requires 'HTTP::Request' => '5.814';
34 requires 'HTTP::Response' => '5.813';
35 requires 'HTTP::Request::AsCGI' => '0.8';
36 requires 'LWP::UserAgent';
37 requires 'Module::Pluggable' => '3.9';
38 requires 'Path::Class' => '0.09';
39 requires 'Scalar::Util';
40 requires 'Sub::Exporter';
41 requires 'Text::SimpleTable' => '0.03';
42 requires 'Time::HiRes';
43 requires 'Tree::Simple' => '1.15';
44 requires 'Tree::Simple::Visitor::FindByPath';
45 requires 'URI' => '1.35';
46 requires 'Task::Weaken';
47 requires 'Text::Balanced'; # core in 5.8.x but mentioned for completeness
48 requires 'MRO::Compat';
49 requires 'String::RewritePrefix' => '0.004'; # Catalyst::Utils::resolve_namespace
50
51 recommends 'B::Hooks::OP::Check::StashChange';
52
53 test_requires 'Class::Data::Inheritable';
54 test_requires 'Test::Exception';
55
56 # aggregate tests if AGGREGATE_TESTS is set and a recent Test::Aggregate and a Test::Simple it works with is available
57 if ($ENV{AGGREGATE_TESTS} && can_use('Test::Simple', '0.88') && can_use('Test::Aggregate', '0.35_05')) {
58     author_requires('Test::Aggregate', '0.35_05');
59     author_requires('Test::Simple', '0.88');
60 }
61 else {
62     tests join q{ },
63         grep { $_ ne 't/aggregate.t' }
64         map  { glob } qw[t/*.t t/aggregate/*.t];
65 }
66 author_requires 'CatalystX::LeakChecker', '0.03'; # Skipped if this isn't installed
67
68 author_tests 't/author';
69 author_requires(map {; $_ => 0 } qw(
70   Test::NoTabs
71   Test::Pod
72   Test::Pod::Coverage
73   Pod::Coverage
74 ));
75
76 if ($Module::Install::AUTHOR) {
77     darwin_check_no_resource_forks();
78 }
79
80 resources(
81     'MailingList' => 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst',
82     'IRC'         => 'irc://irc.perl.org/#catalyst',
83     'license',    => 'http://dev.perl.org/licenses/',
84     'homepage',   => 'http://dev.catalyst.perl.org/',
85     'repository', => 'http://dev.catalyst.perl.org/repos/Catalyst/Catalyst-Runtime/',
86 );
87
88 install_script glob('script/*.pl');
89 auto_install;
90 WriteAll;
91
92 print <<"EOF";
93
94  Important:
95
96     This library is for running Catalyst applications.
97
98     For development and use of catalyst.pl and myapp_create.pl, make sure
99     you also install the development tools package Catalyst::Devel.
100
101         perl -MCPANPLUS -e 'install Catalyst::Devel' # or
102         perl -MCPAN -e 'install Catalyst::Devel'
103
104     To get some commonly used plugins, as well as the TT view and DBIC
105     model, install Task::Catalyst in the same way.
106
107  Have fun!
108 EOF
109
110 # NOTE - This is the version number of the _incompatible_ code,
111 #        not the version number of the fixed version.
112 my %conflicts = (
113     'Catalyst::Model::Akismet' => '0.02',
114     'Catalyst::Component::ACCEPT_CONTEXT' => '0.06',
115     'Catalyst::Plugin::ENV' => '9999', # This plugin is just stupid, full stop
116                                        # should have been a core fix.
117     'Catalyst::Plugin::Unicode::Encoding' => '0.2',
118     'Catalyst::Authentication::Credential::HTTP' => '1.009',
119     'Catalyst::Plugin::Session::Store::File' => '0.16',
120     'Catalyst::Plugin::Session' => '0.21',
121     'Catalyst::Plugin::Session::State::Cookie' => '0.10',
122     'Catalyst::Plugin::Session::Store::FastMmap' => '0.09',
123     'Catalyst::Controller::AllowDisable' => '0.03',
124     'Reaction' => '0.001999',
125     'Catalyst::Plugin::Upload::Image::Magick' => '0.03',
126     'Catalyst::Plugin::ConfigLoader'   => '0.22', # Older versions work but
127                                                   # throw Data::Visitor warns
128     'Catalyst::Devel'                  => '1.19',
129     'Catalyst::Plugin::SmartURI'       => '0.032',
130     'CatalystX::CRUD'                  => '0.37',
131     'Catalyst::Action::RenderView'     => '0.07',
132     'Catalyst::Plugin::DebugCookie'    => '0.999002',
133     'Catalyst::Plugin::Authentication' => '0.100091',
134     'CatalystX::Imports'               => '0.03',
135     'Catalyst::Plugin::HashedCookies'  => '1.03',
136     'Catalyst::Action::REST'           => '0.67',
137     'CatalystX::CRUD'                  => '0.42',
138     'CatalystX::CRUD::Model::RDBO'     => '0.20',
139     'Catalyst::View::Mason'            => '0.17',
140 );
141 check_conflicts(%conflicts);
142
143 # End of script, helper functions below.
144
145 sub darwin_check_no_resource_forks {
146     if ($^O eq 'darwin') {
147         my $osx_ver = `/usr/bin/sw_vers -productVersion`;
148         chomp $osx_ver;
149
150         # TAR on 10.4 wants COPY_EXTENDED_ATTRIBUTES_DISABLE
151         # On 10.5 (Leopard) it wants COPYFILE_DISABLE
152          die("Oh, you got Ceiling Cat, snazzy. Please read the man page for tar or Google to find out if Apple renamed COPYFILE_DISABLE (it was COPY_EXTENDED_ATTRIBUTES_DISABLE originally) again and fix this Makefile.PL please?\n") if $osx_ver =~ /^10.7/;
153         my $attr = $osx_ver =~ /^10.(5|6)/  ? 'COPYFILE_DISABLE' : 'COPY_EXTENDED_ATTRIBUTES_DISABLE';
154
155         makemaker_args(dist => { PREOP => qq{\@if [ "\$\$$attr" != "true" ]; then}.
156                                           qq{ echo "You must set the ENV variable $attr to true,"; }.
157                                           ' echo "to avoid getting resource forks in your dist."; exit 255; fi' });
158     }
159 }