Module::Install -> Distar
[p5sagit/Class-C3-Componentised.git] / Makefile.PL
CommitLineData
6ea99b11 1use strict;
2use warnings FATAL => 'all';
41fbb4f0 3use 5.006002;
20169807 4
6ea99b11 5my %META = (
6 name => 'Class-C3-Componentised',
7 license => 'perl_5',
8 prereqs => {
9 configure => { requires => {
10 'ExtUtils::MakeMaker' => 0,
11 } },
12 build => { requires => {
13 } },
14 test => {
15 requires => {
16 'Test::Exception' => '0.31',
17 'Test::More' => '0.96',
18 },
19 },
20 runtime => {
21 requires => {
22 'perl' => '5.006002',
23 'MRO::Compat' => '0.09',
24 'Class::Inspector' => '1.23',
25 # we don't actually need Class::C3. MRO::Compat loads it on 5.8. On 5.10
26 # it isn't needed. However, some existing code relies on us loading
27 # Class::C3. We don't want to break it just yet. Therefore we depend
28 # directly on Class::C3 as well.
29 'Class::C3' => '0.20',
30 },
31 },
32 },
33 resources => {
34 repository => {
35 url => 'git://git.shadowcat.co.uk/p5sagit/Class-C3-Componentised.git',
36 web => 'https://github.com/p5sagit/Class-C3-Componentised',
37 type => 'git',
38 },
39 bugtracker => {
40 web => 'https://rt.cpan.org/Public/Dist/Display.html?Name=Class-C3-Componentised',
41 mailto => 'bug-Class-C3-Componentised@rt.cpan.org',
42 },
43 license => [ 'http://dev.perl.org/licenses/' ],
44 },
45 no_index => {
46 directory => [ 't', 'xt' ]
47 },
48);
c5afd77d 49
6ea99b11 50my %MM_ARGS = ();
20169807 51
6ea99b11 52## BOILERPLATE ###############################################################
53require ExtUtils::MakeMaker;
54(do './maint/Makefile.PL.include' or die $@) unless -f 'META.yml';
d2b0e111 55
6ea99b11 56# have to do this since old EUMM dev releases miss the eval $VERSION line
57my $eumm_version = eval $ExtUtils::MakeMaker::VERSION;
58my $mymeta = $eumm_version >= 6.57_02;
59my $mymeta_broken = $mymeta && $eumm_version < 6.57_07;
06e2d102 60
6ea99b11 61($MM_ARGS{NAME} = $META{name}) =~ s/-/::/g;
62($MM_ARGS{VERSION_FROM} = "lib/$MM_ARGS{NAME}.pm") =~ s{::}{/}g;
63$META{license} = [ $META{license} ]
64 if $META{license} && !ref $META{license};
65$MM_ARGS{LICENSE} = $META{license}[0]
66 if $META{license} && $eumm_version >= 6.30;
67$MM_ARGS{NO_MYMETA} = 1
68 if $mymeta_broken;
69$MM_ARGS{META_ADD} = { 'meta-spec' => { version => 2 }, %META }
70 unless -f 'META.yml';
71$MM_ARGS{PL_FILES} ||= {};
72$MM_ARGS{NORECURS} = 1
73 if not exists $MM_ARGS{NORECURS};
4f07ebe6 74
6ea99b11 75for (qw(configure build test runtime)) {
76 my $key = $_ eq 'runtime' ? 'PREREQ_PM' : uc $_.'_REQUIRES';
77 my $r = $MM_ARGS{$key} = {
78 %{$META{prereqs}{$_}{requires} || {}},
79 %{delete $MM_ARGS{$key} || {}},
80 };
81 defined $r->{$_} or delete $r->{$_} for keys %$r;
4f07ebe6 82}
83
6ea99b11 84$MM_ARGS{MIN_PERL_VERSION} = delete $MM_ARGS{PREREQ_PM}{perl} || 0;
85
86delete $MM_ARGS{MIN_PERL_VERSION}
87 if $eumm_version < 6.47_01;
88$MM_ARGS{BUILD_REQUIRES} = {%{$MM_ARGS{BUILD_REQUIRES}}, %{delete $MM_ARGS{TEST_REQUIRES}}}
89 if $eumm_version < 6.63_03;
90$MM_ARGS{PREREQ_PM} = {%{$MM_ARGS{PREREQ_PM}}, %{delete $MM_ARGS{BUILD_REQUIRES}}}
91 if $eumm_version < 6.55_01;
92delete $MM_ARGS{CONFIGURE_REQUIRES}
93 if $eumm_version < 6.51_03;
4f07ebe6 94
6ea99b11 95ExtUtils::MakeMaker::WriteMakefile(%MM_ARGS);
96## END BOILERPLATE ###########################################################