X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Plugin-Static-Simple.git;a=blobdiff_plain;f=Build.PL;h=ed4d07960642a78b9df2691a34eba23d8f3196eb;hp=b6eb02f92859cc5e593a1e36da2887cd48439b7e;hb=2cb3d58588fcff99a17ff2db819f4c9cab6d10d9;hpb=df701614104cdd304602fb28d0ed7c752a8c9693 diff --git a/Build.PL b/Build.PL index b6eb02f..ed4d079 100644 --- a/Build.PL +++ b/Build.PL @@ -6,8 +6,7 @@ my $build = Module::Build->new( license => 'perl', module_name => 'Catalyst::Plugin::Static::Simple', requires => { - 'Catalyst' => '5.30', - 'File::Slurp' => 0, + 'Catalyst' => '5.30', 'MIME::Types' => '1.15', }, create_makefile_pl => 'passthrough', @@ -15,4 +14,22 @@ my $build = Module::Build->new( glob('t/*.t') ] ); + +# Require File::Slurp only for older Catalyst versions +my $cat = $build->check_installed_status('Catalyst'); +if ( $cat->{have} le '5.33' ) { + $build->requires->{'File::Slurp'} = 0; +} + +# If the user has the SubRequest plugin installed, tell them to upgrade +my $subreq = $build->check_installed_status('Catalyst::Plugin::SubRequest'); +if ( $subreq->{have} le '0.08' ) { + print "** WARNING **\n" + . "You appear to have a version of Catalyst::Plugin::SubRequest " + . "older than 0.08.\n" + . "You must upgrade to SubRequest 0.08 or later if you use it " + . "in any applications with Static::Simple.\n"; + $build->requires->{'Catalyst::Plugin::SubRequest'} => '0.08'; +} + $build->create_build_script;