Makebe fix FAR.. Remove warning suppresssion
[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 author_requires 'PAR::Packer';
28 author_requires 'Module::ScanDeps';
29
30 test_requires 'Test::More' => '0.94';
31
32 install_share 'share';
33
34 if ( $^O eq 'MSWin32' ) {
35     # Proc::Background needs this on Win32 but doesn't actually
36     # require it, if it's missing it just dies in the Makefile.PL.
37     requires 'Win32::Process' => '0.04';
38     requires 'Proc::Background';
39 }
40
41 if (!$ENV{CATALYST_DEVEL_NO_510_CHECK}) {
42     use Symbol 'gensym';
43     use IPC::Open3;
44     use File::Spec;
45     open NULL, '>', File::Spec->devnull;
46     my $err = gensym;
47     my $pid = open3(gensym, '&>NULL', $err, "$^X -It/lib -MUnknownError -e 1");
48
49     my $unknown_error = 0;
50
51     while (<$err>) {
52         $unknown_error = 1 if /^Unknown error/;
53     }
54
55     waitpid $pid, 0;
56
57     if ($unknown_error) {
58         warn <<EOE;
59 ############################### WARNING #################################
60 #                                                                       #
61 # You are using perl 5.10.0 with the "Unknown error" bug. This can make #
62 # developing Catalyst applications much more painful, as it will come   #
63 # up with no details every time you have a syntax error in a Controller.#
64 #                                                                       #
65 # For more information see:                                             #
66 #                                                                       #
67 #  * http://rt.perl.org/rt3/Public/Bug/Display.html?id=49472            #
68 #                                                                       #
69 # It is highly recommended that you use a different version of perl or  #
70 # compile a patched version for Catalyst development.                   #
71 #                                                                       #
72 # To skip this check, set the CATALYST_DEVEL_NO_510_CHECK environment   #
73 # variable.                                                             #
74 #                                                                       #
75 #########################################################################
76
77 EOE
78         my $ans = prompt('Do you want to continue?', 'no');
79         exit 0 unless $ans =~ /^y(es)?\z/i;
80     }
81 }
82
83 # kill warning from older versions of Class::C3
84 if ($] >= 5.009_005 && can_use('Class::C3') && !can_use('Class::C3', 0.20)) {
85     requires 'Class::C3' => '0.20';
86 }
87
88 auto_install;
89
90 WriteAll;
91
92 if ($Module::Install::AUTHOR) {
93     Meta->{values}{resources} = [
94         [ 'MailingList' => 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst' ],
95         [ 'IRC'         => 'irc://irc.perl.org/#catalyst' ],
96         [ 'license',    => 'http://dev.perl.org/licenses/' ],
97         [ 'homepage',   => 'http://dev.catalyst.perl.org/'],
98         [ 'repository', => 'git://git.shadowcat.co.uk/catagits/Catalyst-Devel.git' ],
99     ];
100
101     Meta->{values}{requires} = [ grep {
102         $_->[0] ne 'Class::C3'
103     } @{ Meta->{values}{requires} } ];
104
105     Meta->write;
106 }