preserve $self->{name} in mk_app if defined
[catagits/Catalyst-Devel.git] / Makefile.PL
CommitLineData
18c940b8 1use strict;
2use warnings;
693e890f 3use inc::Module::Install 0.91;
18c940b8 4use Module::Install::AuthorRequires;
54616d61 5
6name 'Catalyst-Devel';
c93c671b 7all_from 'lib/Catalyst/Devel.pm';
68ccb5e5 8
ee99bea5 9requires 'Moose';
dcc30470 10requires 'MooseX::Emulate::Class::Accessor::Fast';
5561a11e 11requires 'File::ShareDir';
4753780f 12requires 'namespace::clean';
cf042872 13requires 'namespace::autoclean';
94e57c33 14requires 'Catalyst' => '5.80015';
a2301033 15requires 'Catalyst::Action::RenderView' => '0.10';
13096aba 16requires 'Catalyst::Plugin::Static::Simple' => '0.28';
a2301033 17requires 'Catalyst::Plugin::ConfigLoader' => '0.23';
fa60b7ee 18requires 'Config::General' => '2.42'; # as of 1.07, we use .conf and not .yaml
396a43ae 19requires 'File::ChangeNotify' => '0.07';
fde6650e 20requires 'File::Copy::Recursive';
693e890f 21requires 'Module::Install' => '0.91';
3d63fa09 22requires 'Path::Class' => '0.09';
23requires 'Template' => '2.14';
54616d61 24
18c940b8 25author_requires 'IPC::Run3';
09c03d31 26author_requires 'Module::Info';
27author_requires 'File::Find::Rule';
18c940b8 28
efc787e1 29test_requires 'Test::More' => '0.94';
91497b69 30
afd739f1 31install_share 'share';
32
2e9609df 33if ( $^O eq 'MSWin32' ) {
62cb5aed 34 # Proc::Background needs this on Win32 but doesn't actually
2e9609df 35 # require it, if it's missing it just dies in the Makefile.PL.
36 requires 'Win32::Process' => '0.04';
37 requires 'Proc::Background';
38}
39
1cbc4fbe 40if (!$ENV{CATALYST_DEVEL_NO_510_CHECK}) {
41 use Symbol 'gensym';
42 use IPC::Open3;
43 use File::Spec;
44 open NULL, '>', File::Spec->devnull;
45 my $err = gensym;
46 my $pid = open3(gensym, '&>NULL', $err, "$^X -It/lib -MUnknownError -e 1");
ee99bea5 47
1cbc4fbe 48 my $unknown_error = 0;
49
50 while (<$err>) {
51 $unknown_error = 1 if /^Unknown error/;
52 }
53
54 waitpid $pid, 0;
55
56 if ($unknown_error) {
57 warn <<EOE;
58############################### WARNING #################################
59# #
60# You are using perl 5.10.0 with the "Unknown error" bug. This can make #
ee99bea5 61# developing Catalyst applications much more painful, as it will come #
1cbc4fbe 62# up with no details every time you have a syntax error in a Controller.#
63# #
64# For more information see: #
65# #
66# * http://rt.perl.org/rt3/Public/Bug/Display.html?id=49472 #
67# #
68217a55 68# It is highly recommended that you use a different version of perl or #
69# compile a patched version for Catalyst development. #
1cbc4fbe 70# #
71# To skip this check, set the CATALYST_DEVEL_NO_510_CHECK environment #
72# variable. #
73# #
74#########################################################################
75
76EOE
77 my $ans = prompt('Do you want to continue?', 'no');
78 exit 0 unless $ans =~ /^y(es)?\z/i;
79 }
80}
81
d6c4f9a7 82# kill warning from older versions of Class::C3
83if ($] >= 5.009_005 && can_use('Class::C3') && !can_use('Class::C3', 0.20)) {
84 requires 'Class::C3' => '0.20';
85}
86
5539814d 87auto_install;
88
54616d61 89WriteAll;
d6c4f9a7 90
91if ($Module::Install::AUTHOR) {
92 Meta->{values}{resources} = [
93 [ 'MailingList' => 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst' ],
94 [ 'IRC' => 'irc://irc.perl.org/#catalyst' ],
95 [ 'license', => 'http://dev.perl.org/licenses/' ],
96 [ 'homepage', => 'http://dev.catalyst.perl.org/'],
fbfcf6c6 97 [ 'repository', => 'git://git.shadowcat.co.uk/catagits/Catalyst-Devel.git' ],
d6c4f9a7 98 ];
99
100 Meta->{values}{requires} = [ grep {
101 $_->[0] ne 'Class::C3'
102 } @{ Meta->{values}{requires} } ];
103
104 Meta->write;
105}