Commit | Line | Data |
5cf6a81d |
1 | use strict; |
67830593 |
2 | use warnings; |
3 | |
6a204448 |
4 | use 5.006; |
5cf6a81d |
5 | use ExtUtils::MakeMaker; |
6 | (do 'maint/Makefile.PL.include' or die $@) unless -f 'META.yml'; |
7 | |
3ed8308a |
8 | my %BUILD_DEPS = ( |
9 | 'Test::More' => '0.88' |
cfb0d657 |
10 | ); |
dd634cf0 |
11 | |
3ed8308a |
12 | my %RUN_DEPS = ( |
13 | 'Exporter' => '5.58', |
5cf6a81d |
14 | ); |
3ed8308a |
15 | |
16 | my %META_BITS = ( |
17 | resources => { |
18 | homepage => 'http://search.cpan.org/dist/Sub-Exporter-Progressive/', |
19 | repository => 'git://git.shadowcat.co.uk/p5sagit/Sub-Exporter-Progressive.git', |
20 | bugtracker => 'http://rt.cpan.org/Public/Dist/Display.html?Name=Sub-Exporter-Progressive', |
21 | }, |
22 | requires => \%RUN_DEPS, |
23 | dynamic_config => 0, |
24 | ); |
25 | |
26 | my $mymeta_works = eval { ExtUtils::MakeMaker->VERSION('6.5707'); 1 }; |
27 | my $mymeta = $mymeta_works || eval { ExtUtils::MakeMaker->VERSION('6.5702'); 1 }; |
28 | |
29 | my %WriteMakefileArgs = ( |
30 | NAME => 'Sub-Exporter-Progressive', |
31 | VERSION_FROM => 'lib/Sub/Exporter/Progressive.pm', |
32 | ABSTRACT_FROM => 'lib/Sub/Exporter/Progressive.pm', |
33 | LICENSE => 'perl', |
34 | PREREQ_PM => { |
35 | %RUN_DEPS, |
36 | $mymeta_works ? () : (%BUILD_DEPS), |
37 | }, |
38 | |
39 | $mymeta_works |
40 | ? ( # BUILD_REQUIRES makes MYMETA right, requires stops META being wrong |
41 | 'BUILD_REQUIRES' => \%BUILD_DEPS, |
42 | 'META_ADD' => { |
43 | %META_BITS, |
44 | requires => \%RUN_DEPS, |
45 | }, |
46 | ) |
47 | : ( # META_ADD both to get META right - only Makefile written |
48 | 'META_ADD' => { |
49 | %META_BITS, |
50 | requires => \%RUN_DEPS, |
51 | build_requires => \%BUILD_DEPS, |
52 | }, |
53 | ) |
54 | , |
55 | |
56 | ($mymeta and !$mymeta_works) ? ( 'NO_MYMETA' => 1 ) : (), |
57 | ); |
58 | |
59 | unless ( eval { ExtUtils::MakeMaker->VERSION('6.56') } ) { |
60 | my $br = delete $WriteMakefileArgs{BUILD_REQUIRES}; |
61 | my $pp = $WriteMakefileArgs{PREREQ_PM}; |
62 | for my $mod ( keys %$br ) { |
63 | if ( exists $pp->{$mod} ) { |
64 | $pp->{$mod} = $br->{$mod} if $br->{$mod} > $pp->{$mod}; |
65 | } |
66 | else { |
67 | $pp->{$mod} = $br->{$mod}; |
68 | } |
69 | } |
70 | } |
71 | |
72 | delete $WriteMakefileArgs{CONFIGURE_REQUIRES} |
73 | unless eval { ExtUtils::MakeMaker->VERSION('6.52') }; |
74 | |
75 | WriteMakefile(%WriteMakefileArgs); |