1 use inc::Module::Install 0.64;
3 perl_version '5.008001';
5 name 'Catalyst-Runtime';
6 all_from 'lib/Catalyst/Runtime.pm';
8 requires 'namespace::clean';
9 requires 'Scope::Upper' => '0.06';
10 requires 'MooseX::Emulate::Class::Accessor::Fast' => '0.00801';
11 requires 'Moose' => '0.73';
12 requires 'MooseX::MethodAttributes::Inheritable' => '0.06';
14 requires 'Class::C3::Adopt::NEXT' => '0.07';
15 requires 'Class::MOP' => '0.79';
16 requires 'CGI::Simple::Cookie';
17 requires 'Data::Dump';
18 requires 'File::Modified';
19 requires 'HTML::Entities';
20 requires 'HTTP::Body' => '1.04'; # makes uploadtmp work
21 requires 'HTTP::Headers' => '1.64';
22 requires 'HTTP::Request';
23 requires 'HTTP::Response';
24 requires 'HTTP::Request::AsCGI' => '0.5';
25 requires 'LWP::UserAgent';
26 requires 'Module::Pluggable' => '3.01';
27 requires 'Path::Class' => '0.09';
28 requires 'Scalar::Util';
29 requires 'Sub::Exporter';
30 requires 'Text::SimpleTable' => '0.03';
31 requires 'Time::HiRes';
32 requires 'Tree::Simple' => '1.15';
33 requires 'Tree::Simple::Visitor::FindByPath';
34 requires 'URI' => '1.35';
35 requires 'Text::Balanced'; # core in 5.8.x but mentioned for completeness
36 requires 'MRO::Compat';
38 recommends 'B::Hooks::OP::Check::StashChange';
40 test_requires 'Class::Data::Inheritable';
41 test_requires 'Test::MockObject';
43 # NOTE - This is the version number which the user must upgrade to to be ok,
45 'Catalyst::Plugin::ConfigLoader' => '0.23', # Older versions work but
46 # throw Data::Visitor warns
47 'Catalyst::Devel' => '0.10',
48 'Catalyst::Plugin::SmartURI' => '0.030',
49 'CatalystX::CRUD' => '0.38',
50 'Catalyst::Action::RenderView' => '0.08',
51 'Catalyst::Plugin::DebugCookie' => '0.999003',
52 'Catalyst::Plugin::Authentication' => '0.100092',
53 'CatalystX::Imports' => '0.04',
54 'Catalyst::Plugin::HashedCookies' => '1.04',
55 'Catalyst::Action::REST' => '0.68',
57 check_conflicts(%conflicts);
59 # Run aggregate tests if AGGREGATE_TESTS environment = 1, but not if it = 0
60 # Otherwise default to using Test::Aggregate if installed, but not requiring it.
61 if ( ( exists $ENV{AGGREGATE_TESTS} && !$ENV{AGGREGATE_TESTS})
62 || (!exists $ENV{AGGREGATE_TESTS} && !can_use('Test::Aggregate', '0.34_01'))) {
64 grep { $_ ne 't/aggregate.t' }
65 map { glob } qw[t/*.t t/aggregate/*.t];
68 test_requires('Test::Aggregate', '0.34_01');
70 my @force_build_requires_if_author = qw(
77 if ($Module::Install::AUTHOR) {
78 foreach my $module (@force_build_requires_if_author) {
79 build_requires $module;
81 darwin_check_no_resource_forks();
84 install_script glob('script/*.pl');
88 if ($Module::Install::AUTHOR) {
90 # Strip out the author only build_requires from META.yml
91 # Need to do this _after_ WriteAll else it looses track of them
92 strip_build_requires(@force_build_requires_if_author);
94 # Strip out any conflicts, so that even if the author has a conflicting
95 # module installed, we don't end up with META.fail
96 strip_requires(keys %conflicts);
98 Meta->{values}{resources} = [
99 [ 'MailingList' => 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst' ],
100 [ 'IRC' => 'irc://irc.perl.org/#catalyst' ],
101 [ 'license', => 'http://dev.perl.org/licenses/' ],
102 [ 'homepage', => 'http://dev.catalyst.perl.org/'],
103 [ 'repository', => 'http://dev.catalyst.perl.org/repos/Catalyst/Catalyst-Runtime/' ],
113 This library is for running Catalyst applications.
115 For development and use of catalyst.pl and myapp_create.pl, make sure
116 you also install the development tools package Catalyst::Devel.
118 perl -MCPANPLUS -e 'install Catalyst::Devel' # or
119 perl -MCPAN -e 'install Catalyst::Devel'
121 To get some commonly used plugins, as well as the TT view and DBIC
122 model, install Task::Catalyst in the same way.
127 # End of script, helper functions below.
129 sub darwin_check_no_resource_forks {
130 if ($^O eq 'darwin') {
131 my $osx_ver = `/usr/bin/sw_vers -productVersion`;
134 # TAR on 10.4 wants COPY_EXTENDED_ATTRIBUTES_DISABLE
135 # On 10.5 (Leopard) it wants COPYFILE_DISABLE
136 my $attr = $osx_ver eq '10.5' ? 'COPYFILE_DISABLE' : 'COPY_EXTENDED_ATTRIBUTES_DISABLE';
138 makemaker_args(dist => { PREOP => qq{\@if [ "\$\$$attr" != "true" ]; then}.
139 qq{ echo "You must set the ENV variable $attr to true,"; }.
140 ' echo "to avoid getting resource forks in your dist."; exit 255; fi' });
144 sub strip_build_requires {
145 _strip_a_requires('build_requires', @_);
148 _strip_a_requires('requires', @_);
150 sub _strip_a_requires {
151 my ($type, @to_strip) = @_;
152 Meta->{values}{$type} = [ grep {
154 foreach my $module (@to_strip) {
155 if ($_->[0] =~ /$module/) {
161 } @{Meta->{values}{$type}} ];
164 sub check_conflicts {
168 for my $mod ( sort keys %conflicts ) {
169 eval "require($mod)";
172 my $installed = $mod->VERSION();
173 $conflicts_found{$mod} = $installed
174 if ( $installed lt $conflicts{$mod} );
177 return unless scalar keys %conflicts_found;
183 This version of Catalyst conflicts with the versions of
184 some components you have installed.
186 You will need to upgrade these modules after installing
187 this version of Catalyst.
189 List of the conflicting components and their installed versions:
193 foreach my $mod (keys %conflicts_found) {
194 print sprintf(" %s => %s\n", $mod, $conflicts_found{$mod});
197 return unless prompt("Would you like to upgrade these modules as part of this install?", 'N') =~ /Y/i;
199 foreach my $mod (keys %conflicts_found) {
200 requires($mod, $conflicts{$mod})
201 if prompt("Install $mod?", 'Y') =~ /Y/i;