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