fix Makefile.PL when no . in @INC
[catagits/Catalyst-Plugin-Session.git] / Makefile.PL
1 use lib '.';
2 use inc::Module::Install 0.87;
3 use Module::Install::AuthorTests;
4
5 if ( -e 'MANIFEST.SKIP' ) {
6     system( 'pod2text lib/Catalyst/Plugin/Session.pm > README' )
7         and die("Could not run pod2text on lib/Catalyst/Plugin/Session.pm");
8 }
9
10 is_upgrading_needed();
11
12 perl_version '5.008';
13
14 name 'Catalyst-Plugin-Session';
15 all_from 'lib/Catalyst/Plugin/Session.pm';
16
17 requires 'Catalyst::Runtime' => '5.71001';
18 requires 'namespace::clean' => '0.10';
19 requires 'Digest';
20 requires 'File::Spec';
21 requires 'File::Temp';
22 requires 'List::Util';
23 requires 'Object::Signature';
24 requires 'MRO::Compat';
25 requires 'MooseX::Emulate::Class::Accessor::Fast' => '0.00801';
26 requires 'Moose' => '0.76';
27 requires 'HTML::Entities';
28
29 # an indirect dep. needs a certain version.
30 requires 'Tie::RefHash' => '1.34';
31
32 # for Test::Store
33 requires 'Test::More' => '0.88';
34
35 test_requires 'Test::Deep';
36 test_requires 'Test::Exception';
37 test_requires 'Test::WWW::Mechanize::PSGI';
38 resources repository => 'git://git.shadowcat.co.uk/catagits/Catalyst-Plugin-Session.git';
39
40 author_tests 't/author';
41
42 WriteAll;
43
44 sub is_upgrading_needed {
45     my %state = (
46         Cookie => 0.03,
47         URI    => 0.02,
48     );
49
50     foreach my $module (keys %state) {
51         my $package = 'Catalyst::Plugin::Session::State::' . $module;
52
53         next if not eval "require $package;";
54
55         if( not eval { $package->VERSION( $state{ $module } ); } ) {
56             warn <<WARN;
57 ********** NOTE **********
58
59 $package must also be updated!
60
61 The currently installed version is *not* compatible with this version of
62 Catalyst::Plugin::Session!
63
64 The updated versions have been added to the prerequisites.
65
66 **************************
67 WARN
68         }
69     }
70 }