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