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