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

index 21d0cd99b0da3ab9592e747b1109c9e35f85867c..4c5cb7c2d604e45420a80fa7a7211b3360f73d4b 100644 (file)
@@ -6,6 +6,11 @@ use ExtUtils::MakeMaker;
 
 my $dist = 'Perl-Critic-Policy-Dynamic-NoIndirect';
 
+(my $name = $dist) =~ s{-}{::}g;
+
+(my $file = $dist) =~ s{-}{/}g;
+$file = "lib/$file.pm";
+
 my %PREREQ_PM = (
  'Carp'                        => 0,
  'Perl::Critic::Utils'         => 0,
@@ -34,17 +39,17 @@ my %META = (
 );
 
 WriteMakefile(
-    NAME             => 'Perl::Critic::Policy::Dynamic::NoIndirect',
+    NAME             => $name,
     AUTHOR           => 'Vincent Pit <perl@profvince.com>',
     LICENSE          => 'perl',
-    VERSION_FROM     => 'lib/Perl/Critic/Policy/Dynamic/NoIndirect.pm',
-    ABSTRACT_FROM    => 'lib/Perl/Critic/Policy/Dynamic/NoIndirect.pm',
+    VERSION_FROM     => $file,
+    ABSTRACT_FROM    => $file,
     PL_FILES         => {},
     PREREQ_PM        => \%PREREQ_PM,
     MIN_PERL_VERSION => 5.008,
     META_MERGE       => \%META,
     dist             => {
-        PREOP      => 'pod2text lib/Perl/Critic/Policy/Dynamic/NoIndirect.pm > $(DISTVNAME)/README',
+        PREOP      => "pod2text $file > \$(DISTVNAME)/README",
         COMPRESS   => 'gzip -9f', SUFFIX => 'gz'
     },
     clean            => {