Static::Simple 0.10, replaced slurp for 5.5+, removed Apache feature, added tt2 ignor...
[catagits/Catalyst-Plugin-Static-Simple.git] / Build.PL
index b6eb02f..ed4d079 100644 (file)
--- 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;