Merge master into gsoc_breadboard
[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 if ($Module::Install::AUTHOR) { # We could just use them, but telling
8     my @fail;                   # people the set of things they need nicer
9     foreach my $module (qw/
10         Module::Install::AuthorRequires
11         Module::Install::CheckConflicts
12         Module::Install::AuthorTests
13         Module::Install::Authority
14     /) {
15         push(@fail, $module)
16             unless eval qq{require $module; 1;};
17     }
18     die("Module::Install extensions failed, not installed? \n"
19         . join("\n", map { "  $_" } @fail) . "\n") if @fail;
20 }
21
22 perl_version '5.008003';
23
24 name 'Catalyst-Runtime';
25 author 'Sebastian Riedel <sri@cpan.org>';
26 authority('MSTROUT');
27 all_from 'lib/Catalyst/Runtime.pm';
28
29 requires 'Bread::Board';
30 requires 'List::MoreUtils';
31 requires 'namespace::autoclean' => '0.09';
32 requires 'namespace::clean' => '0.23';
33 requires 'MooseX::Emulate::Class::Accessor::Fast' => '0.00903';
34 requires 'Class::Load' => '0.12';
35 requires 'Class::MOP' => '0.95';
36 requires 'Data::OptList';
37 requires 'Moose' => '1.03';
38 requires 'MooseX::MethodAttributes::Inheritable' => '0.24';
39 requires 'MooseX::Role::WithOverloading' => '0.09';
40 requires 'MooseX::Types::LoadableClass' => '0.003';
41 requires 'Carp';
42 requires 'Class::C3::Adopt::NEXT' => '0.07';
43 requires 'CGI::Simple::Cookie' => '1.109';
44 requires 'Data::Dump';
45 requires 'Data::OptList';
46 requires 'HTML::Entities';
47 requires 'HTML::HeadParser';
48 requires 'HTTP::Body'    => '1.06'; # ->cleanup(1)
49 requires 'HTTP::Headers' => '1.64';
50 requires 'HTTP::Request' => '5.814';
51 requires 'HTTP::Response' => '5.813';
52 requires 'HTTP::Request::AsCGI' => '1.0';
53 requires 'LWP::UserAgent';
54 requires 'Module::Pluggable' => '3.9';
55 requires 'Path::Class' => '0.09';
56 requires 'Scalar::Util';
57 requires 'Sub::Exporter';
58 requires 'Text::SimpleTable' => '0.03';
59 requires 'Time::HiRes';
60 requires 'Tree::Simple' => '1.15';
61 requires 'Tree::Simple::Visitor::FindByPath';
62 requires 'Try::Tiny';
63 requires 'URI' => '1.35';
64 requires 'Task::Weaken';
65 requires 'Text::Balanced'; # core in 5.8.x but mentioned for completeness
66 requires 'MRO::Compat';
67 requires 'MooseX::Getopt' => '0.30';
68 requires 'MooseX::Types';
69 requires 'MooseX::Types::Common::Numeric';
70 requires 'MooseX::Types::LoadableClass';
71 requires 'String::RewritePrefix' => '0.004'; # Catalyst::Utils::resolve_namespace
72 requires 'Plack' => '0.9974'; # IIS6 fix middleware
73 requires 'Plack::Middleware::ReverseProxy' => '0.04';
74 requires 'Plack::Test::ExternalServer';
75
76 test_requires 'Class::Data::Inheritable';
77 test_requires 'Test::Exception';
78 test_requires 'Test::More' => '0.88';
79 test_requires 'Data::Dump';
80 test_requires 'HTTP::Request::Common';
81
82 # aggregate tests if AGGREGATE_TESTS is set and a recent Test::Aggregate and a Test::Simple it works with is available
83 my @author_requires;
84 if ($ENV{AGGREGATE_TESTS} && can_use('Test::Simple', '0.88') && can_use('Test::Aggregate', '0.364')) {
85     push(@author_requires, 'Test::Aggregate', '0.364');
86     push(@author_requires, 'Test::Simple', '0.88');
87     open my $fh, '>', '.aggregating';
88 }
89 else {
90     unlink '.aggregating';
91     tests 't/*.t t/aggregate/*.t';
92 }
93
94 push(@author_requires, 'CatalystX::LeakChecker', '0.05');
95 push(@author_requires, 'Catalyst::Devel', '1.0'); # For http server test
96
97 author_tests('t/author');
98 author_requires(
99   @author_requires,
100   map {; $_ => 0 } qw(
101   File::Copy::Recursive
102   Catalyst::Engine::PSGI
103   Test::Without::Module
104   Starman
105   MooseX::Daemonize
106   Test::NoTabs
107   Test::Pod
108   Test::Pod::Coverage
109   Test::Spelling
110   Pod::Coverage::TrustPod
111 ));
112
113 if ($Module::Install::AUTHOR) {
114     darwin_check_no_resource_forks();
115 }
116
117 resources(
118     'MailingList' => 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst',
119     'IRC'         => 'irc://irc.perl.org/#catalyst',
120     'license',    => 'http://dev.perl.org/licenses/',
121     'homepage',   => 'http://dev.catalyst.perl.org/',
122     'repository', => 'git://git.shadowcat.co.uk/catagits/Catalyst-Runtime.git',
123 );
124
125 install_script glob('script/*.pl');
126 auto_install;
127 WriteAll;
128
129 print <<"EOF";
130
131  Important:
132
133     This library is for running Catalyst applications.
134
135     For development and use of catalyst.pl and myapp_create.pl, make sure
136     you also install the development tools package Catalyst::Devel.
137
138         perl -MCPANPLUS -e 'install Catalyst::Devel' # or
139         perl -MCPAN -e 'install Catalyst::Devel'     # or
140         cpanm Catalyst::Devel
141
142     To get some commonly used plugins, as well as the TT view and DBIC
143     model, install Task::Catalyst in the same way.
144
145  Have fun!
146 EOF
147
148 # NOTE - This is the version number of the _incompatible_ code,
149 #        not the version number of the fixed version.
150 my %conflicts = (
151     'Catalyst::Plugin::SubRequest' => '0.14',
152     'Catalyst::Model::Akismet' => '0.02',
153     'Catalyst::Component::ACCEPT_CONTEXT' => '0.06',
154     'Catalyst::Plugin::ENV' => '9999', # This plugin is just stupid, full stop
155                                        # should have been a core fix.
156     'Catalyst::Plugin::Unicode::Encoding' => '0.2',
157     'Catalyst::Plugin::Authentication' => '0.10010', # _config accessor in ::Credential::Password
158     'Catalyst::Authentication::Credential::HTTP' => '1.009',
159     'Catalyst::Plugin::Session::Store::File'     => '0.16',
160     'Catalyst::Plugin::Session'                  => '0.21',
161     'Catalyst::Plugin::Session::State::Cookie'   => '0.10',
162     'Catalyst::Plugin::Session::Store::FastMmap' => '0.09',
163     'Catalyst::Controller::AllowDisable'         => '0.03',
164     'Reaction'                                   => '0.001999',
165     'Catalyst::Plugin::Upload::Image::Magick'    => '0.03',
166     'Catalyst::Plugin::ConfigLoader'             => '0.22', # Older versions work but
167                                                   # throw Data::Visitor warns
168     'Catalyst::Devel'                            => '1.19',
169     'Catalyst::Plugin::SmartURI'                 => '0.032',
170     'CatalystX::CRUD'                            => '0.37',
171     'Catalyst::Action::RenderView'               => '0.07',
172     'Catalyst::Plugin::DebugCookie'              => '0.999002',
173     'Catalyst::Plugin::Authentication'           => '0.100091',
174     'CatalystX::Imports'                         => '0.03',
175     'Catalyst::Plugin::HashedCookies'            => '1.03',
176     'Catalyst::Action::REST'                     => '0.67',
177     'CatalystX::CRUD'                            => '0.42',
178     'CatalystX::CRUD::Model::RDBO'               => '0.20',
179     'Catalyst::View::Mason'                      => '0.17',
180 #    Note these are not actually needed - they fail tests against the
181 #    new version, but still work fine..
182 #    'Catalyst::ActionRole::ACL'                  => '0.05',
183 #    'Catalyst::Plugin::Session::Store::DBIC'     => '0.11',
184       'Test::WWW::Mechanize::Catalyst'            => '0.53', # Dep warnings unless upgraded.
185 );
186 check_conflicts(%conflicts);
187
188 # End of script, helper functions below.
189
190 sub darwin_check_no_resource_forks {
191     if ($^O eq 'darwin') {
192         my $osx_ver = `/usr/bin/sw_vers -productVersion`;
193         chomp $osx_ver;
194
195         # TAR on 10.4 wants COPY_EXTENDED_ATTRIBUTES_DISABLE
196         # On 10.5 (Leopard) it wants COPYFILE_DISABLE
197          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.8/;
198         my $attr = $osx_ver =~ /^10.(5|6|7)/  ? 'COPYFILE_DISABLE' : 'COPY_EXTENDED_ATTRIBUTES_DISABLE';
199
200         makemaker_args(dist => { PREOP => qq{\@if [ "\$\$$attr" != "true" ]; then}.
201                                           qq{ echo "You must set the ENV variable $attr to 'true',"; }.
202                                           ' echo "to avoid getting resource forks in your dist."; exit 255; fi' });
203     }
204 }