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

index fd2d202823d8685019ec7f2ba06905ca91c30b4a..f663e39331f26cdcbf2e23cfb35ec3a984c2932a 100644 (file)
@@ -15,6 +15,11 @@ if ($^O eq 'MSWin32' && $^V lt v5.9.0) {
 
 my $dist = 'Lexical-Types';
 
+(my $name = $dist) =~ s{-}{::}g;
+
+(my $file = $dist) =~ s{-}{/}g;
+$file = "lib/$file.pm";
+
 my %PREREQ_PM = (
  'Carp'     => 0,
  'XSLoader' => 0,
@@ -40,18 +45,18 @@ my %META = (
 );
 
 WriteMakefile(
-    NAME             => 'Lexical::Types',
+    NAME             => $name,
     AUTHOR           => 'Vincent Pit <perl@profvince.com>',
     LICENSE          => 'perl',
-    VERSION_FROM     => 'lib/Lexical/Types.pm',
-    ABSTRACT_FROM    => 'lib/Lexical/Types.pm',
+    VERSION_FROM     => $file,
+    ABSTRACT_FROM    => $file,
     PL_FILES         => {},
     @DEFINES,
     PREREQ_PM        => \%PREREQ_PM,
     MIN_PERL_VERSION => 5.008,
     META_MERGE       => \%META,
     dist             => {
-        PREOP    => 'pod2text lib/Lexical/Types.pm > $(DISTVNAME)/README',
+        PREOP    => "pod2text $file > \$(DISTVNAME)/README",
         COMPRESS => 'gzip -9f', SUFFIX => 'gz'
     },
     clean            => {