require latest CMOP
[gitmo/Moose.git] / Makefile.PL
1 use strict;
2 use warnings;
3 use inc::Module::Install;
4 use 5.008001;
5
6 check_conflicts();
7
8 name 'Moose';
9 perl_version '5.008001';
10 all_from 'lib/Moose.pm';
11 license 'perl';
12
13 requires 'Scalar::Util'     => '1.19';
14 requires 'Carp';
15 requires 'Class::MOP'       => '0.77';
16 requires 'List::MoreUtils'  => '0.12';
17 requires 'Sub::Exporter'    => '0.972';
18 requires 'Task::Weaken'     => '0';
19
20 test_requires 'Test::More'      => '0.77';
21 test_requires 'Test::Exception' => '0.21';
22
23 tests_recursive();
24
25 WriteAll();
26
27 # Use the cpan-smolder-stable script in the Moose svn root to figure
28 # out what on CPAN will break with the latest Moose, then update this
29 # before a release.
30 sub check_conflicts {
31     my %conflicts = (
32         'MooseX::Singleton'        => '0.12',
33         'MooseX::Params::Validate' => '0.05',
34         'Fey::ORM'                 => '0.12',
35     );
36
37     my $found = 0;
38     for my $mod ( sort keys %conflicts ) {
39         eval "require $mod";
40         next if $@;
41
42         my $installed = $mod->VERSION();
43         if ( $installed le $conflicts{$mod} ) {
44
45             print <<"EOF";
46
47 ***
48     This version of Moose conflicts with the version of
49     $mod ($installed) you have installed.
50
51     You will need to upgrade $mod after installing
52     this version of Moose.
53 ***
54
55 EOF
56
57             $found = 1;
58         }
59     }
60
61     return unless $found;
62
63     # More or less copied from Module::Build
64     return if  $ENV{PERL_MM_USE_DEFAULT};
65     return unless -t STDIN && (-t STDOUT || !(-f STDOUT || -c STDOUT));
66
67     sleep 4;
68 }