Bump CMOP dep
[gitmo/Moose.git] / Makefile.PL
1 use strict;
2 use warnings;
3 use inc::Module::Install 0.97;
4 use Module::Install::AuthorRequires;
5 use 5.008001;
6
7 check_broken_extratests();
8 check_conflicts();
9
10 name 'Moose';
11 perl_version '5.008001';
12 all_from 'lib/Moose.pm';
13 license 'perl';
14
15 requires 'Carp';
16 requires 'Class::MOP'       => '1.02';
17 requires 'Data::OptList'    => '0';
18 requires 'List::MoreUtils'  => '0.12';
19 requires 'Scalar::Util'     => '1.19';
20 requires 'Sub::Exporter'    => '0.980';
21 requires 'Sub::Name'        => '0';
22 requires 'Task::Weaken'     => '0';
23 requires 'Try::Tiny'        => '0.02';
24
25 test_requires 'Test::More'      => '0.88';
26 test_requires 'Test::Exception' => '0.27';
27
28 author_requires 'Test::Inline';
29 author_requires 'File::Find::Rule';
30 author_requires 'Module::Info';
31 author_requires 'Test::Spelling';
32 author_requires 'Test::Pod::Coverage';
33 author_requires 'Test::NoTabs';
34
35 if ( is_maintainer() ) {
36     system( $^X, 'author/extract-inline-tests' );
37 }
38
39 tests_recursive();
40
41 repository 'git://git.moose.perl.org/Moose.git';
42
43 WriteAll();
44
45 # Use the xt/author/test-my-dependents.t test to figure
46 # out what on CPAN will break with the latest Moose, then update this
47 # before a release.
48 sub check_conflicts {
49     my %conflicts = (
50         'Devel::REPL'                   => '1.003008',
51         'Fey::ORM'                      => '0.23',
52         'Catalyst'                      => '5.80017',
53         'MooseX::Aliases'               => '0.07',
54         'MooseX::AttributeHelpers'      => '0.22',
55         'MooseX::Attribute::Prototype'  => '0.10',
56         'MooseX::ClassAttribute'        => '0.09',
57         'MooseX::MethodAttributes'      => '0.18',
58         'MooseX::NonMoose'              => '0.07',
59         'MooseX::Params::Validate'      => '0.05',
60         'MooseX::Role::Cmd'             => '0.06',
61         'MooseX::Role::WithOverloading' => '0.04',
62         'MooseX::Singleton'             => '0.19',
63         'MooseX::StrictConstructor'     => '0.07',
64         'MooseX::Types'                 => '0.19',
65         'Pod::Elemental'                => '0.093280',
66         'namespace::autoclean'          => '0.08',
67         'KiokuDB'                       => '0.41',
68     );
69
70     my $found = 0;
71     for my $mod ( sort keys %conflicts ) {
72         eval "require $mod";
73         next if $@;
74
75         my $installed = $mod->VERSION();
76         if ( $installed le $conflicts{$mod} ) {
77
78             print <<"EOF";
79
80 ***
81     This version of Moose conflicts with the version of
82     $mod ($installed) you have installed.
83
84     You will need to upgrade $mod after installing
85     this version of Moose.
86 ***
87
88 EOF
89
90             $found = 1;
91         }
92     }
93
94     return unless $found;
95
96     # More or less copied from Module::Build
97     return if  $ENV{PERL_MM_USE_DEFAULT};
98     return unless -t STDIN && (-t STDOUT || !(-f STDOUT || -c STDOUT));
99
100     sleep 4;
101 }
102
103 sub is_maintainer {
104     return $Module::Install::AUTHOR || $ENV{IS_MAINTAINER};
105 }
106
107 sub check_broken_extratests {
108     return unless is_maintainer();
109
110     if ( exists $Module::Install::ExtraTests::{VERSION} && Module::Install::ExtraTests->VERSION < 0.007 ) {
111         print STDERR <<'EOR';
112 You have a broken version of Module::Install::ExtraTests installed.
113 Please upgrade to version 0.007 or newer and re-run Makefile.PL
114 EOR
115         exit 0;
116     }
117 }