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