whitespace cleanup
[gitmo/Class-C3-XS.git] / Makefile.PL
CommitLineData
92f01312 1use strict;
2use warnings FATAL => 'all';
3use 5.006;
e646b627 4
92f01312 5my %META = (
6 name => 'Class-C3-XS',
7 license => 'perl_5',
8 prereqs => {
9 configure => { requires => {
10 'ExtUtils::MakeMaker' => 0,
11 } },
12 test => {
13 requires => {
14 'Test::More' => '0.47',
15 },
16 },
17 runtime => {
18 requires => {
19 'perl' => 5.006,
20 },
21 },
f2f4e3b2 22 develop => {
23 requires => {
24 'Test::Pod' => 1.14,
25 },
26 },
92f01312 27 },
28 resources => {
29 repository => {
30 url => 'git://git.shadowcat.co.uk/gitmo/Class-C3-XS.git',
31 web => 'http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo/Class-C3-XS.git',
32 type => 'git',
33 },
34 bugtracker => {
35 web => 'https://rt.cpan.org/Public/Dist/Display.html?Name=Class-C3-XS',
36 mailto => 'bug-Class-C3-XS@rt.cpan.org',
37 },
38 homepage => 'https://metacpan.org/release/Class-C3-XS',
39 license => [ 'http://dev.perl.org/licenses/' ],
40 },
41 no_index => {
42 directory => [ 't', 'xt' ]
43 },
44);
267c5382 45
92f01312 46my %MM_ARGS = ();
47
48## BOILERPLATE ###############################################################
49require ExtUtils::MakeMaker;
50(do 'maint/Makefile.PL.include' or die $@) unless -f 'META.yml';
51
52# have to do this since old EUMM dev releases miss the eval $VERSION line
53my $eumm_version = eval $ExtUtils::MakeMaker::VERSION;
54my $mymeta = $eumm_version >= 6.57_02;
55my $mymeta_broken = $mymeta && $eumm_version < 6.57_07;
56
57($MM_ARGS{NAME} = $META{name}) =~ s/-/::/g;
58($MM_ARGS{VERSION_FROM} = "lib/$MM_ARGS{NAME}.pm") =~ s{::}{/}g;
59$META{license} = [ $META{license} ]
60 if $META{license} && !ref $META{license};
61$MM_ARGS{LICENSE} = $META{license}[0]
62 if $META{license} && $eumm_version >= 6.30;
63$MM_ARGS{NO_MYMETA} = 1
64 if $mymeta_broken;
65$MM_ARGS{META_ADD} = { 'meta-spec' => { version => 2 }, %META }
66 unless -f 'META.yml';
67
68for (qw(configure build test runtime)) {
69 my $key = $_ eq 'runtime' ? 'PREREQ_PM' : uc $_.'_REQUIRES';
70 my $r = $MM_ARGS{$key} = {
71 %{$META{prereqs}{$_}{requires} || {}},
72 %{delete $MM_ARGS{$key} || {}},
73 };
74 defined $r->{$_} or delete $r->{$_} for keys %$r;
267c5382 75}
76
92f01312 77$MM_ARGS{MIN_PERL_VERSION} = delete $MM_ARGS{PREREQ_PM}{perl} || 0;
78
79delete $MM_ARGS{MIN_PERL_VERSION}
80 if $eumm_version < 6.47_01;
81$MM_ARGS{BUILD_REQUIRES} = {%{$MM_ARGS{BUILD_REQUIRES}}, %{delete $MM_ARGS{TEST_REQUIRES}}}
82 if $eumm_version < 6.63_03;
83$MM_ARGS{PREREQ_PM} = {%{$MM_ARGS{PREREQ_PM}}, %{delete $MM_ARGS{BUILD_REQUIRES}}}
84 if $eumm_version < 6.55_01;
85delete $MM_ARGS{CONFIGURE_REQUIRES}
86 if $eumm_version < 6.51_03;
87
88ExtUtils::MakeMaker::WriteMakefile(%MM_ARGS);
89## END BOILERPLATE ###########################################################