]> git.vpit.fr Git - perl/modules/Test-Valgrind.git/blobdiff - Makefile.PL
Use clean Suppressions.pm and perlTestValgrind.supp when building a dist
[perl/modules/Test-Valgrind.git] / Makefile.PL
index 28863db8cac9692ac15b5932a23c170890c86664..f2df41308238a92cd83fc91f0896a59b73e6f93f 100644 (file)
@@ -108,6 +108,7 @@ WriteMakefile(
     PREREQ_PM     => {
         'Carp'                  => 0,
         'Exporter'              => 0,
+        'Fcntl'                 => 0,
         'POSIX'                 => 0,
         'Perl::Destruct::Level' => 0,
         'Test::Builder'         => 0,
@@ -124,15 +125,27 @@ WriteMakefile(
 
 package MY;
 
+sub dist_core {
+ my $dist = shift->SUPER::dist_core(@_);
+ $dist =~ s/^(\s*dist\s*:+\s*)/$1testvg_dist /m;
+ return <<DISTCORE . $dist;
+testvg_dist :
+       \$(CP) lib/Test/Valgrind/Suppressions.{tpl,pm}
+       \$(RM) lib/$supp
+       \$(TOUCH) lib/$supp
+DISTCORE
+}
+
 sub test {
  my $test = shift->SUPER::test(@_);
- return "test :: Makefile.bak blib/archpub/Test/Valgrind/perlTestValgrind.supp\n" . $test;
+ my ($target) = $test =~ /^\s*(test\s*:+)/m;
+ return "$target Makefile.bak blib/archpub/$supp\n$test";
 }
 
 sub postamble {
<<'POSTAMBLE';
return <<POSTAMBLE;
 clean ::
-       $(CP) lib/Test/Valgrind/Suppressions.{tpl,pm}
-       $(TOUCH) lib/Test/Valgrind/perlTestValgrind.supp
+       \$(CP) lib/Test/Valgrind/Suppressions.{tpl,pm}
+       \$(TOUCH) lib/$supp
 POSTAMBLE
 }