No need for Sub::Identify
[gitmo/Class-MOP.git] / Makefile.PL
CommitLineData
591a9381 1use strict;
2use warnings;
89dc39a9 3use inc::Module::Install;
4use 5.008001;
5
6check_conflicts();
7
8name 'Class-MOP';
9perl_version '5.008001';
10all_from 'lib/Class/MOP.pm';
11license 'perl';
591a9381 12
e896822d 13
4bfa5ddb 14my $ccflags = -d '.svn' || -d '.git' || $ENV{MAINTAINER_MODE} ? '-Wall' : '';
f125b31e 15
89dc39a9 16requires 'Carp';
17requires 'Devel::GlobalDestruction';
18requires 'MRO::Compat' => '0.05';
19requires 'Scalar::Util' => '1.18';
89dc39a9 20requires 'Sub::Name' => '0.04';
21requires 'Task::Weaken';
22
23test_requires 'File::Spec';
24test_requires 'Test::More' => '0.77';
25test_requires 'Test::Exception' => '0.21';
26
27makemaker_args( CCFLAGS => $ccflags );
28
29WriteAll();
30
31# Use the cpan-smolder-stable script in the Moose svn root to figure
32# out what on CPAN will break with the latest Moose, then update this
33# before a release.
34sub check_conflicts {
35 my %conflicts = (
36 'Moose' => '0.71',
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 Class::MOP 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 Class::MOP.
55***
56
57EOF
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}