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