Use get_all_methods_with_attributes to get all possible actions.
[catagits/Catalyst-Runtime.git] / Makefile.PL
CommitLineData
ae29b412 1use inc::Module::Install 0.64;
022d1311 2
551846d1 3perl_version '5.008001';
0ba80bce 4
341d40d1 5name 'Catalyst-Runtime';
6all_from 'lib/Catalyst/Runtime.pm';
24b3262a 7
ae29b412 8requires 'namespace::clean';
9requires 'Scope::Upper' => '0.06';
a58af53d 10requires 'MooseX::MethodAttributes::Inheritable' => '0.03';
ae29b412 11requires 'MooseX::Emulate::Class::Accessor::Fast' => '0.00800';
12requires 'Moose' => '0.70';
9ce44430 13requires 'Carp';
ae29b412 14requires 'Class::C3::Adopt::NEXT' => '0.07';
15requires 'Class::MOP';
fa32ac82 16requires 'CGI::Simple::Cookie';
f63c03e4 17requires 'Data::Dump';
24b3262a 18requires 'File::Modified';
19requires 'HTML::Entities';
3c402610 20requires 'HTTP::Body' => '1.04'; # makes uploadtmp work
1e514a51 21requires 'HTTP::Headers' => '1.64';
24b3262a 22requires 'HTTP::Request';
23requires 'HTTP::Response';
ee3c41e3 24requires 'HTTP::Request::AsCGI' => '0.5';
24b3262a 25requires 'LWP::UserAgent';
d8e0de58 26requires 'Module::Pluggable' => '3.01';
1e514a51 27requires 'Path::Class' => '0.09';
24b3262a 28requires 'Scalar::Util';
ae29b412 29requires 'Sub::Exporter';
1e514a51 30requires 'Text::SimpleTable' => '0.03';
24b3262a 31requires 'Time::HiRes';
1e514a51 32requires 'Tree::Simple' => '1.15';
24b3262a 33requires 'Tree::Simple::Visitor::FindByPath';
1e514a51 34requires 'URI' => '1.35';
ea0e58d9 35requires 'Text::Balanced'; # core in 5.8.x but mentioned for completeness
ae29b412 36requires 'MRO::Compat';
24b3262a 37
ae29b412 38recommends 'B::Hooks::OP::Check::StashChange';
a9835938 39
ae29b412 40test_requires 'Class::Data::Inheritable';
41test_requires 'Test::MockObject';
42
43if ( ( exists $ENV{AGGREGATE_TESTS} && !$ENV{AGGREGATE_TESTS})
44 || (!exists $ENV{AGGREGATE_TESTS} && !can_use('Test::Aggregate', '0.34_01'))) {
45 tests join q{ },
46 grep { $_ ne 't/aggregate.t' }
47 map { glob } qw[t/*.t t/aggregate/*.t];
48}
49else {
50 test_requires('Test::Aggregate', '0.34_01');
51}
ffa93d6b 52my @force_build_requires_if_author = qw(
ae29b412 53 Test::NoTabs
54 Test::Pod
55 Test::Pod::Coverage
56 Pod::Coverage
ffa93d6b 57);
ae29b412 58
ffa93d6b 59if ($Module::Install::AUTHOR) {
60
ae29b412 61 foreach my $module (@force_build_requires_if_author) {
62 build_requires $module;
63 }
ffa93d6b 64
65
ae29b412 66 if ($^O eq 'darwin') {
67 my $osx_ver = `/usr/bin/sw_vers -productVersion`;
68 chomp $osx_ver;
ffa93d6b 69
ae29b412 70 # TAR on 10.4 wants COPY_EXTENDED_ATTRIBUTES_DISABLE
71 # On 10.5 (Leopard) it wants COPYFILE_DISABLE
72 my $attr = $osx_ver eq '10.5' ? 'COPYFILE_DISABLE' : 'COPY_EXTENDED_ATTRIBUTES_DISABLE';
ffa93d6b 73
ae29b412 74 makemaker_args(dist => { PREOP => qq{\@if [ "\$\$$attr" != "true" ]; then}.
75 qq{ echo "You must set the ENV variable $attr to true,"; }.
76 ' echo "to avoid getting resource forks in your dist."; exit 255; fi' });
77 }
de925c79 78}
79
24b3262a 80install_script glob('script/*.pl');
b6395bce 81auto_install;
24b3262a 82WriteAll;
614f3ad6 83
ffa93d6b 84if ($Module::Install::AUTHOR) {
85
ae29b412 86 # Strip out the author only build_requires from META.yml
87 # Need to do this _after_ WriteAll else it looses track of them
88 Meta->{values}{build_requires} = [ grep {
89 my $ok = 1;
90 foreach my $module (@force_build_requires_if_author) {
91 if ($_->[0] =~ /$module/) {
92 $ok = 0;
93 last;
94 }
95 }
96 $ok;
97 } @{Meta->{values}{build_requires}} ];
98
99 Meta->{values}{resources} = [
100 [ 'MailingList', 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst' ],
101 [ 'IRC', 'irc://irc.perl.org/#catalyst' ],
102 [ 'license', 'http://dev.perl.org/licenses/' ],
103 [ 'homepage', 'http://dev.catalyst.perl.org/'],
104 [ 'repository', 'http://dev.catalyst.perl.org/repos/Catalyst/Catalyst-Runtime/' ],
105 ];
106
107 Meta->write;
ffa93d6b 108}
614f3ad6 109print <<"EOF";
110
111 Important:
a5b5152b 112
0187a79d 113 This library is for running Catalyst applications.
114
341d40d1 115 For development and use of catalyst.pl and myapp_create.pl, make sure
116 you also install the development tools package Catalyst::Devel.
f63c03e4 117
6bc14aef 118 perl -MCPANPLUS -e 'install Catalyst::Devel' # or
119 perl -MCPAN -e 'install Catalyst::Devel'
120
121 To get some commonly used plugins, as well as the TT view and DBIC
122 model, install Task::Catalyst in the same way.
a5b5152b 123
a5b5152b 124 Have fun!
614f3ad6 125EOF
ae29b412 126
127check_conflicts();
128
129# Nicked straight from Moose!
130sub check_conflicts {
131 # NOTE - This is the version number of the _incompatible_ code,
132 # not the version number of the fixed version.
133 my %conflicts = (
134 'Catalyst::Plugin::SmartURI' => '0.029',
135 'CatalystX::CRUD' => '0.37',
136 'Catalyst::Action::RenderView' => '0.07',
137 'Catalyst::Plugin::DebugCookie' => '0.999002',
138 'Catalyst::Plugin::Authentication' => '0.100091',
139 'CatalystX::Imports' => '0.03',
140 'Catalyst::Plugin::HashedCookies' => '1.03',
141 );
142
143 my $found = 0;
144 for my $mod ( sort keys %conflicts ) {
145 eval "require($mod)";
146 next if $@;
147
148 my $installed = $mod->VERSION();
149 if ( $installed le $conflicts{$mod} ) {
150
151 print <<"EOF";
152
153***
154 This version of Catalyst conflicts with the version of
155 $mod ($installed) you have installed.
156
157 You will need to upgrade $mod after installing
158 this version of Catalyst.
159***
160
161EOF
162
163 $found = 1;
164 }
165 }
166
167 return unless $found;
168
169 # More or less copied from Module::Build
170 return if $ENV{PERL_MM_USE_DEFAULT};
171 return unless -t STDIN && (-t STDOUT || !(-f STDOUT || -c STDOUT));
172
173 sleep 4;
174}