]> git.vpit.fr Git - perl/modules/Test-Valgrind.git/commitdiff
Build the $name and the main $file from $dist
authorVincent Pit <vince@profvince.com>
Sun, 4 Oct 2009 08:37:51 +0000 (10:37 +0200)
committerVincent Pit <vince@profvince.com>
Sun, 4 Oct 2009 08:37:51 +0000 (10:37 +0200)
Makefile.PL

index 5f7416f52c566dd286c0e92f701090de41b2afaf..be831928004549d58a78c0d97582ec351819f082 100644 (file)
@@ -43,6 +43,11 @@ if ($has_cc) {
 
 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,
@@ -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            => {