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