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