calculate make command once
[catagits/Catalyst-Devel.git] / Makefile.PL
CommitLineData
18c940b8 1use strict;
2use warnings;
3b7ac9b8 3use lib '.';
684be1c4 4use lib 'inc';
693e890f 5use inc::Module::Install 0.91;
18c940b8 6use Module::Install::AuthorRequires;
3260ae5d 7use Module::Install::AuthorTests;
511bf965 8use Module::Install::Authority;
54616d61 9
10name 'Catalyst-Devel';
c93c671b 11all_from 'lib/Catalyst/Devel.pm';
075cb840 12authority 'cpan:MSTROUT';
68ccb5e5 13
ee99bea5 14requires 'Moose';
dcc30470 15requires 'MooseX::Emulate::Class::Accessor::Fast';
5561a11e 16requires 'File::ShareDir';
4753780f 17requires 'namespace::clean';
cf042872 18requires 'namespace::autoclean';
727f14e9 19requires 'Catalyst' => '5.90001';
a2301033 20requires 'Catalyst::Action::RenderView' => '0.10';
13096aba 21requires 'Catalyst::Plugin::Static::Simple' => '0.28';
ac4a8fbe 22requires 'Catalyst::Plugin::ConfigLoader' => '0.30';
fa60b7ee 23requires 'Config::General' => '2.42'; # as of 1.07, we use .conf and not .yaml
396a43ae 24requires 'File::ChangeNotify' => '0.07';
fde6650e 25requires 'File::Copy::Recursive';
3d63fa09 26requires 'Path::Class' => '0.09';
27requires 'Template' => '2.14';
8527ca62 28
29if (!$Module::Install::AUTHOR && $^O ne 'MSWin32') {
30 requires 'MooseX::Daemonize'; # Optional in scripts
31 requires 'Starman'; # Optional in scripts
32}
54616d61 33
8955c676 34# The Catalyst applications this module distribution have a Makefile.PL using
35# Module::Install as well as the Module::Install::Catalyst extension included in
36# this distribution. Therefore we really *depend* on Module::Install to be
37# installed, even though we also use it to build this distribution and include
38# it in its inc/ directory for releases.
d1840405 39requires 'Module::Install' => '1.02';
8955c676 40
18c940b8 41author_requires 'IPC::Run3';
9239f18f 42author_requires 'Proc::Background';
35155ac6 43author_requires 'Test::Pod';
44author_requires 'Test::Pod::Coverage';
18c940b8 45
efc787e1 46test_requires 'Test::More' => '0.94';
bc750d3b 47test_requires 'Test::Fatal' => '0.003';
91497b69 48
afd739f1 49install_share 'share';
50
3260ae5d 51author_tests 't/author';
52
1cbc4fbe 53if (!$ENV{CATALYST_DEVEL_NO_510_CHECK}) {
54 use Symbol 'gensym';
55 use IPC::Open3;
56 use File::Spec;
5cad4171 57 open my $null, '>', File::Spec->devnull;
1cbc4fbe 58 my $err = gensym;
5cad4171 59 my $pid = open3(gensym, $null, $err, qq{"$^X" -It/lib -MUnknownError -e 1});
ee99bea5 60
1cbc4fbe 61 my $unknown_error = 0;
62
63 while (<$err>) {
64 $unknown_error = 1 if /^Unknown error/;
65 }
66
67 waitpid $pid, 0;
68
69 if ($unknown_error) {
70 warn <<EOE;
71############################### WARNING #################################
72# #
73# You are using perl 5.10.0 with the "Unknown error" bug. This can make #
ee99bea5 74# developing Catalyst applications much more painful, as it will come #
1cbc4fbe 75# up with no details every time you have a syntax error in a Controller.#
76# #
77# For more information see: #
78# #
79# * http://rt.perl.org/rt3/Public/Bug/Display.html?id=49472 #
80# #
68217a55 81# It is highly recommended that you use a different version of perl or #
82# compile a patched version for Catalyst development. #
1cbc4fbe 83# #
84# To skip this check, set the CATALYST_DEVEL_NO_510_CHECK environment #
85# variable. #
86# #
87#########################################################################
88
89EOE
90 my $ans = prompt('Do you want to continue?', 'no');
91 exit 0 unless $ans =~ /^y(es)?\z/i;
92 }
93}
94
d6c4f9a7 95# kill warning from older versions of Class::C3
96if ($] >= 5.009_005 && can_use('Class::C3') && !can_use('Class::C3', 0.20)) {
97 requires 'Class::C3' => '0.20';
98}
99
5539814d 100auto_install;
101
54616d61 102WriteAll;
d6c4f9a7 103
104if ($Module::Install::AUTHOR) {
105 Meta->{values}{resources} = [
106 [ 'MailingList' => 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst' ],
107 [ 'IRC' => 'irc://irc.perl.org/#catalyst' ],
108 [ 'license', => 'http://dev.perl.org/licenses/' ],
109 [ 'homepage', => 'http://dev.catalyst.perl.org/'],
fbfcf6c6 110 [ 'repository', => 'git://git.shadowcat.co.uk/catagits/Catalyst-Devel.git' ],
d6c4f9a7 111 ];
112
113 Meta->{values}{requires} = [ grep {
114 $_->[0] ne 'Class::C3'
115 } @{ Meta->{values}{requires} } ];
116
117 Meta->write;
118}