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