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