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