]> git.vpit.fr Git - perl/modules/Test-Valgrind.git/blobdiff - Makefile.PL
Build the $name and the main $file from $dist
[perl/modules/Test-Valgrind.git] / Makefile.PL
index 0e704222e55ffc1c1da36361f0140e8bff3b0e14..be831928004549d58a78c0d97582ec351819f082 100644 (file)
@@ -41,6 +41,13 @@ if ($has_cc) {
  print "none\n";
 }
 
+my $dist = 'Test-Valgrind';
+
+(my $name = $dist) =~ s{-}{::}g;
+
+(my $file = $dist) =~ s{-}{/}g;
+$file = "lib/$file.pm";
+
 my %PREREQ_PM = (
  'Carp'                  => 0,
  'Digest::MD5'           => 0,
@@ -62,8 +69,6 @@ my %PREREQ_PM = (
  'version'               => 0,
 );
 
-my $dist = 'Test-Valgrind';
-
 my %META = (
  configure_requires => {
   'File::Spec'          => 0,
@@ -88,18 +93,18 @@ my %META = (
 );
 
 WriteMakefile(
-    NAME             => 'Test::Valgrind',
+    NAME             => $name,
     AUTHOR           => 'Vincent Pit <perl@profvince.com>',
     LICENSE          => 'perl',
-    VERSION_FROM     => 'lib/Test/Valgrind.pm',
-    ABSTRACT_FROM    => 'lib/Test/Valgrind.pm',
+    VERSION_FROM     => $file,
+    ABSTRACT_FROM    => $file,
     OPTIMIZE         => '-g',
     C                => \@C,
     PREREQ_PM        => \%PREREQ_PM,
     MIN_PERL_VERSION => 5.006,
     META_MERGE       => \%META,
     dist             => {
-        PREOP    => 'pod2text lib/Test/Valgrind.pm > $(DISTVNAME)/README',
+        PREOP    => "pod2text $file > \$(DISTVNAME)/README",
         COMPRESS => 'gzip -9f', SUFFIX => 'gz',
     },
     clean            => {