Needed for authors to run optional http test
[catagits/Catalyst-Runtime.git] / Makefile.PL
1 use strict;
2 use warnings;
3 use inc::Module::Install 0.87;
4 {   # Ensure that these get used - yes, M::I loads them for us, but if you're
5     # in author mode and don't have them installed, then the error is tres
6     # cryptic.
7     no warnings 'redefine';
8     use Module::Install::AuthorRequires;
9     use Module::Install::CheckConflicts;
10     use Module::Install::AuthorTests;
11 }
12
13 perl_version '5.008004';
14
15 name 'Catalyst-Runtime';
16 all_from 'lib/Catalyst/Runtime.pm';
17
18 requires 'List::MoreUtils';
19 requires 'namespace::autoclean' => '0.09';
20 requires 'namespace::clean';
21 requires 'B::Hooks::EndOfScope' => '0.08';
22 requires 'MooseX::Emulate::Class::Accessor::Fast' => '0.00903';
23 requires 'Class::MOP' => '0.83';
24 requires 'Moose' => '0.90';
25 requires 'MooseX::MethodAttributes::Inheritable' => '0.17';
26 requires 'Carp';
27 requires 'Class::C3::Adopt::NEXT' => '0.07';
28 requires 'CGI::Simple::Cookie';
29 requires 'Data::Dump';
30 requires 'HTML::Entities';
31 requires 'HTTP::Body'    => '1.04'; # makes uploadtmp work
32 requires 'HTTP::Headers' => '1.64';
33 requires 'HTTP::Request';
34 requires 'HTTP::Response';
35 requires 'HTTP::Request::AsCGI' => '0.8';
36 requires 'LWP::UserAgent';
37 requires 'Module::Pluggable' => '3.9';
38 requires 'Path::Class' => '0.09';
39 requires 'Scalar::Util';
40 requires 'Sub::Exporter';
41 requires 'Text::SimpleTable' => '0.03';
42 requires 'Time::HiRes';
43 requires 'Tree::Simple' => '1.15';
44 requires 'Tree::Simple::Visitor::FindByPath';
45 requires 'URI' => '1.35';
46 requires 'Task::Weaken';
47 requires 'Text::Balanced'; # core in 5.8.x but mentioned for completeness
48 requires 'MRO::Compat';
49 requires 'String::RewritePrefix' => '0.004'; # Catalyst::Utils::resolve_namespace
50
51 recommends 'B::Hooks::OP::Check::StashChange';
52
53 test_requires 'Class::Data::Inheritable';
54 test_requires 'Test::Exception';
55
56 # aggregate tests if AGGREGATE_TESTS is set and a recent Test::Aggregate and a Test::Simple it works with is available
57 if ($ENV{AGGREGATE_TESTS} && can_use('Test::Simple', '0.88') && can_use('Test::Aggregate', '0.35_05')) {
58     author_requires('Test::Aggregate', '0.35_05');
59     author_requires('Test::Simple', '0.88');
60 }
61 else {
62     tests join q{ },
63         grep { $_ ne 't/aggregate.t' }
64         map  { glob } qw[t/*.t t/aggregate/*.t];
65 }
66 author_requires 'CatalystX::LeakChecker', '0.03'; # Skipped if this isn't installed
67 author_requires 'File::Copy::Recursive'; # For http server test
68
69 author_tests 't/author';
70 author_requires(map {; $_ => 0 } qw(
71   Test::NoTabs
72   Test::Pod
73   Test::Pod::Coverage
74   Pod::Coverage
75 ));
76
77 if ($Module::Install::AUTHOR) {
78     darwin_check_no_resource_forks();
79 }
80
81 resources(
82     'MailingList' => 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst',
83     'IRC'         => 'irc://irc.perl.org/#catalyst',
84     'license',    => 'http://dev.perl.org/licenses/',
85     'homepage',   => 'http://dev.catalyst.perl.org/',
86     'repository', => 'http://dev.catalyst.perl.org/repos/Catalyst/Catalyst-Runtime/',
87 );
88
89 install_script glob('script/*.pl');
90 auto_install;
91 WriteAll;
92
93 print <<"EOF";
94
95  Important:
96
97     This library is for running Catalyst applications.
98
99     For development and use of catalyst.pl and myapp_create.pl, make sure
100     you also install the development tools package Catalyst::Devel.
101
102         perl -MCPANPLUS -e 'install Catalyst::Devel' # or
103         perl -MCPAN -e 'install Catalyst::Devel'
104
105     To get some commonly used plugins, as well as the TT view and DBIC
106     model, install Task::Catalyst in the same way.
107
108  Have fun!
109 EOF
110
111 # NOTE - This is the version number of the _incompatible_ code,
112 #        not the version number of the fixed version.
113 my %conflicts = (
114     'Catalyst::Model::Akismet' => '0.02',
115     'Catalyst::Component::ACCEPT_CONTEXT' => '0.06',
116     'Catalyst::Plugin::ENV' => '9999', # This plugin is just stupid, full stop
117                                        # should have been a core fix.
118     'Catalyst::Plugin::Unicode::Encoding' => '0.2',
119     'Catalyst::Authentication::Credential::HTTP' => '1.009',
120     'Catalyst::Plugin::Session::Store::File' => '0.16',
121     'Catalyst::Plugin::Session' => '0.21',
122     'Catalyst::Plugin::Session::State::Cookie' => '0.10',
123     'Catalyst::Plugin::Session::Store::FastMmap' => '0.09',
124     'Catalyst::Controller::AllowDisable' => '0.03',
125     'Reaction' => '0.001999',
126     'Catalyst::Plugin::Upload::Image::Magick' => '0.03',
127     'Catalyst::Plugin::ConfigLoader'   => '0.22', # Older versions work but
128                                                   # throw Data::Visitor warns
129     'Catalyst::Devel'                  => '1.19',
130     'Catalyst::Plugin::SmartURI'       => '0.032',
131     'CatalystX::CRUD'                  => '0.37',
132     'Catalyst::Action::RenderView'     => '0.07',
133     'Catalyst::Plugin::DebugCookie'    => '0.999002',
134     'Catalyst::Plugin::Authentication' => '0.100091',
135     'CatalystX::Imports'               => '0.03',
136     'Catalyst::Plugin::HashedCookies'  => '1.03',
137     'Catalyst::Action::REST'           => '0.67',
138     'CatalystX::CRUD'                  => '0.42',
139     'CatalystX::CRUD::Model::RDBO'     => '0.20',
140     'Catalyst::View::Mason'            => '0.17',
141 );
142 check_conflicts(%conflicts);
143
144 # End of script, helper functions below.
145
146 sub darwin_check_no_resource_forks {
147     if ($^O eq 'darwin') {
148         my $osx_ver = `/usr/bin/sw_vers -productVersion`;
149         chomp $osx_ver;
150
151         # TAR on 10.4 wants COPY_EXTENDED_ATTRIBUTES_DISABLE
152         # On 10.5 (Leopard) it wants COPYFILE_DISABLE
153          die("Oh, you got Ceiling Cat, snazzy. Please read the man page for tar or Google to find out if Apple renamed COPYFILE_DISABLE (it was COPY_EXTENDED_ATTRIBUTES_DISABLE originally) again and fix this Makefile.PL please?\n") if $osx_ver =~ /^10.7/;
154         my $attr = $osx_ver =~ /^10.(5|6)/  ? 'COPYFILE_DISABLE' : 'COPY_EXTENDED_ATTRIBUTES_DISABLE';
155
156         makemaker_args(dist => { PREOP => qq{\@if [ "\$\$$attr" != "true" ]; then}.
157                                           qq{ echo "You must set the ENV variable $attr to true,"; }.
158                                           ' echo "to avoid getting resource forks in your dist."; exit 255; fi' });
159     }
160 }