| 1 | BEGIN { require 5.006; } | ||
| 2 | use strict; | ||
| 3 | |||
| 4 | use lib qw(lib); # use ourself if possible not the existing stuff. | ||
| 5 | |||
| 6 | # On Win32 things work better if Win32API::File is available. | ||
| 7 | # Activestate builds have it by default, but the core distro doesn't | ||
| 8 | # so we recommend it on Win32. | ||
| 9 | # | ||
| 10 | # * BUT * | ||
| 11 | # | ||
| 12 | # We can't recommend it on the release system as it then goes in the YAML.pl | ||
| 13 | # and then non-Win32 CPAN clients think they need it get upset when it fails | ||
| 14 | # to build on their system. | ||
| 15 | # | ||
| 16 | # Until CPAN and Module::Build and the other infrastructure has a better | ||
| 17 | # way to deal with this we assume UNIX when building a release. | ||
| 18 | # | ||
| 19 | # The pre-build stage will moan on Win32 anyway. | ||
| 20 | |||
| 21 | my $Recommend_Win32API_File = $ENV{USERNAME} ne 'demerphq' | ||
| 22 | && ($^O eq 'MSWin32' || $^O eq 'cygwin'); | ||
| 23 | |||
| 24 | use ExtUtils::MakeMaker; | ||
| 25 | |||
| 26 | WriteMakefile( | ||
| 27 | NAME => 'ExtUtils::Install', | ||
| 28 | AUTHOR => 'demerphq <yves@cpan.org>', | ||
| 29 | VERSION_FROM => 'lib/ExtUtils/Install.pm', | ||
| 30 | ABSTRACT => 'install files from here to there', | ||
| 31 | |||
| 32 | # This causes failure to locate ABSTRACT with DISTNAME below set to different name | ||
| 33 | # ABSTRACT_FROM => 'lib/ExtUtils/Install.pm', | ||
| 34 | |||
| 35 | DISTNAME => 'ExtUtils-Install', | ||
| 36 | PL_FILES => {}, # Avoid auto extracting 'Build.PL' | ||
| 37 | |||
| 38 | PREREQ_PM => { | ||
| 39 | # 'vars' => 0, | ||
| 40 | |||
| 41 | # 'AutoSplit' => 0, | ||
| 42 | # 'Exporter' => 0, | ||
| 43 | |||
| 44 | 'Carp' => 0, | ||
| 45 | # 'Config' => 0, | ||
| 46 | |||
| 47 | 'Cwd' => 0, | ||
| 48 | |||
| 49 | 'File::Basename' => 0, | ||
| 50 | 'File::Compare' => 0, | ||
| 51 | 'File::Copy' => 0, | ||
| 52 | 'File::Find' => 0, | ||
| 53 | 'File::Path' => 0, | ||
| 54 | 'File::Spec' => 0, | ||
| 55 | |||
| 56 | ($^O eq 'VMS' ? ('VMS::Filespec' => 0) : ()), | ||
| 57 | ($Recommend_Win32API_File ? ('Win32API::File' => 0) : ()), | ||
| 58 | |||
| 59 | 'ExtUtils::MakeMaker' => 0, | ||
| 60 | |||
| 61 | # 'Test::More' => 0, # This is bundled, but not in @INC for prereqs | ||
| 62 | }, | ||
| 63 | |||
| 64 | INSTALLDIRS => 'perl', # install into site not into lib. | ||
| 65 | |||
| 66 | #NO_META => 1, | ||
| 67 | |||
| 68 | dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, | ||
| 69 | clean => { FILES => 'ExtUtils-Install-*' }, | ||
| 70 | ); | ||
| 71 | |||
| 72 | { | ||
| 73 | package MY; | ||
| 74 | |||
| 75 | my($lib); | ||
| 76 | BEGIN { | ||
| 77 | $lib = File::Spec->canonpath('lib/'); | ||
| 78 | } | ||
| 79 | |||
| 80 | # Make sure PERLRUN uses the MakeMaker about to be installed | ||
| 81 | # and not the currently installed one. | ||
| 82 | sub init_PERL { | ||
| 83 | my($self) = shift; | ||
| 84 | $self->SUPER::init_PERL; | ||
| 85 | $self->{ABSPERLRUN} .= qq{ "-I$lib"}; | ||
| 86 | $self->{PERLRUN} .= qq{ "-I$lib"}; | ||
| 87 | $self->{FULLPERLRUN} .= qq{ "-I$lib"}; | ||
| 88 | } | ||
| 89 | } |