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