Commit | Line | Data |
eae006ee |
1 | use strict; |
2 | use warnings FATAL => 'all'; |
2c87c763 |
3 | use 5.006; |
394c3a46 |
4 | |
2c87c763 |
5 | my $have_compiler |
6 | = ! parse_args()->{PUREPERL_ONLY} |
7 | && eval { require ExtUtils::CBuilder; 1 } |
8 | && ExtUtils::CBuilder->new->have_compiler; |
eae006ee |
9 | |
27826cd1 |
10 | my %extra_prereqs = ( |
11 | indirect => 0, |
12 | multidimensional => 0, |
13 | 'bareword::filehandles' => 0, |
14 | ); |
ae3262c9 |
15 | |
2c87c763 |
16 | my %META = ( |
17 | name => 'strictures', |
18 | license => 'perl_5', |
19 | prereqs => { |
20 | configure => { requires => { } }, |
21 | build => { requires => { } }, |
22 | test => { requires => { |
23 | 'Test::More' => 0, |
24 | } }, |
25 | runtime => { |
c4ddf87f |
26 | requires => { |
27 | perl => '5.006', |
28 | }, |
2c87c763 |
29 | recommends => { |
30 | %extra_prereqs, |
31 | }, |
32 | }, |
33 | develop => { requires => { |
2074d68b |
34 | 'Test::Pod' => 0, |
35 | 'Test::Pod::Coverage' => 0, |
36 | 'Pod::Coverage::CountParents' => 0, |
2c87c763 |
37 | %extra_prereqs, |
38 | } }, |
39 | }, |
40 | resources => { |
41 | # r/w: p5sagit@git.shadowcat.co.uk:strictures.git |
42 | repository => { |
43 | url => 'git://git.shadowcat.co.uk/p5sagit/strictures.git', |
44 | web => 'http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit/strictures.git', |
45 | type => 'git', |
46 | }, |
47 | bugtracker => { |
48 | mailto => 'bug-strictures@rt.cpan.org', |
49 | web => 'https://rt.cpan.org/Public/Dist/Display.html?Name=strictures', |
50 | }, |
51 | license => [ 'http://dev.perl.org/licenses/' ], |
52 | }, |
53 | no_index => { |
54 | directory => [ 't', 'xt' ] |
55 | }, |
56 | ); |
57 | |
58 | my %MM_ARGS = ( |
59 | PREREQ_PM => { |
60 | ($] >= 5.008004 && $have_compiler ? %extra_prereqs : () ) |
61 | }, |
62 | ); |
63 | |
ae3262c9 |
64 | sub parse_args { |
65 | # copied from EUMM |
2c87c763 |
66 | require ExtUtils::MakeMaker; |
67 | require Text::ParseWords; |
ae3262c9 |
68 | ExtUtils::MakeMaker::parse_args( |
69 | my $tmp = {}, |
70 | Text::ParseWords::shellwords($ENV{PERL_MM_OPT} || ''), |
71 | @ARGV, |
72 | ); |
73 | return $tmp->{ARGS} || {}; |
74 | } |
75 | |
18f7122e |
76 | ## BOILERPLATE ############################################################### |
2c87c763 |
77 | require ExtUtils::MakeMaker; |
78 | (do 'maint/Makefile.PL.include' or die $@) unless -f 'META.yml'; |
27826cd1 |
79 | |
2c87c763 |
80 | # have to do this since old EUMM dev releases miss the eval $VERSION line |
81 | my $eumm_version = eval $ExtUtils::MakeMaker::VERSION; |
82 | my $mymeta = $eumm_version >= 6.57_02; |
83 | my $mymeta_broken = $mymeta && $eumm_version < 6.57_07; |
de111885 |
84 | |
2c87c763 |
85 | ($MM_ARGS{NAME} = $META{name}) =~ s/-/::/g; |
86 | ($MM_ARGS{VERSION_FROM} = "lib/$MM_ARGS{NAME}.pm") =~ s{::}{/}g; |
18f7122e |
87 | $META{license} = [ $META{license} ] |
88 | if $META{license} && !ref $META{license}; |
89 | $MM_ARGS{LICENSE} = $META{license}[0] |
90 | if $META{license} && $eumm_version >= 6.30; |
2c87c763 |
91 | $MM_ARGS{NO_MYMETA} = 1 |
92 | if $mymeta_broken; |
93 | $MM_ARGS{META_ADD} = { 'meta-spec' => { version => 2 }, %META } |
94 | unless -f 'META.yml'; |
77f9ff76 |
95 | |
2c87c763 |
96 | for (qw(configure build test runtime)) { |
97 | my $key = $_ eq 'runtime' ? 'PREREQ_PM' : uc $_.'_REQUIRES'; |
98 | my $r = $MM_ARGS{$key} = { |
2ef98edd |
99 | %{$META{prereqs}{$_}{requires} || {}}, |
2c87c763 |
100 | %{delete $MM_ARGS{$key} || {}}, |
101 | }; |
102 | defined $r->{$_} or delete $r->{$_} for keys %$r; |
103 | } |
dfdfcbae |
104 | |
2c87c763 |
105 | $MM_ARGS{MIN_PERL_VERSION} = delete $MM_ARGS{PREREQ_PM}{perl} || 0; |
5468e090 |
106 | |
2c87c763 |
107 | delete $MM_ARGS{MIN_PERL_VERSION} |
108 | if $eumm_version < 6.47_01; |
109 | $MM_ARGS{BUILD_REQUIRES} = {%{$MM_ARGS{BUILD_REQUIRES}}, %{delete $MM_ARGS{TEST_REQUIRES}}} |
110 | if $eumm_version < 6.63_03; |
111 | $MM_ARGS{PREREQ_PM} = {%{$MM_ARGS{PREREQ_PM}}, %{delete $MM_ARGS{BUILD_REQUIRES}}} |
112 | if $eumm_version < 6.55_01; |
113 | delete $MM_ARGS{CONFIGURE_REQUIRES} |
114 | if $eumm_version < 6.51_03; |
115 | |
116 | ExtUtils::MakeMaker::WriteMakefile(%MM_ARGS); |
18f7122e |
117 | ## END BOILERPLATE ########################################################### |