]> git.vpit.fr Git - perl/modules/Test-Valgrind.git/commitdiff
Use recent ExtUtils::MakeMaker features to generate a better META.yml
authorVincent Pit <vince@profvince.com>
Sat, 7 Feb 2009 21:20:51 +0000 (22:20 +0100)
committerVincent Pit <vince@profvince.com>
Sat, 7 Feb 2009 21:20:51 +0000 (22:20 +0100)
Makefile.PL

index 35f78dccc4a4d7b48299b4a47ef0ba4de0f16e84..993181d704a953ed35882fa9310510b8436152bd 100644 (file)
@@ -58,22 +58,27 @@ if ($cc) {
  print "none\n";
 }
 
-my $BUILD_REQUIRES = {
- 'ExtUtils::MakeMaker' => 0,
- 'File::Copy'          => 0,
- 'Test::More'          => 0,
- 'XSLoader'            => 0
-};
+my $dist = 'Test-Valgrind';
 
-sub build_req {
- my $tometa = ' >> $(DISTVNAME)/META.yml;';
- my $build_req = 'echo "build_requires:" ' . $tometa;
- foreach my $mod ( sort { lc $a cmp lc $b } keys %$BUILD_REQUIRES ) {
-  my $ver = $BUILD_REQUIRES->{$mod};
-  $build_req .= sprintf 'echo "    %-30s %s" %s', "$mod:", $ver, $tometa;
- }
- return $build_req;
-}
+my %META = (
+ configure_requires => {
+  'Config'              => 0,
+  'ExtUtils::MakeMaker' => 0,
+  'File::Spec'          => 0,
+ },
+ build_requires => {
+  'ExtUtils::MakeMaker' => 0,
+  'File::Copy'          => 0,
+  'Test::More'          => 0,
+  'XSLoader'            => 0
+ },
+ resources => {
+  bugtracker => "http://rt.cpan.org/NoAuth/ReportBug.html?Queue=$dist",
+  homepage   => "http://search.cpan.org/dist/$dist/",
+  license    => 'http://dev.perl.org/licenses/',
+  repository => "http://git.profvince.com/perl/modules/$dist.git",
+ },
+);
 
 my $supp = 'lib/Test/Valgrind/Suppressions';
 open my $tpl, '<', $supp . '.tpl' or die "open($supp.tpl): $!";
@@ -88,24 +93,24 @@ close $tpl;
 $supp = 'Test/Valgrind/perlTestValgrind.supp';
 
 WriteMakefile(
-    NAME          => 'Test::Valgrind',
-    AUTHOR        => 'Vincent Pit <perl@profvince.com>',
-    LICENSE       => 'perl',
-    VERSION_FROM  => 'lib/Test/Valgrind.pm',
-    ABSTRACT_FROM => 'lib/Test/Valgrind.pm',
-    PL_FILES      => {
+    NAME             => 'Test::Valgrind',
+    AUTHOR           => 'Vincent Pit <perl@profvince.com>',
+    LICENSE          => 'perl',
+    VERSION_FROM     => 'lib/Test/Valgrind.pm',
+    ABSTRACT_FROM    => 'lib/Test/Valgrind.pm',
+    PL_FILES         => {
         './Gensupp.PL'    => 'blib/archpub/' . $supp,
         './FixInstall.PL' => 'Makefile.bak',
     },
-    OPTIMIZE      => '-g',
-    PM            => {
+    OPTIMIZE         => '-g',
+    PM               => {
         'lib/Test/Valgrind.pm'
         => '$(INST_LIB)/Test/Valgrind.pm',
         'lib/Test/Valgrind/Suppressions.pm'
         => 'blib/archpub/Test/Valgrind/Suppressions.pm',
     },
-    C             => \@C,
-    PREREQ_PM     => {
+    C                => \@C,
+    PREREQ_PM        => {
         'Carp'                  => 0,
         'Exporter'              => 0,
         'Fcntl'                 => 0,
@@ -113,13 +118,16 @@ WriteMakefile(
         'Perl::Destruct::Level' => 0,
         'Test::Builder'         => 0,
     },
-    dist          => {
-        PREOP      => "touch lib/$supp; "
-                      . 'pod2text lib/Test/Valgrind.pm > $(DISTVNAME)/README; '
-                      . build_req,
-        COMPRESS   => 'gzip -9f', SUFFIX => 'gz',
+    MIN_PERL_VERSION => 5.006,
+    META_MERGE       => \%META,
+    dist             => {
+        PREOP    => "touch lib/$supp; "
+                    . 'pod2text lib/Test/Valgrind.pm > $(DISTVNAME)/README',
+        COMPRESS => 'gzip -9f', SUFFIX => 'gz',
+    },
+    clean            => {
+        FILES => "$dist-* lib/$supp Makefile.bak *.gcov *.gcda *.gcno cover_db Debian_CPANTS.txt"
     },
-    clean         => { FILES => "Test-Valgrind-* lib/$supp Makefile.bak *.gcov *.gcda *.gcno cover_db Debian_CPANTS.txt" },
 );
 1 while unlink 'lib/' . $supp;