add travis config
[p5sagit/Package-Variant.git] / Makefile.PL
CommitLineData
eacc208a 1use strict;
2use warnings FATAL => 'all';
eacc208a 3
6f32ee73 4my %META = (
5 name => 'Package-Variant',
6 prereqs => {
7 test => { requires => {
f11ad9c9 8 'Test::Fatal' => '0',
6f32ee73 9 }, },
10 runtime => { requires => {
f11ad9c9 11 'perl' => '5.006',
fb6c1581 12 'strictures' => '2.000000',
f11ad9c9 13 'Carp' => '0',
14 'Import::Into' => '1.000000',
6f32ee73 15 'Module::Runtime' => '0.013',
16 }, },
485d5893 17 },
6f32ee73 18 dynamic_config => 0,
19 resources => {
20 # r/w: p5sagit@git.shadowcat.co.uk:Package-Variant.git
21 repository => {
22 url => 'git://git.shadowcat.co.uk/p5sagit/Package-Variant.git',
23 web => 'http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit/Package-Variant.git',
24 type => 'git',
25 },
26 bugtracker => {
27 mailto => 'bug-Package-Variant@rt.cpan.org',
28 web => 'https://rt.cpan.org/Public/Dist/Display.html?Name=Package-Variant',
49cc3b7c 29 },
30 },
6f32ee73 31 no_index => { directory => [ 't', 'xt', ], package => [ 'string' ] },
eacc208a 32);
6f32ee73 33
34my %MM_ARGS = ();
35
a206c5e9 36## BOILERPLATE ###############################################################
6f32ee73 37require ExtUtils::MakeMaker;
c44d55d4 38(do './maint/Makefile.PL.include' or die $@) unless -f 'META.yml';
6f32ee73 39
40# have to do this since old EUMM dev releases miss the eval $VERSION line
41my $eumm_version = eval $ExtUtils::MakeMaker::VERSION;
42my $mymeta = $eumm_version >= 6.57_02;
43my $mymeta_broken = $mymeta && $eumm_version < 6.57_07;
44
45($MM_ARGS{NAME} = $META{name}) =~ s/-/::/g;
46($MM_ARGS{VERSION_FROM} = "lib/$MM_ARGS{NAME}.pm") =~ s{::}{/}g;
a206c5e9 47$META{license} = [ $META{license} ]
48 if $META{license} && !ref $META{license};
49$MM_ARGS{LICENSE} = $META{license}[0]
50 if $META{license} && $eumm_version >= 6.30;
6f32ee73 51$MM_ARGS{NO_MYMETA} = 1
52 if $mymeta_broken;
53$MM_ARGS{META_ADD} = { 'meta-spec' => { version => 2 }, %META }
54 unless -f 'META.yml';
55
56for (qw(configure build test runtime)) {
57 my $key = $_ eq 'runtime' ? 'PREREQ_PM' : uc $_.'_REQUIRES';
58 my $r = $MM_ARGS{$key} = {
59 %{$META{prereqs}{$_}{requires} || {}},
60 %{delete $MM_ARGS{$key} || {}},
61 };
62 defined $r->{$_} or delete $r->{$_} for keys %$r;
63}
64
65$MM_ARGS{MIN_PERL_VERSION} = delete $MM_ARGS{PREREQ_PM}{perl} || 0;
66
67delete $MM_ARGS{MIN_PERL_VERSION}
68 if $eumm_version < 6.47_01;
69$MM_ARGS{BUILD_REQUIRES} = {%{$MM_ARGS{BUILD_REQUIRES}}, %{delete $MM_ARGS{TEST_REQUIRES}}}
70 if $eumm_version < 6.63_03;
71$MM_ARGS{PREREQ_PM} = {%{$MM_ARGS{PREREQ_PM}}, %{delete $MM_ARGS{BUILD_REQUIRES}}}
72 if $eumm_version < 6.55_01;
73delete $MM_ARGS{CONFIGURE_REQUIRES}
74 if $eumm_version < 6.51_03;
75
76ExtUtils::MakeMaker::WriteMakefile(%MM_ARGS);
a206c5e9 77## END BOILERPLATE ###########################################################