]> git.vpit.fr Git - perl/modules/with.git/blobdiff - Makefile.PL
Build the $name and the main $file from $dist
[perl/modules/with.git] / Makefile.PL
index eee03c048ea51748bf74c7ae24f3fa83c8d9046e..66203b0caa268e5c9626034ef161082da33be086 100644 (file)
@@ -6,6 +6,19 @@ use ExtUtils::MakeMaker;
 
 my $dist = 'with';
 
+(my $name = $dist) =~ s{-}{::}g;
+
+(my $file = $dist) =~ s{-}{/}g;
+$file = "lib/$file.pm";
+
+my %PREREQ_PM = (
+ 'Carp'                 => 0,
+ 'Filter::Util::Call'   => 0,
+ 'Scalar::Util'         => 0,
+ 'Sub::Prototype::Util' => '0.08',
+ 'Text::Balanced'       => 0,
+);
+
 my %META = (
  configure_requires => {
   'ExtUtils::MakeMaker' => 0,
@@ -13,6 +26,7 @@ my %META = (
  build_requires => {
   'ExtUtils::MakeMaker' => 0,
   'Test::More'          => 0,
+  %PREREQ_PM,
  },
  dynamic_config => 0,
  resources => {
@@ -24,23 +38,17 @@ my %META = (
 );
 
 WriteMakefile(
-    NAME             => 'with',
+    NAME             => $name,
     AUTHOR           => 'Vincent Pit <perl@profvince.com>',
     LICENSE          => 'perl',
-    VERSION_FROM     => 'lib/with.pm',
-    ABSTRACT_FROM    => 'lib/with.pm',
+    VERSION_FROM     => $file,
+    ABSTRACT_FROM    => $file,
     PL_FILES         => {},
-    PREREQ_PM        => {
-        'Carp'                 => 0,
-        'Filter::Util::Call'   => 0,
-        'Scalar::Util'         => 0,
-        'Sub::Prototype::Util' => 0.08,
-        'Text::Balanced'       => 0,
-    },
+    PREREQ_PM        => \%PREREQ_PM,
     MIN_PERL_VERSION => 5.009004,
     META_MERGE       => \%META,
     dist             => {
-        PREOP    => 'pod2text lib/with.pm > $(DISTVNAME)/README',
+        PREOP    => "pod2text $file > \$(DISTVNAME)/README",
         COMPRESS => 'gzip -9f', SUFFIX => 'gz'
     },
     clean            => {