[Moose-commits] r7772 - Class-MOP/trunk

autarch at code2.0beta.co.uk autarch at code2.0beta.co.uk
Sun Feb 22 16:18:13 GMT 2009


Author: autarch
Date: 2009-02-22 08:18:12 -0800 (Sun, 22 Feb 2009)
New Revision: 7772

Modified:
   Class-MOP/trunk/Makefile.PL
Log:
Switch back to Module::Install.

Add a conflict warning for Moose < 0.72


Modified: Class-MOP/trunk/Makefile.PL
===================================================================
--- Class-MOP/trunk/Makefile.PL	2009-02-22 16:04:16 UTC (rev 7771)
+++ Class-MOP/trunk/Makefile.PL	2009-02-22 16:18:12 UTC (rev 7772)
@@ -1,36 +1,71 @@
-# The perl/C checking voodoo is mostly stolen from Graham Barr's
-# Scalar-List-Utils distribution.
 use strict;
 use warnings;
+use inc::Module::Install;
+use 5.008001;
 
-use ExtUtils::MakeMaker;
-use Config qw(%Config);
-use File::Spec;
+check_conflicts();
 
-use 5.008;
+name 'Class-MOP';
+perl_version '5.008001';
+all_from 'lib/Class/MOP.pm';
+license 'perl';
 
-my %prereqs = (
-    'Scalar::Util'             => '1.18',
-    'Sub::Name'                => '0.04',
-    'Sub::Identify'            => '0.03',
-    'MRO::Compat'              => '0.05',
-    'Test::More'               => '0',
-    'Test::Exception'          => '0',
-    'File::Spec'               => '0',
-    'Carp'                     => '0',
-    'Devel::GlobalDestruction' => '0',
-    'Task::Weaken'             => '0',
-    'B'                        => '0',
-);
 
 my $ccflags = -d '.svn' || -d '.git' || $ENV{MAINTAINER_MODE} ? '-Wall' : '';
 
-WriteMakefile(
-    VERSION_FROM  => 'lib/Class/MOP.pm',
-    NAME          => 'Class::MOP',
-    PREREQ_PM     => \%prereqs,
-    CCFLAGS       => $ccflags,
-    ABSTRACT_FROM => 'lib/Class/MOP.pm',
-    AUTHOR        => 'Stevan Little <stevan at iinteractive.com>',
-    LICENSE       => 'perl',
-);
+requires 'Carp';
+requires 'Devel::GlobalDestruction';
+requires 'MRO::Compat' => '0.05';
+requires 'Scalar::Util'     => '1.18';
+requires 'Sub::Identify'    => '0.03';
+requires 'Sub::Name' => '0.04';
+requires 'Task::Weaken';
+
+test_requires 'File::Spec';
+test_requires 'Test::More'      => '0.77';
+test_requires 'Test::Exception' => '0.21';
+
+makemaker_args( CCFLAGS => $ccflags );
+
+WriteAll();
+
+# Use the cpan-smolder-stable script in the Moose svn root to figure
+# out what on CPAN will break with the latest Moose, then update this
+# before a release.
+sub check_conflicts {
+    my %conflicts = (
+        'Moose' => '0.71',
+    );
+
+    my $found = 0;
+    for my $mod ( sort keys %conflicts ) {
+        eval "require $mod";
+        next if $@;
+
+        my $installed = $mod->VERSION();
+        if ( $installed le $conflicts{$mod} ) {
+
+            print <<"EOF";
+
+***
+    This version of Class::MOP conflicts with the version of
+    $mod ($installed) you have installed.
+
+    You will need to upgrade $mod after installing
+    this version of Class::MOP.
+***
+
+EOF
+
+            $found = 1;
+        }
+    }
+
+    return unless $found;
+
+    # More or less copied from Module::Build
+    return if  $ENV{PERL_MM_USE_DEFAULT};
+    return unless -t STDIN && (-t STDOUT || !(-f STDOUT || -c STDOUT));
+
+    sleep 4;
+}




More information about the Moose-commits mailing list