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