ac2bc108fe7fc28abbcbd70ddbf0f172b61ba5ac
[catagits/Catalyst-Plugin-Static-Simple.git] / Makefile.PL
1 use strict;
2 use warnings;
3 use 5.006;
4
5 my %META = (
6   name => 'Catalyst-Plugin-Static-Simple',
7   license => 'perl_5',
8   prereqs => {
9     configure => { requires => {
10       'ExtUtils::MakeMaker' => 0,
11     } },
12     test => {
13       requires => {
14         'Test::More' => 0,
15       },
16     },
17     runtime => {
18       requires => {
19         'Catalyst::Runtime'     => '5.80008',
20         'MIME::Types'           => '2.03',
21         'Moose'                 => 0,
22         'MooseX::Types'         => 0,
23         'namespace::autoclean'  => 0,
24       },
25     },
26     develop => {
27       requires => {
28         'Test::NoTabs'        => 0,
29         'Test::Pod'           => '1.14',
30         'Test::Pod::Coverage' => '1.04',
31       },
32     },
33   },
34   resources => {
35     repository => {
36       url => 'git://git.shadowcat.co.uk/catagits/Catalyst-Plugin-Static-Simple.git',
37       web => 'http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits/Catalyst-Plugin-Static-Simple.git',
38       type => 'git',
39     },
40     bugtracker => {
41       web => 'https://rt.cpan.org/Public/Dist/Display.html?Name=Catalyst-Plugin-Static-Simple',
42       mailto => 'bug-Catalyst-Plugin-Static-Simple@rt.cpan.org',
43     },
44     license => [ 'http://dev.perl.org/licenses/' ],
45   },
46   no_index => {
47     directory => [ 't', 'xt' ]
48   },
49 );
50
51 my %MM_ARGS = ();
52
53 if (
54   eval { require Catalyst::Plugin::SubRequest }
55   && !eval { Catalyst::Plugin::SubRequest->VERSION(0.08) }
56 ) {
57   print "** WARNING **\n"
58       . "You appear to have a version of Catalyst::Plugin::SubRequest "
59       . "older than 0.08.\n"
60       . "You must upgrade to SubRequest 0.08 or later if you use it "
61       . "in any applications with Static::Simple.\n";
62   $MM_ARGS{PREREQ_PM}{'Catalyst::Plugin::SubRequest'} = '0.08';
63 }
64
65 ## BOILERPLATE ###############################################################
66 require ExtUtils::MakeMaker;
67 (do './maint/Makefile.PL.include' or die $@) unless -f 'META.yml';
68
69 # have to do this since old EUMM dev releases miss the eval $VERSION line
70 my $eumm_version  = eval $ExtUtils::MakeMaker::VERSION;
71 my $mymeta        = $eumm_version >= 6.57_02;
72 my $mymeta_broken = $mymeta && $eumm_version < 6.57_07;
73
74 ($MM_ARGS{NAME} = $META{name}) =~ s/-/::/g;
75 ($MM_ARGS{VERSION_FROM} = "lib/$MM_ARGS{NAME}.pm") =~ s{::}{/}g;
76 $META{license} = [ $META{license} ]
77   if $META{license} && !ref $META{license};
78 $MM_ARGS{LICENSE} = $META{license}[0]
79   if $META{license} && $eumm_version >= 6.30;
80 $MM_ARGS{NO_MYMETA} = 1
81   if $mymeta_broken;
82 $MM_ARGS{META_ADD} = { 'meta-spec' => { version => 2 }, %META }
83   unless -f 'META.yml';
84 $MM_ARGS{PL_FILES} ||= {};
85 $MM_ARGS{NORECURS} = 1
86   if not exists $MM_ARGS{NORECURS};
87
88 for (qw(configure build test runtime)) {
89   my $key = $_ eq 'runtime' ? 'PREREQ_PM' : uc $_.'_REQUIRES';
90   my $r = $MM_ARGS{$key} = {
91     %{$META{prereqs}{$_}{requires} || {}},
92     %{delete $MM_ARGS{$key} || {}},
93   };
94   defined $r->{$_} or delete $r->{$_} for keys %$r;
95 }
96
97 $MM_ARGS{MIN_PERL_VERSION} = delete $MM_ARGS{PREREQ_PM}{perl} || 0;
98
99 delete $MM_ARGS{MIN_PERL_VERSION}
100   if $eumm_version < 6.47_01;
101 $MM_ARGS{BUILD_REQUIRES} = {%{$MM_ARGS{BUILD_REQUIRES}}, %{delete $MM_ARGS{TEST_REQUIRES}}}
102   if $eumm_version < 6.63_03;
103 $MM_ARGS{PREREQ_PM} = {%{$MM_ARGS{PREREQ_PM}}, %{delete $MM_ARGS{BUILD_REQUIRES}}}
104   if $eumm_version < 6.55_01;
105 delete $MM_ARGS{CONFIGURE_REQUIRES}
106   if $eumm_version < 6.51_03;
107
108 ExtUtils::MakeMaker::WriteMakefile(%MM_ARGS);
109 ## END BOILERPLATE ###########################################################