Some Makefile.PL fixes:
[scpubgit/System-Introspector.git] / Makefile.PL
1 use strict;
2 use warnings;
3
4 use ExtUtils::MakeMaker;
5
6 my %build_requires = (
7     'Test::More'        => 0,
8 );
9
10 my %requires = (
11     'Moo'                       => 0.009013,
12     'File::Path'                => 0,
13     'File::Basename'            => 0,
14     'Module::Metadata'          => 0,
15     'Module::Runtime'           => 0,
16     'Data::YAML::Writer'        => 0,
17     'Object::Remote'            => 0,
18     'Object::Remote::Future'    => 0,
19     'Config::General'           => 0,
20     'Pod::Usage'                => 0,
21     'Getopt::Long'              => 0,
22     'Digest::SHA'               => 0,
23     'strictures'                => 1,
24     'IPC::Run'                  => 0,
25     'Capture::Tiny'             => 0.12, # capture_stderr
26     'File::Tree::Snapshot'      => 0,
27     'Object::Remote'            => 0,
28     'JSON::Diffable'            => 0,
29 );
30
31 # have to do this since old EUMM dev releases miss the eval $VERSION line
32 my $mymeta_works = do { no warnings; $ExtUtils::MakeMaker::VERSION >= 6.5707 };
33 my $mymeta = do { no warnings; $ExtUtils::MakeMaker::VERSION >= 6.5702 };
34
35 WriteMakefile(
36   NAME => 'System-Introspector',
37   VERSION_FROM => 'lib/System/Introspector.pm',
38   PREREQ_PM => {
39     %requires,
40     ($mymeta_works ? () : (%build_requires)),
41   },
42   ($mymeta_works
43     ? ( # BUILD_REQUIRES makes MYMETA right, requires stops META being wrong
44         BUILD_REQUIRES => \%build_requires,
45         META_ADD => { requires => \%requires }
46       )
47     : ( # META_ADD both to get META right - only Makefile written
48         META_ADD => {
49           requires => \%requires,
50           build_requires => \%build_requires,
51         }
52       )
53   ),
54   ($mymeta && !$mymeta_works ? (NO_MYMETA => 1) : ()),
55   LICENSE => 'perl',
56   EXE_FILES => ['bin/system-introspector'],
57 );;