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