add travis config
[p5sagit/Package-Variant.git] / Makefile.PL
1 use strict;
2 use warnings FATAL => 'all';
3
4 my %META = (
5   name => 'Package-Variant',
6   prereqs => {
7     test => { requires => {
8       'Test::Fatal' => '0',
9     }, },
10     runtime => { requires => {
11       'perl' => '5.006',
12       'strictures' => '2.000000',
13       'Carp' => '0',
14       'Import::Into' => '1.000000',
15       'Module::Runtime' => '0.013',
16     }, },
17   },
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',
29     },
30   },
31   no_index => { directory => [ 't', 'xt', ], package => [ 'string' ] },
32 );
33
34 my %MM_ARGS = ();
35
36 ## BOILERPLATE ###############################################################
37 require ExtUtils::MakeMaker;
38 (do './maint/Makefile.PL.include' or die $@) unless -f 'META.yml';
39
40 # have to do this since old EUMM dev releases miss the eval $VERSION line
41 my $eumm_version  = eval $ExtUtils::MakeMaker::VERSION;
42 my $mymeta        = $eumm_version >= 6.57_02;
43 my $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;
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;
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
56 for (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
67 delete $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;
73 delete $MM_ARGS{CONFIGURE_REQUIRES}
74   if $eumm_version < 6.51_03;
75
76 ExtUtils::MakeMaker::WriteMakefile(%MM_ARGS);
77 ## END BOILERPLATE ###########################################################