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