Fix author requires to not fatally error on a single command Fix author test platform...
[catagits/Catalyst-Runtime.git] / Makefile.PL
CommitLineData
9a2055d7 1use strict;
2use warnings;
9b8933f1 3use inc::Module::Install 1.06;
abc0ac29 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.
abc0ac29 7use Module::Install::CheckConflicts;
57746b80 8use Module::Install::Authority;
212ba4ee 9
9b8933f1 10# (Stolen from DBIC)
11# nasty hook into both M::AI init and the prompter, so that the optdep message
12# comes at the right places (on top and then right above the prompt)
13my $optdep_msg = '';
14{
15 require Module::AutoInstall;
16 no warnings 'redefine';
17 no strict 'refs';
18
19 for (qw/_prompt import/) {
20 my $meth = "Module::AutoInstall::$_";
21 my $orig = \&{$meth};
22 *{$meth} = sub {
23 print $optdep_msg;
24 goto $orig;
25 };
26 }
27}
28
0f6be50c 29perl_version '5.008003';
0ba80bce 30
341d40d1 31name 'Catalyst-Runtime';
57746b80 32author 'Sebastian Riedel <sri@cpan.org>';
33authority 'MSTROUT';
341d40d1 34all_from 'lib/Catalyst/Runtime.pm';
24b3262a 35
196f06d1 36requires 'List::MoreUtils';
29d32d06 37requires 'namespace::autoclean' => '0.09';
be21bc19 38requires 'namespace::clean' => '0.23';
29d32d06 39requires 'MooseX::Emulate::Class::Accessor::Fast' => '0.00903';
f53c5c12 40requires 'Class::Load' => '0.12';
6e0bebdc 41requires 'Class::MOP' => '0.95';
6640e166 42requires 'Data::OptList';
135e449a 43requires 'Moose' => '1.03';
9c74923d 44requires 'MooseX::MethodAttributes::Inheritable' => '0.24';
718e6314 45requires 'MooseX::Role::WithOverloading' => '0.09';
532f0516 46requires 'MooseX::Types::LoadableClass' => '0.003';
9ce44430 47requires 'Carp';
269408a4 48requires 'Class::C3::Adopt::NEXT' => '0.07';
0319ec68 49requires 'CGI::Simple::Cookie' => '1.109';
f63c03e4 50requires 'Data::Dump';
62b6b631 51requires 'Data::OptList';
24b3262a 52requires 'HTML::Entities';
9c74923d 53requires 'HTML::HeadParser';
671123ba 54requires 'HTTP::Body' => '1.06'; # ->cleanup(1)
1e514a51 55requires 'HTTP::Headers' => '1.64';
582cd214 56requires 'HTTP::Request' => '5.814';
57requires 'HTTP::Response' => '5.813';
6cc3be54 58requires 'HTTP::Request::AsCGI' => '1.0';
24b3262a 59requires 'LWP::UserAgent';
a134d05c 60requires 'Module::Pluggable' => '3.9';
1e514a51 61requires 'Path::Class' => '0.09';
24b3262a 62requires 'Scalar::Util';
64edd785 63requires 'Sub::Exporter';
1e514a51 64requires 'Text::SimpleTable' => '0.03';
24b3262a 65requires 'Time::HiRes';
1e514a51 66requires 'Tree::Simple' => '1.15';
24b3262a 67requires 'Tree::Simple::Visitor::FindByPath';
3640641e 68requires 'Try::Tiny';
1e514a51 69requires 'URI' => '1.35';
5ad8be8c 70requires 'Task::Weaken';
ea0e58d9 71requires 'Text::Balanced'; # core in 5.8.x but mentioned for completeness
6f1f968a 72requires 'MRO::Compat';
9c74923d 73requires 'MooseX::Getopt' => '0.30';
bd60aaeb 74requires 'MooseX::Types';
883c37ef 75requires 'MooseX::Types::Common::Numeric';
17b3d800 76requires 'String::RewritePrefix' => '0.004'; # Catalyst::Utils::resolve_namespace
fb99321f 77requires 'Plack' => '0.9974'; # IIS6 fix middleware
6db8aa1d 78requires 'Plack::Middleware::ReverseProxy' => '0.04';
555c9ff7 79requires 'Plack::Test::ExternalServer';
65b708a6 80
1a667b7c 81test_requires 'Class::Data::Inheritable';
cdc96667 82test_requires 'Test::Exception';
36c67dc1 83test_requires 'Test::More' => '0.88';
df1fa879 84test_requires 'Data::Dump';
da054c21 85test_requires 'HTTP::Request::Common';
1a667b7c 86
9b8933f1 87# No fatal author_* BS! This is the sole AUTHOR block
88if ($Module::Install::AUTHOR) {
89 $optdep_msg .= <<'EOW';
a06394ac 90
9b8933f1 91******************************************************************************
92******************************************************************************
93*** ***
94*** AUTHOR MODE: all optional test dependencies converted to hard requires ***
95*** ***
96******************************************************************************
97******************************************************************************
e262f38e 98
9b8933f1 99EOW
100 # This is now default to on unless it is explicitly set to zero
101 #my $aggregate_tests = exists $ENV{AGGREGATE_TESTS} ? $ENV{AGGREGATE_TESTS} : 1;
102
103 #### This is NOT default until Test::Aggregate fixes their Test::Builder monkey patching!
104 #### Remove this code and uncomment the above when it's fixed!
105 my $aggregate_tests = $ENV{AGGREGATE_TESTS};
106
107 # aggregate tests if AGGREGATE_TESTS is set and a recent Test::Aggregate and a Test::Simple it works with is available
108 if ($aggregate_tests && can_use('Test::Simple', '0.88') && can_use('Test::Aggregate', '0.364')) {
109 test_requires('Test::Aggregate', '0.364');
110 test_requires('Test::Simple', '0.88');
111 open my $fh, '>', '.aggregating';
112 }
113 else {
114 if ($aggregate_tests) {
115 # Friendly Reminder...
116 # There's no such thing as test_recommends (which wouldn't even end
117 # up on the module list, anyway), so we just print.
118 $optdep_msg .= <<'EOW';
119******************************************************************************
120* Author-level aggregate testing can go a lot smoother with Test::Aggregate *
121* and Test::Simple installed. Resorting to old-style multi-processed tests. *
122* *
123* (This notice can be silenced by explicitly setting AGGREGATE_TESTS=0.) *
124******************************************************************************
125EOW
126 #recommends('Test::Aggregate', '0.364');
127 #recommends('Test::Simple', '0.88');
128 }
129 unlink '.aggregating';
130 tests 't/*.t t/aggregate/*.t';
131 }
132
133 test_requires 'CatalystX::LeakChecker', '0.05';
134 test_requires 'File::Copy::Recursive'; # For http server test
135 test_requires 'Catalyst::Devel', '1.0'; # For http server test
136 test_requires 'Catalyst::Engine::PSGI';
137 test_requires 'Test::Without::Module';
138 unless ($^O eq 'MSWin32') {
139 test_requires 'Starman';
140 test_requires 'MooseX::Daemonize';
141 }
142
143 tests ('t/*.t t/author/*.t');
144 test_requires(map {; $_ => 0 } qw(
145 Test::NoTabs
146 Test::Pod
147 Test::Pod::Coverage
148 Test::Spelling
149 Pod::Coverage::TrustPod
150 ));
621f279b 151
c102399c 152 darwin_check_no_resource_forks();
de925c79 153}
154
697a1b1a 155resources(
156 'MailingList' => 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst',
157 'IRC' => 'irc://irc.perl.org/#catalyst',
158 'license', => 'http://dev.perl.org/licenses/',
159 'homepage', => 'http://dev.catalyst.perl.org/',
82e80cb1 160 'repository', => 'git://git.shadowcat.co.uk/catagits/Catalyst-Runtime.git',
697a1b1a 161);
162
24b3262a 163install_script glob('script/*.pl');
b6395bce 164auto_install;
24b3262a 165WriteAll;
614f3ad6 166
614f3ad6 167print <<"EOF";
168
169 Important:
a5b5152b 170
0187a79d 171 This library is for running Catalyst applications.
172
341d40d1 173 For development and use of catalyst.pl and myapp_create.pl, make sure
174 you also install the development tools package Catalyst::Devel.
f63c03e4 175
6bc14aef 176 perl -MCPANPLUS -e 'install Catalyst::Devel' # or
ec0939b9 177 perl -MCPAN -e 'install Catalyst::Devel' # or
178 cpanm Catalyst::Devel
6bc14aef 179
f4c1afd4 180 To get some commonly used plugins, as well as the TT view and DBIC
6bc14aef 181 model, install Task::Catalyst in the same way.
a5b5152b 182
a5b5152b 183 Have fun!
614f3ad6 184EOF
64d96919 185
d31581c6 186# NOTE - This is the version number of the _incompatible_ code,
187# not the version number of the fixed version.
188my %conflicts = (
69db240e 189 'Catalyst::Plugin::SubRequest' => '0.14',
68c660b5 190 'Catalyst::Model::Akismet' => '0.02',
33632a44 191 'Catalyst::Component::ACCEPT_CONTEXT' => '0.06',
d75b106e 192 'Catalyst::Plugin::ENV' => '9999', # This plugin is just stupid, full stop
193 # should have been a core fix.
71b46798 194 'Catalyst::Plugin::Unicode::Encoding' => '0.2',
d877f868 195 'Catalyst::Plugin::Authentication' => '0.10010', # _config accessor in ::Credential::Password
c49128b1 196 'Catalyst::Authentication::Credential::HTTP' => '1.009',
3d387aea 197 'Catalyst::Plugin::Session::Store::File' => '0.16',
198 'Catalyst::Plugin::Session' => '0.21',
199 'Catalyst::Plugin::Session::State::Cookie' => '0.10',
3db3a59f 200 'Catalyst::Plugin::Session::Store::FastMmap' => '0.09',
3d387aea 201 'Catalyst::Controller::AllowDisable' => '0.03',
202 'Reaction' => '0.001999',
203 'Catalyst::Plugin::Upload::Image::Magick' => '0.03',
204 'Catalyst::Plugin::ConfigLoader' => '0.22', # Older versions work but
d31581c6 205 # throw Data::Visitor warns
3d387aea 206 'Catalyst::Devel' => '1.19',
207 'Catalyst::Plugin::SmartURI' => '0.032',
208 'CatalystX::CRUD' => '0.37',
209 'Catalyst::Action::RenderView' => '0.07',
210 'Catalyst::Plugin::DebugCookie' => '0.999002',
211 'Catalyst::Plugin::Authentication' => '0.100091',
212 'CatalystX::Imports' => '0.03',
213 'Catalyst::Plugin::HashedCookies' => '1.03',
214 'Catalyst::Action::REST' => '0.67',
215 'CatalystX::CRUD' => '0.42',
216 'CatalystX::CRUD::Model::RDBO' => '0.20',
217 'Catalyst::View::Mason' => '0.17',
218# Note these are not actually needed - they fail tests against the
219# new version, but still work fine..
220# 'Catalyst::ActionRole::ACL' => '0.05',
221# 'Catalyst::Plugin::Session::Store::DBIC' => '0.11',
b9f72120 222 'Test::WWW::Mechanize::Catalyst' => '0.53', # Dep warnings unless upgraded.
d31581c6 223);
224check_conflicts(%conflicts);
225
c102399c 226# End of script, helper functions below.
227
228sub darwin_check_no_resource_forks {
229 if ($^O eq 'darwin') {
230 my $osx_ver = `/usr/bin/sw_vers -productVersion`;
231 chomp $osx_ver;
232
233 # TAR on 10.4 wants COPY_EXTENDED_ATTRIBUTES_DISABLE
234 # On 10.5 (Leopard) it wants COPYFILE_DISABLE
d109165a 235 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/;
236 my $attr = $osx_ver =~ /^10.(5|6|7)/ ? 'COPYFILE_DISABLE' : 'COPY_EXTENDED_ATTRIBUTES_DISABLE';
c102399c 237
238 makemaker_args(dist => { PREOP => qq{\@if [ "\$\$$attr" != "true" ]; then}.
2373117d 239 qq{ echo "You must set the ENV variable $attr to 'true',"; }.
c102399c 240 ' echo "to avoid getting resource forks in your dist."; exit 255; fi' });
64d96919 241 }
64d96919 242}