convert to Distar
[catagits/Catalyst-Runtime.git] / Makefile.PL
1 use strict;
2 use warnings;
3 use 5.008003;
4
5 my %META = (
6   name => 'Catalyst-Runtime',
7   license => 'perl_5',
8   prereqs => {
9     configure => { requires => {
10       'ExtUtils::MakeMaker'   => 0,
11     } },
12     build => { requires => {
13     } },
14     test => {
15       requires => {
16         'Test::Fatal' => 0,
17         'Test::More' => '0.88',
18         'HTTP::Request::Common' => 0,
19         'IO::Scalar' => 0,
20         'HTTP::Status' => 0,
21       },
22     },
23     runtime => {
24       requires => {
25         'perl'                  => 5.008003,
26         'List::Util'            => '1.45',
27         'namespace::autoclean'  => '0.28',
28         'namespace::clean'      => '0.23',
29         'MooseX::Emulate::Class::Accessor::Fast' => '0.00903',
30         'Class::Load'           => '0.12',
31         'Data::OptList'         => 0,
32         'Moose'                 => '1.03',
33         'MooseX::MethodAttributes::Role::AttrContainer::Inheritable' => '0.24',
34         'MooseX::Role::WithOverloading' => '0.09',
35         'Carp'                  => '1.25',
36         'Class::C3::Adopt::NEXT' => '0.07',
37         'CGI::Simple::Cookie'   => '1.109',
38         'Data::Dump'            => 0,
39         'Data::OptList'         => 0,
40         'HTML::Entities'        => 0,
41         'HTML::HeadParser'      => 0,
42         'HTTP::Body'            => '1.22',
43         'HTTP::Headers'         => '1.64',
44         'HTTP::Request'         => '5.814',
45         'HTTP::Response'        => '5.813',
46         'HTTP::Request::AsCGI'  => '1.0',
47         'Module::Pluggable'     => '4.7',
48         'Path::Class'           => '0.09',
49         'Scalar::Util'          => 0,
50         'Sub::Exporter'         => 0,
51         'Text::SimpleTable'     => '0.03',
52         'Time::HiRes'           => 0,
53         'Tree::Simple'          => '1.15',
54         'Tree::Simple::Visitor::FindByPath' => 0,
55         'Try::Tiny'             => '0.17',
56         'Safe::Isa'             => 0,
57         'Task::Weaken'          => 0,
58         'Text::Balanced'        => 0, # core in 5.8.x but mentioned for completeness
59         'MRO::Compat'           => 0,
60         'MooseX::Getopt'        => '0.48',
61         'String::RewritePrefix' => '0.004', # Catalyst::Utils::resolve_namespace
62         'Devel::InnerPackage'   => 0, # No longer core in blead
63         'Plack'                 => '0.9991', # IIS6+7 fix middleware
64         'Plack::Middleware::ReverseProxy' => '0.04',
65         'Plack::Test::ExternalServer' => 0,
66         'Class::Data::Inheritable' => 0,
67         'Encode'                => '2.49',
68         'LWP'                   => '5.837', # LWP had unicode fail in 5.8.26
69         'URI'                   => '1.65',
70         'URI::ws'               => '0.03',
71         'JSON::MaybeXS'         => '1.000000',
72         'Stream::Buffered'      => 0,
73         'Hash::MultiValue'      => 0,
74         'Plack::Request::Upload' => 0,
75         'CGI::Struct'           => 0,
76         "Plack::Middleware::Conditional" => 0,
77         "Plack::Middleware::IIS6ScriptNameFix" => 0,
78         "Plack::Middleware::IIS7KeepAliveFix" => 0,
79         "Plack::Middleware::LighttpdScriptNameFix" => 0,
80         "Plack::Middleware::ContentLength" => 0,
81         "Plack::Middleware::Head" => 0,
82         "Plack::Middleware::HTTPExceptions" => 0,
83         "Plack::Middleware::FixMissingBodyInRedirect" => '0.09',
84         "Plack::Middleware::MethodOverride" => '0.12',
85         "Plack::Middleware::RemoveRedundantBody" => '0.03',
86       },
87     },
88     develop   => {
89       requires => {
90         'Test::Aggregate'         => '0.364',
91         'Test::Simple'            => '0.88',
92         'CatalystX::LeakChecker'  => '0.05',
93         'Catalyst::Devel'         => '1.0', # For http server test
94         'Catalyst::Engine::PSGI'  => 0,
95         'Test::WWW::Mechanize::Catalyst' => '0.51',
96         'Test::TCP'               => '2.00', # ditto, ships Net::EmptyPort
97         'File::Copy::Recursive'   => 0,
98         'Starman'                 => 0,
99         'MooseX::Daemonize'       => 0,
100         'Test::NoTabs'            => 0,
101         'Test::Pod'               => 0,
102         'Test::Pod::Coverage'     => 0,
103         'Test::Spelling'          => 0,
104         'Pod::Coverage::TrustPod' => 0,
105         'Catalyst::Plugin::Params::Nested' => 0,
106         'Catalyst::Plugin::ConfigLoader' => 0,
107       },
108     },
109   },
110   resources => {
111     repository => {
112       # r/w: catagits@git.shadowcat.co.uk:Catalyst-Runtime.git
113       url => 'git://git.shadowcat.co.uk/catagits/Catalyst-Runtime.git',
114       web => 'http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits/Catalyst-Runtime.git;a=summary',
115       type => 'git',
116     },
117     x_IRC => 'irc://irc.perl.org/#catalyst',
118     bugtracker => {
119       web => 'https://rt.cpan.org/Public/Dist/Display.html?Name=Catalyst-Runtime',
120       mailto => 'bug-Catalyst-Runtime@rt.cpan.org',
121     },
122     license => [ 'http://dev.perl.org/licenses/' ],
123     x_MailingList => 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst',
124     homepage => 'http://dev.catalyst.perl.org/',
125   },
126   no_index => {
127     directory => [ 't', 'xt' ]
128   },
129   x_breaks => {
130     'Catalyst::Plugin::SubRequest' => '<= 0.14',
131     'Catalyst::Model::Akismet' => '<= 0.02',
132     'Catalyst::Component::ACCEPT_CONTEXT' => '<= 0.06',
133     'Catalyst::Plugin::ENV' => 0, # This plugin is just stupid, full stop
134                                   # should have been a core fix.
135     'Catalyst::Plugin::Unicode::Encoding' => '<= 0.2',
136     'Catalyst::Plugin::Authentication' => '<= 0.10010', # _config accessor in ::Credential::Password
137     'Catalyst::Authentication::Credential::HTTP' => '<= 1.009',
138     'Catalyst::Plugin::Session::Store::File'     => '<= 0.16',
139     'Catalyst::Plugin::Session'                  => '<= 0.21',
140     'Catalyst::Plugin::Session::State::Cookie'   => '<= 0.10',
141     'Catalyst::Plugin::Session::Store::FastMmap' => '<= 0.09',
142     'Catalyst::Controller::AllowDisable'         => '<= 0.03',
143     'Reaction'                                   => '<= 0.001999',
144     'Catalyst::Plugin::Upload::Image::Magick'    => '<= 0.03',
145     'Catalyst::Plugin::ConfigLoader'             => '<= 0.22', # Older versions work but
146                                                   # throw Data::Visitor warns
147     'Catalyst::Devel'                            => '<= 1.19',
148     'Catalyst::Plugin::SmartURI'                 => '<= 0.032',
149     'CatalystX::CRUD'                            => '<= 0.37',
150     'Catalyst::Action::RenderView'               => '<= 0.07',
151     'Catalyst::Plugin::DebugCookie'              => '<= 0.999002',
152     'Catalyst::Plugin::Authentication'           => '<= 0.100091',
153     'CatalystX::Imports'                         => '<= 0.03',
154     'Catalyst::Plugin::HashedCookies'            => '<= 1.03',
155     'Catalyst::Action::REST'                     => '<= 0.67',
156     'CatalystX::CRUD'                            => '<= 0.42',
157     'CatalystX::CRUD::Model::RDBO'               => '<= 0.20',
158     'Catalyst::View::Mason'                      => '<= 0.17',
159 #    Note these are not actually needed - they fail tests against the
160 #    new version, but still work fine..
161 #    'Catalyst::ActionRole::ACL'                  => '<= 0.05',
162 #    'Catalyst::Plugin::Session::Store::DBIC'     => '<= 0.11',
163     'Test::WWW::Mechanize::Catalyst'            => '<= 0.53', # Dep warnings unless upgraded.
164   },
165   x_authority => 'cpan:MSTROUT',
166 );
167
168 my $tests = 't/*.t';
169 if ($ENV{AGGREGATE_TESTS} && eval { require Test::Aggregate; Test::Aggregate->VERSION(0.364); }) {
170     open my $fh, '>', '.aggregating';
171 }
172 else {
173     unlink '.aggregating';
174     $tests .= ' t/aggregate/*.t';
175 }
176
177 my %MM_ARGS = (
178   test => { TESTS => $tests },
179   EXE_FILES => [ glob 'script/*.pl' ],
180   PREREQ_PM => {
181     (eval { require Moose; Moose->VERSION('2.1300') } ? () : (
182       'MooseX::Role::WithOverloading' => '0.09'
183     )),
184   },
185 );
186
187 ## BOILERPLATE ###############################################################
188 require ExtUtils::MakeMaker;
189 (do './maint/Makefile.PL.include' or die $@) unless -f 'META.yml';
190
191 # have to do this since old EUMM dev releases miss the eval $VERSION line
192 my $eumm_version  = eval $ExtUtils::MakeMaker::VERSION;
193 my $mymeta        = $eumm_version >= 6.57_02;
194 my $mymeta_broken = $mymeta && $eumm_version < 6.57_07;
195
196 ($MM_ARGS{NAME} = $META{name}) =~ s/-/::/g;
197 ($MM_ARGS{VERSION_FROM} = "lib/$MM_ARGS{NAME}.pm") =~ s{::}{/}g;
198 $META{license} = [ $META{license} ]
199   if $META{license} && !ref $META{license};
200 $MM_ARGS{LICENSE} = $META{license}[0]
201   if $META{license} && $eumm_version >= 6.30;
202 $MM_ARGS{NO_MYMETA} = 1
203   if $mymeta_broken;
204 $MM_ARGS{META_ADD} = { 'meta-spec' => { version => 2 }, %META }
205   unless -f 'META.yml';
206
207 for (qw(configure build test runtime)) {
208   my $key = $_ eq 'runtime' ? 'PREREQ_PM' : uc $_.'_REQUIRES';
209   my $r = $MM_ARGS{$key} = {
210     %{$META{prereqs}{$_}{requires} || {}},
211     %{delete $MM_ARGS{$key} || {}},
212   };
213   defined $r->{$_} or delete $r->{$_} for keys %$r;
214 }
215
216 $MM_ARGS{MIN_PERL_VERSION} = delete $MM_ARGS{PREREQ_PM}{perl} || 0;
217
218 delete $MM_ARGS{MIN_PERL_VERSION}
219   if $eumm_version < 6.47_01;
220 $MM_ARGS{BUILD_REQUIRES} = {%{$MM_ARGS{BUILD_REQUIRES}}, %{delete $MM_ARGS{TEST_REQUIRES}}}
221   if $eumm_version < 6.63_03;
222 $MM_ARGS{PREREQ_PM} = {%{$MM_ARGS{PREREQ_PM}}, %{delete $MM_ARGS{BUILD_REQUIRES}}}
223   if $eumm_version < 6.55_01;
224 delete $MM_ARGS{CONFIGURE_REQUIRES}
225   if $eumm_version < 6.51_03;
226
227 ExtUtils::MakeMaker::WriteMakefile(%MM_ARGS);
228 ## END BOILERPLATE ###########################################################
229
230 print <<"EOF";
231
232  Important:
233
234     This library is for running Catalyst applications.
235
236     For development and use of catalyst.pl and myapp_create.pl, make sure
237     you also install the development tools package Catalyst::Devel.
238
239         perl -MCPANPLUS -e 'install Catalyst::Devel' # or
240         perl -MCPAN -e 'install Catalyst::Devel'     # or
241         cpanm Catalyst::Devel
242
243     To get some commonly used plugins, as well as the TT view and DBIC
244     model, install Task::Catalyst in the same way.
245
246  Have fun!
247 EOF