]> git.vpit.fr Git - perl/modules/Linux-SysInfo.git/blobdiff - Makefile.PL
Update .gitignore
[perl/modules/Linux-SysInfo.git] / Makefile.PL
index 708db536e93073299df0e0788f139da65788b8a1..76cd1a2f961499e8d0000ac9ad6617b91717acca 100644 (file)
@@ -2,15 +2,38 @@ use strict;
 use warnings;
 use ExtUtils::MakeMaker;
 
+die 'OS unsupported' unless $^O && $^O eq 'linux';
+
+my $BUILD_REQUIRES = {
+ 'ExtUtils::MakeMaker' => 0,
+ 'Test::More'          => 0,
+};  
+    
+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;
+}
+
 WriteMakefile(
-    NAME                => 'Linux::SysInfo',
-    AUTHOR              => 'Vincent Pit <perl@profvince.com>',
-    VERSION_FROM        => 'lib/Linux/SysInfo.pm',
-    ABSTRACT_FROM       => 'lib/Linux/SysInfo.pm',
-    PL_FILES            => {},
-    PREREQ_PM => {
-        'Test::More' => 0,
+    NAME          => 'Linux::SysInfo',
+    AUTHOR        => 'Vincent Pit <perl@profvince.com>',
+    LICENSE       => 'perl',
+    VERSION_FROM  => 'lib/Linux/SysInfo.pm',
+    ABSTRACT_FROM => 'lib/Linux/SysInfo.pm',
+    PL_FILES      => {},
+    PREREQ_PM     => {
+        'Exporter' => 0,
+        'XSLoader' => 0,
+    },
+    dist          => {
+        PREOP      => 'pod2text lib/Linux/SysInfo.pm > $(DISTVNAME)/README; '
+                      . build_req,
+        COMPRESS   => 'gzip -9f', SUFFIX => 'gz',
     },
-    dist                => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
-    clean               => { FILES => 'Linux-SysInfo-*' },
+    clean         => { FILES => 'Linux-SysInfo-* *.gcov *.gcda *.gcno cover_db' },
 );