Commit | Line | Data |
ae29b412 |
1 | use inc::Module::Install 0.64; |
022d1311 |
2 | |
551846d1 |
3 | perl_version '5.008001'; |
0ba80bce |
4 | |
341d40d1 |
5 | name 'Catalyst-Runtime'; |
6 | all_from 'lib/Catalyst/Runtime.pm'; |
24b3262a |
7 | |
ae29b412 |
8 | requires 'namespace::clean'; |
9 | requires 'Scope::Upper' => '0.06'; |
a58af53d |
10 | requires 'MooseX::MethodAttributes::Inheritable' => '0.03'; |
ae29b412 |
11 | requires 'MooseX::Emulate::Class::Accessor::Fast' => '0.00800'; |
12 | requires 'Moose' => '0.70'; |
9ce44430 |
13 | requires 'Carp'; |
ae29b412 |
14 | requires 'Class::C3::Adopt::NEXT' => '0.07'; |
15 | requires 'Class::MOP'; |
fa32ac82 |
16 | requires 'CGI::Simple::Cookie'; |
f63c03e4 |
17 | requires 'Data::Dump'; |
24b3262a |
18 | requires 'File::Modified'; |
19 | requires 'HTML::Entities'; |
3c402610 |
20 | requires 'HTTP::Body' => '1.04'; # makes uploadtmp work |
1e514a51 |
21 | requires 'HTTP::Headers' => '1.64'; |
24b3262a |
22 | requires 'HTTP::Request'; |
23 | requires 'HTTP::Response'; |
ee3c41e3 |
24 | requires 'HTTP::Request::AsCGI' => '0.5'; |
24b3262a |
25 | requires 'LWP::UserAgent'; |
d8e0de58 |
26 | requires 'Module::Pluggable' => '3.01'; |
1e514a51 |
27 | requires 'Path::Class' => '0.09'; |
24b3262a |
28 | requires 'Scalar::Util'; |
ae29b412 |
29 | requires 'Sub::Exporter'; |
1e514a51 |
30 | requires 'Text::SimpleTable' => '0.03'; |
24b3262a |
31 | requires 'Time::HiRes'; |
1e514a51 |
32 | requires 'Tree::Simple' => '1.15'; |
24b3262a |
33 | requires 'Tree::Simple::Visitor::FindByPath'; |
1e514a51 |
34 | requires 'URI' => '1.35'; |
ea0e58d9 |
35 | requires 'Text::Balanced'; # core in 5.8.x but mentioned for completeness |
ae29b412 |
36 | requires 'MRO::Compat'; |
24b3262a |
37 | |
ae29b412 |
38 | recommends 'B::Hooks::OP::Check::StashChange'; |
a9835938 |
39 | |
ae29b412 |
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 | } |
ffa93d6b |
52 | my @force_build_requires_if_author = qw( |
ae29b412 |
53 | Test::NoTabs |
54 | Test::Pod |
55 | Test::Pod::Coverage |
56 | Pod::Coverage |
ffa93d6b |
57 | ); |
ae29b412 |
58 | |
ffa93d6b |
59 | if ($Module::Install::AUTHOR) { |
60 | |
ae29b412 |
61 | foreach my $module (@force_build_requires_if_author) { |
62 | build_requires $module; |
63 | } |
ffa93d6b |
64 | |
65 | |
ae29b412 |
66 | if ($^O eq 'darwin') { |
67 | my $osx_ver = `/usr/bin/sw_vers -productVersion`; |
68 | chomp $osx_ver; |
ffa93d6b |
69 | |
ae29b412 |
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'; |
ffa93d6b |
73 | |
ae29b412 |
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 | } |
de925c79 |
78 | } |
79 | |
24b3262a |
80 | install_script glob('script/*.pl'); |
b6395bce |
81 | auto_install; |
24b3262a |
82 | WriteAll; |
614f3ad6 |
83 | |
ffa93d6b |
84 | if ($Module::Install::AUTHOR) { |
85 | |
ae29b412 |
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; |
ffa93d6b |
108 | } |
614f3ad6 |
109 | print <<"EOF"; |
110 | |
111 | Important: |
a5b5152b |
112 | |
0187a79d |
113 | This library is for running Catalyst applications. |
114 | |
341d40d1 |
115 | For development and use of catalyst.pl and myapp_create.pl, make sure |
116 | you also install the development tools package Catalyst::Devel. |
f63c03e4 |
117 | |
6bc14aef |
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. |
a5b5152b |
123 | |
a5b5152b |
124 | Have fun! |
614f3ad6 |
125 | EOF |
ae29b412 |
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 | } |