X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;ds=sidebyside;f=Makefile.PL;h=69df46f6691b65c2dc19bf6f200b31b7579566b6;hb=16cf6511b8bf77f46158bde5a232dbc1163ba9ec;hp=cf1da637c0d444da9c86297b591f362ab2c435f4;hpb=11e5f2a7b384d99ffcc265c3f684983e47d6886c;p=perl%2Fmodules%2FLinux-SysInfo.git diff --git a/Makefile.PL b/Makefile.PL index cf1da63..69df46f 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -2,6 +2,23 @@ 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 ', @@ -11,11 +28,11 @@ WriteMakefile( PL_FILES => {}, PREREQ_PM => { 'Exporter' => 0, - 'Test::More' => 0, 'XSLoader' => 0, }, dist => { - PREOP => 'pod2text lib/Linux/SysInfo.pm > $(DISTVNAME)/README', + PREOP => 'pod2text lib/Linux/SysInfo.pm > $(DISTVNAME)/README; ' + . build_req, COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, clean => { FILES => 'Linux-SysInfo-*' },