- Fixes for rt.cpan #17322 and #17331
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Build.pm
index d37840e..ab6ba53 100644 (file)
@@ -2,10 +2,14 @@ package Catalyst::Build;
 
 use strict;
 use Module::Build;
-use base 'Module::Build';
 use Path::Class;
 use File::Find 'find';
 
+our @ISA;
+eval "require Module::Build";
+die "Please install Module::Build\n" if $@;
+push @ISA, 'Module::Build';
+
 our @ignore =
   qw/Build Build.PL Changes MANIFEST META.yml Makefile.PL Makefile README
   _build blib lib script t/;
@@ -25,10 +29,41 @@ See L<Catalyst>
 
 L<Module::Build> extension for Catalyst.
 
+=head1 DEPRECATION NOTICE
+
+This module is deprecated in favor of L<Module::Install::Catalyst>.
+
 =head1 METHODS
 
 =over 4
 
+=item new
+
+=cut
+
+sub new {
+    my $class = shift;
+    my $self  = $class->SUPER::new(@_);
+
+    my $app_name = $self->{properties}{module_name};
+    warn <<"EOF";
+
+ Note:
+
+    The use of Build.PL for building and distributing Catalyst
+    applications is deprecated in Catalyst 5.58.
+
+    We recommend using the new Module::Install-based Makefile
+    system.  You can generate a new Makefile.PL for your application
+    by running:
+
+        catalyst.pl -force -makefile $app_name
+
+EOF
+
+    return $self;
+}
+
 =item ACTION_install
 
 =cut
@@ -97,8 +132,8 @@ Sebastian Riedel, C<sri@oook.de>
 
 =head1 LICENSE
 
-This library is free software . You can redistribute it and/or modify it under
-the same terms as perl itself.
+This library is free software, you can redistribute it and/or modify it under
+the same terms as Perl itself.
 
 =cut