add Class::Load to dev prereqs
[scpubgit/Object-Remote.git] / Makefile.PL
1 use strict;
2 use warnings FATAL => 'all';
3 use 5.008;
4
5 my %META = (
6   name => 'Object-Remote',
7   license => 'perl_5',
8   prereqs => {
9     configure => { requires => {
10       'ExtUtils::MakeMaker'   => 0,
11     } },
12     build => { requires => {
13     } },
14     test => {
15       requires => {
16         'Test::More'  => '0.96',
17       },
18     },
19     runtime => {
20       requires => {
21         'Moo'                       => 1.006,
22         'Module::Runtime'           => 0,
23         'JSON::PP'                  => 0,
24         'Future'                    => 0.29,
25         'MRO::Compat'               => 0, # required to fatpack Moo
26         'Class::C3'                 => 0, # required to fatpack Moo
27         'Devel::GlobalDestruction'  => 0, # required to fatpack Moo
28         'String::ShellQuote'        => 0, # required for ssh argument manipulation
29         'Log::Contextual'           => 0.005000,
30         'strictures'                => 2,
31       },
32     },
33     develop   => {
34       requires => {
35         'Class::Load' => 0,
36       },
37     },
38   },
39   resources => {
40     repository => {
41       url => 'git://git.shadowcat.co.uk/scpubgit/Object-Remote.git',
42       # r/w: scpubgit@git.shadowcat.co.uk:Object-Remote.git
43       web => 'http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=scpubgit/Object-Remote.git',
44       type => 'git',
45     },
46     bugtracker => {
47       web => 'https://rt.cpan.org/Public/Dist/Display.html?Name=Object-Remote',
48       mailto => 'bug-Object-Remote@rt.cpan.org',
49     },
50     license => [ 'http://dev.perl.org/licenses/' ],
51   },
52   no_index => {
53     directory => [ 't', 'xt' ]
54   },
55   x_authority => 'cpan:MSTROUT',
56 );
57
58 my %MM_ARGS = (
59   EXE_FILES => [
60     'bin/object-remote-node',
61     'bin/object-remote-slave',
62     'bin/remoterepl',
63   ],
64 );
65
66 ## BOILERPLATE ###############################################################
67 require ExtUtils::MakeMaker;
68 (do './maint/Makefile.PL.include' or die $@) unless -f 'META.yml';
69
70 # have to do this since old EUMM dev releases miss the eval $VERSION line
71 my $eumm_version  = eval $ExtUtils::MakeMaker::VERSION;
72 my $mymeta        = $eumm_version >= 6.57_02;
73 my $mymeta_broken = $mymeta && $eumm_version < 6.57_07;
74
75 ($MM_ARGS{NAME} = $META{name}) =~ s/-/::/g;
76 ($MM_ARGS{VERSION_FROM} = "lib/$MM_ARGS{NAME}.pm") =~ s{::}{/}g;
77 $META{license} = [ $META{license} ]
78   if $META{license} && !ref $META{license};
79 $MM_ARGS{LICENSE} = $META{license}[0]
80   if $META{license} && $eumm_version >= 6.30;
81 $MM_ARGS{NO_MYMETA} = 1
82   if $mymeta_broken;
83 $MM_ARGS{META_ADD} = { 'meta-spec' => { version => 2 }, %META }
84   unless -f 'META.yml';
85 $MM_ARGS{PL_FILES} ||= {};
86 $MM_ARGS{NORECURS} = 1
87   if not exists $MM_ARGS{NORECURS};
88
89 for (qw(configure build test runtime)) {
90   my $key = $_ eq 'runtime' ? 'PREREQ_PM' : uc $_.'_REQUIRES';
91   my $r = $MM_ARGS{$key} = {
92     %{$META{prereqs}{$_}{requires} || {}},
93     %{delete $MM_ARGS{$key} || {}},
94   };
95   defined $r->{$_} or delete $r->{$_} for keys %$r;
96 }
97
98 $MM_ARGS{MIN_PERL_VERSION} = delete $MM_ARGS{PREREQ_PM}{perl} || 0;
99
100 delete $MM_ARGS{MIN_PERL_VERSION}
101   if $eumm_version < 6.47_01;
102 $MM_ARGS{BUILD_REQUIRES} = {%{$MM_ARGS{BUILD_REQUIRES}}, %{delete $MM_ARGS{TEST_REQUIRES}}}
103   if $eumm_version < 6.63_03;
104 $MM_ARGS{PREREQ_PM} = {%{$MM_ARGS{PREREQ_PM}}, %{delete $MM_ARGS{BUILD_REQUIRES}}}
105   if $eumm_version < 6.55_01;
106 delete $MM_ARGS{CONFIGURE_REQUIRES}
107   if $eumm_version < 6.51_03;
108
109 ExtUtils::MakeMaker::WriteMakefile(%MM_ARGS);
110 ## END BOILERPLATE ###########################################################