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