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