Commit | Line | Data |
d6d29b9b |
1 | use strict; |
2 | use Module::Build; |
3 | |
4 | my $build = Module::Build->new( |
5 | create_makefile_pl => 'passthrough', |
6 | license => 'perl', |
7 | module_name => 'Catalyst::Plugin::Static::Simple', |
8 | requires => { |
2cb3d585 |
9 | 'Catalyst' => '5.30', |
d6d29b9b |
10 | 'MIME::Types' => '1.15', |
11 | }, |
12 | create_makefile_pl => 'passthrough', |
13 | test_files => [ |
14 | glob('t/*.t') |
15 | ] |
16 | ); |
2cb3d585 |
17 | |
18 | # Require File::Slurp only for older Catalyst versions |
19 | my $cat = $build->check_installed_status('Catalyst'); |
20 | if ( $cat->{have} le '5.33' ) { |
21 | $build->requires->{'File::Slurp'} = 0; |
22 | } |
23 | |
24 | # If the user has the SubRequest plugin installed, tell them to upgrade |
25 | my $subreq = $build->check_installed_status('Catalyst::Plugin::SubRequest'); |
5224ce15 |
26 | if ( $subreq->{have} lt '0.08' ) { |
2cb3d585 |
27 | print "** WARNING **\n" |
28 | . "You appear to have a version of Catalyst::Plugin::SubRequest " |
29 | . "older than 0.08.\n" |
30 | . "You must upgrade to SubRequest 0.08 or later if you use it " |
31 | . "in any applications with Static::Simple.\n"; |
32 | $build->requires->{'Catalyst::Plugin::SubRequest'} => '0.08'; |
33 | } |
34 | |
d6d29b9b |
35 | $build->create_build_script; |