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