Unfuck Makefile.PL
[catagits/Catalyst-Plugin-Session.git] / Makefile.PL
1 use inc::Module::Install 0.68;
2
3 if ( -e 'MANIFEST.SKIP' ) {
4     system( 'pod2text lib/Catalyst/Plugin/Session.pm > README' );
5 }
6
7 is_upgrading_needed();
8
9 perl_version '5.008';
10
11 name 'Catalyst-Plugin-Session';
12 all_from 'lib/Catalyst/Plugin/Session.pm';
13
14 requires 'Catalyst::Runtime' => '5.7010';
15 requires 'Digest';
16 requires 'File::Spec';
17 requires 'File::Temp';
18 requires 'Object::Signature';
19
20 # an indirect dep. needs a certain version.
21 requires 'Tie::RefHash' => '1.34';
22
23 # for Test::Store
24 requires 'Test::More';
25
26 test_requires 'Test::Deep';
27 test_requires 'Test::Exception';
28 test_requires 'Test::MockObject' => '1.01';
29
30 WriteAll;
31
32 sub is_upgrading_needed {
33     my %state = (
34         Cookie => 0.03,
35         URI    => 0.02,
36     );
37
38     foreach my $module (keys %state) {
39         if ( eval "require Catalyst::Plugin::Session::State::$module" and
40         ${"Catalyst::Plugin::Session::State::${module}::VERSION"} < $state{$module} ) {
41             warn <<WARN;
42
43 ********** NOTE **********
44
45 Catalyst::Plugin::Session::State::$module must also be updated!
46
47 The currently installed version is *not* compatible with this version of
48 Catalyst::Plugin::Session!
49
50 The updated versions have been added to the prerequisites.
51
52 **************************
53 WARN
54         }
55     }
56 }