This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Upgrade to Module::Pluggable 3.7
[perl5.git] / ext / Module / Pluggable / Makefile.PL
index 8bf1034..ec527ec 100644 (file)
@@ -1,16 +1,48 @@
+# Note: this file was auto-generated by Module::Build::Compat version 0.03
 use ExtUtils::MakeMaker;
+use FindBin;
+use File::Spec::Functions qw(catfile);
+
+# VOS and VMS can't handle dodgy plugin names
+# and VOS can't even unpack them so we create them on the
+# fly and only run the tests if they're present
+my %dodgy_files = (
+    catfile(qw(OddTest Plugin -Dodgy.pm))   => 'OddTest::Plugin::-Dodgy',
+    catfile(qw(EditorJunk Plugin #Bar.pm#)) => 'EditorJunk::Bar',
+    catfile(qw(EditorJunk Plugin .#Bar.pm)) => 'EditorJunk::Bar',
+);
+
+my $core = grep { $_ eq 'PERL_CORE=1' } @ARGV;
+my @path = $core ? (File::Spec->updir, File::Spec->updir, File::Spec->updir,
+                   "t", "Module_Pluggable") : ($FindBin::Bin,"t");
+my @files;
+
+if ($^O ne 'VMS' && $^O ne 'VOS') {
+    foreach my $test (keys %dodgy_files) {
+        my ($file) = (catfile(@path, "lib", $test)=~/^(.*)$/);
+        if (open(my $fh, ">", $file)) {
+            my $name = $dodgy_files{$test};
+            print $fh "package $name;\nsub new {}\n1;";
+            close($fh);
+        push @files, $file;
+        }
+    }
+}
 
 WriteMakefile
 (
           'NAME' => 'Module::Pluggable',
           'VERSION_FROM' => 'lib/Module/Pluggable.pm',
-           MAN3PODS     => {},         # Pods will be built by installman.
           'PREREQ_PM' => {
                            'File::Basename' => '0',
                            'File::Spec' => '3.00',
                            'Test::More' => '0.62'
                          },
+          'INSTALLDIRS' => 'site',
           'EXE_FILES' => [],
-          'PL_FILES' => {}
+          'PL_FILES' => {},
+          'realclean'  => {FILES=> join ' ', @files},
+          # In the core pods will be built by installman.
+          $core ? (MAN3PODS => {}) : (),
         )
 ;