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

index 5febb76d4798c63ce7c64703559f6b88ad9c56f3..757785dc06b45182f068a2f3f7f85815608e7c45 100644 (file)
@@ -8,6 +8,11 @@ die 'OS unsupported' unless $^O && $^O eq 'linux';
 
 my $dist = 'Linux-SysInfo';
 
+(my $name = $dist) =~ s{-}{::}g;
+
+(my $file = $dist) =~ s{-}{/}g;
+$file = "lib/$file.pm";
+
 my %PREREQ_PM = (
  'Exporter' => 0,
  'XSLoader' => 0,
@@ -33,17 +38,17 @@ my %META = (
 );
 
 WriteMakefile(
-    NAME             => 'Linux::SysInfo',
+    NAME             => $name,
     AUTHOR           => 'Vincent Pit <perl@profvince.com>',
     LICENSE          => 'perl',
-    VERSION_FROM     => 'lib/Linux/SysInfo.pm',
-    ABSTRACT_FROM    => 'lib/Linux/SysInfo.pm',
+    VERSION_FROM     => $file,
+    ABSTRACT_FROM    => $file,
     PL_FILES         => {},
     PREREQ_PM        => \%PREREQ_PM,
     MIN_PERL_VERSION => 5.006,
     META_MERGE       => \%META,
     dist             => {
-        PREOP    => 'pod2text lib/Linux/SysInfo.pm > $(DISTVNAME)/README',
+        PREOP    => "pod2text $file > \$(DISTVNAME)/README",
         COMPRESS => 'gzip -9f', SUFFIX => 'gz',
     },
     clean            => {