Bump MX::MethodAttributes::Inheritable dep
[catagits/Catalyst-Runtime.git] / Makefile.PL
1 use inc::Module::Install 0.64;
2
3 perl_version '5.008001';
4
5 name 'Catalyst-Runtime';
6 all_from 'lib/Catalyst/Runtime.pm';
7
8 requires 'namespace::clean';
9 requires 'Scope::Upper' => '0.06';
10 requires 'MooseX::MethodAttributes::Inheritable' => '0.05';
11 requires 'MooseX::Emulate::Class::Accessor::Fast' => '0.00800';
12 requires 'Moose' => '0.70';
13 requires 'Carp';
14 requires 'Class::C3::Adopt::NEXT' => '0.07';
15 requires 'Class::MOP';
16 requires 'CGI::Simple::Cookie';
17 requires 'Data::Dump';
18 requires 'File::Modified';
19 requires 'HTML::Entities';
20 requires 'HTTP::Body'    => '1.04'; # makes uploadtmp work
21 requires 'HTTP::Headers' => '1.64';
22 requires 'HTTP::Request';
23 requires 'HTTP::Response';
24 requires 'HTTP::Request::AsCGI' => '0.5';
25 requires 'LWP::UserAgent';
26 requires 'Module::Pluggable' => '3.01';
27 requires 'Path::Class' => '0.09';
28 requires 'Scalar::Util';
29 requires 'Sub::Exporter';
30 requires 'Text::SimpleTable' => '0.03';
31 requires 'Time::HiRes';
32 requires 'Tree::Simple' => '1.15';
33 requires 'Tree::Simple::Visitor::FindByPath';
34 requires 'URI' => '1.35';
35 requires 'Text::Balanced'; # core in 5.8.x but mentioned for completeness
36 requires 'MRO::Compat';
37
38 recommends 'B::Hooks::OP::Check::StashChange';
39
40 test_requires 'Class::Data::Inheritable';
41 test_requires 'Test::MockObject';
42
43 if (   ( exists $ENV{AGGREGATE_TESTS} && !$ENV{AGGREGATE_TESTS})
44     || (!exists $ENV{AGGREGATE_TESTS} && !can_use('Test::Aggregate', '0.34_01'))) {
45     tests join q{ },
46         grep { $_ ne 't/aggregate.t' }
47         map  { glob } qw[t/*.t t/aggregate/*.t];
48 }
49 else {
50     test_requires('Test::Aggregate', '0.34_01');
51 }
52 my @force_build_requires_if_author = qw(
53   Test::NoTabs 
54   Test::Pod 
55   Test::Pod::Coverage 
56   Pod::Coverage
57 );
58
59 if ($Module::Install::AUTHOR) {
60
61   foreach my $module (@force_build_requires_if_author) {
62     build_requires $module;
63   }
64
65
66   if ($^O eq 'darwin') { 
67       my $osx_ver = `/usr/bin/sw_vers -productVersion`;
68       chomp $osx_ver;
69
70       # TAR on 10.4 wants COPY_EXTENDED_ATTRIBUTES_DISABLE
71       # On 10.5 (Leopard) it wants COPYFILE_DISABLE
72       my $attr = $osx_ver eq '10.5' ? 'COPYFILE_DISABLE' : 'COPY_EXTENDED_ATTRIBUTES_DISABLE';
73
74       makemaker_args(dist => { PREOP => qq{\@if [ "\$\$$attr" != "true" ]; then}.
75                                         qq{ echo "You must set the ENV variable $attr to true,"; }.
76                                         ' echo "to avoid getting resource forks in your dist."; exit 255; fi' }); 
77   }
78 }
79
80 install_script glob('script/*.pl');
81 auto_install;
82 WriteAll;
83
84 if ($Module::Install::AUTHOR) {
85
86   # Strip out the author only build_requires from META.yml
87   # Need to do this _after_ WriteAll else it looses track of them
88   Meta->{values}{build_requires} = [ grep {
89     my $ok = 1;
90     foreach my $module (@force_build_requires_if_author) {
91       if ($_->[0] =~ /$module/) {
92         $ok = 0;
93         last;
94       }
95     }
96     $ok;
97   } @{Meta->{values}{build_requires}} ];
98
99   Meta->{values}{resources} = [ 
100     [ 'MailingList', 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst' ],
101     [ 'IRC', 'irc://irc.perl.org/#catalyst' ],
102     [ 'license', 'http://dev.perl.org/licenses/' ],
103     [ 'homepage', 'http://dev.catalyst.perl.org/'], 
104     [ 'repository', 'http://dev.catalyst.perl.org/repos/Catalyst/Catalyst-Runtime/' ],
105   ];
106
107   Meta->write;
108 }
109 print <<"EOF";
110
111  Important:
112
113     This library is for running Catalyst applications.
114
115     For development and use of catalyst.pl and myapp_create.pl, make sure
116     you also install the development tools package Catalyst::Devel.
117
118         perl -MCPANPLUS -e 'install Catalyst::Devel' # or
119         perl -MCPAN -e 'install Catalyst::Devel'
120
121     To get some commonly used plugins, as well as the TT view and DBIC 
122     model, install Task::Catalyst in the same way.
123
124  Have fun!
125 EOF
126
127 check_conflicts();
128
129 # Nicked straight from Moose!
130 sub check_conflicts {
131     # NOTE - This is the version number of the _incompatible_ code,
132     #        not the version number of the fixed version.
133     my %conflicts = (
134         'Catalyst::Plugin::SmartURI'       => '0.029',
135         'CatalystX::CRUD'                  => '0.37',
136         'Catalyst::Action::RenderView'     => '0.07',
137         'Catalyst::Plugin::DebugCookie'    => '0.999002',
138         'Catalyst::Plugin::Authentication' => '0.100091',
139         'CatalystX::Imports'               => '0.03',
140         'Catalyst::Plugin::HashedCookies'  => '1.03',
141     );
142
143     my $found = 0;
144     for my $mod ( sort keys %conflicts ) {
145         eval "require($mod)";
146         next if $@;
147
148         my $installed = $mod->VERSION();
149         if ( $installed le $conflicts{$mod} ) {
150
151             print <<"EOF";
152
153 ***
154     This version of Catalyst conflicts with the version of
155     $mod ($installed) you have installed.
156
157     You will need to upgrade $mod after installing
158     this version of Catalyst.
159 ***
160
161 EOF
162
163             $found = 1;
164         }
165     }
166
167     return unless $found;
168
169     # More or less copied from Module::Build
170     return if $ENV{PERL_MM_USE_DEFAULT};
171     return unless -t STDIN && (-t STDOUT || !(-f STDOUT || -c STDOUT));
172
173     sleep 4;
174 }