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

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