Bumping version to 2.000006
[p5sagit/strictures.git] / Makefile.PL
CommitLineData
eae006ee 1use strict;
2use warnings FATAL => 'all';
2c87c763 3use 5.006;
b50be891 4use lib 'inc';
5use ExtUtils::HasCompiler 'can_compile_loadable_object';
394c3a46 6
2c87c763 7my $have_compiler
8 = ! parse_args()->{PUREPERL_ONLY}
b50be891 9 && can_compile_loadable_object(quiet => 1);
eae006ee 10
27826cd1 11my %extra_prereqs = (
12 indirect => 0,
13 multidimensional => 0,
14 'bareword::filehandles' => 0,
15);
ae3262c9 16
2c87c763 17my %META = (
18 name => 'strictures',
19 license => 'perl_5',
ed745a0b 20 dynamic_config => 1,
2c87c763 21 prereqs => {
22 configure => { requires => { } },
23 build => { requires => { } },
24 test => { requires => {
25 'Test::More' => 0,
26 } },
27 runtime => {
c4ddf87f 28 requires => {
29 perl => '5.006',
30 },
9098cf97 31 suggests => {
2c87c763 32 %extra_prereqs,
33 },
34 },
35 develop => { requires => {
2074d68b 36 'Test::Pod' => 0,
37 'Test::Pod::Coverage' => 0,
38 'Pod::Coverage::CountParents' => 0,
2c87c763 39 %extra_prereqs,
40 } },
41 },
42 resources => {
6dfac855 43 # GitHub mirrors from Shadowcat. We list it so we can get pull requests.
44 # The canonical repo is:
45 # r/o: git://git.shadowcat.co.uk/p5sagit/strictures.git
2c87c763 46 # r/w: p5sagit@git.shadowcat.co.uk:strictures.git
6dfac855 47 # web: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit/strictures.git
2c87c763 48 repository => {
6dfac855 49 url => 'https://github.com/p5sagit/strictures.git',
50 web => 'https://github.com/p5sagit/strictures',
2c87c763 51 type => 'git',
52 },
53 bugtracker => {
54 mailto => 'bug-strictures@rt.cpan.org',
55 web => 'https://rt.cpan.org/Public/Dist/Display.html?Name=strictures',
56 },
57 license => [ 'http://dev.perl.org/licenses/' ],
58 },
59 no_index => {
8b35a6f8 60 directory => [ 't', 'xt', 'inc' ]
2c87c763 61 },
f00a8587 62 x_authority => 'cpan:MSTROUT',
7a0f2103 63 x_contributors => [ # manually added, from git shortlog -e -s -n
64 'Graham Knop <haarg@haarg.org>',
65 'Karen Etheridge <ether@cpan.org>',
66 'Matt S Trout <mst@shadowcat.co.uk>',
67 'Peter Rabbitson <ribasushi@cpan.org>',
68 'Christian Walde <walde.christian@googlemail.com>',
69 'Diab Jerius <djerius@cfa.harvard.edu>',
70 ],
2c87c763 71);
72
73my %MM_ARGS = (
74 PREREQ_PM => {
e12af862 75 ("$]" >= 5.008004 && $have_compiler ? %extra_prereqs : () )
2c87c763 76 },
77);
78
ae3262c9 79sub parse_args {
80 # copied from EUMM
2c87c763 81 require ExtUtils::MakeMaker;
82 require Text::ParseWords;
ae3262c9 83 ExtUtils::MakeMaker::parse_args(
84 my $tmp = {},
85 Text::ParseWords::shellwords($ENV{PERL_MM_OPT} || ''),
86 @ARGV,
87 );
88 return $tmp->{ARGS} || {};
89}
90
18f7122e 91## BOILERPLATE ###############################################################
2c87c763 92require ExtUtils::MakeMaker;
0446b591 93(do './maint/Makefile.PL.include' or die $@) unless -f 'META.yml';
27826cd1 94
2c87c763 95# have to do this since old EUMM dev releases miss the eval $VERSION line
96my $eumm_version = eval $ExtUtils::MakeMaker::VERSION;
97my $mymeta = $eumm_version >= 6.57_02;
98my $mymeta_broken = $mymeta && $eumm_version < 6.57_07;
de111885 99
2c87c763 100($MM_ARGS{NAME} = $META{name}) =~ s/-/::/g;
101($MM_ARGS{VERSION_FROM} = "lib/$MM_ARGS{NAME}.pm") =~ s{::}{/}g;
18f7122e 102$META{license} = [ $META{license} ]
103 if $META{license} && !ref $META{license};
104$MM_ARGS{LICENSE} = $META{license}[0]
105 if $META{license} && $eumm_version >= 6.30;
2c87c763 106$MM_ARGS{NO_MYMETA} = 1
107 if $mymeta_broken;
108$MM_ARGS{META_ADD} = { 'meta-spec' => { version => 2 }, %META }
109 unless -f 'META.yml';
77f9ff76 110
2c87c763 111for (qw(configure build test runtime)) {
112 my $key = $_ eq 'runtime' ? 'PREREQ_PM' : uc $_.'_REQUIRES';
113 my $r = $MM_ARGS{$key} = {
2ef98edd 114 %{$META{prereqs}{$_}{requires} || {}},
2c87c763 115 %{delete $MM_ARGS{$key} || {}},
116 };
117 defined $r->{$_} or delete $r->{$_} for keys %$r;
118}
dfdfcbae 119
2c87c763 120$MM_ARGS{MIN_PERL_VERSION} = delete $MM_ARGS{PREREQ_PM}{perl} || 0;
5468e090 121
2c87c763 122delete $MM_ARGS{MIN_PERL_VERSION}
123 if $eumm_version < 6.47_01;
124$MM_ARGS{BUILD_REQUIRES} = {%{$MM_ARGS{BUILD_REQUIRES}}, %{delete $MM_ARGS{TEST_REQUIRES}}}
125 if $eumm_version < 6.63_03;
126$MM_ARGS{PREREQ_PM} = {%{$MM_ARGS{PREREQ_PM}}, %{delete $MM_ARGS{BUILD_REQUIRES}}}
127 if $eumm_version < 6.55_01;
128delete $MM_ARGS{CONFIGURE_REQUIRES}
129 if $eumm_version < 6.51_03;
130
131ExtUtils::MakeMaker::WriteMakefile(%MM_ARGS);
18f7122e 132## END BOILERPLATE ###########################################################