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