5 use ExtUtils::MakeMaker;
7 my $mymeta_works = eval { ExtUtils::MakeMaker->VERSION('6.5707'); 1 };
8 my $mymeta = $mymeta_works || eval { ExtUtils::MakeMaker->VERSION('6.5702'); 1 };
11 'Test::More' => '0.88',
15 'Package::Stash' => '0.23',
18 my %OPT_RUN_DEPS = (can_cc() ? (
19 'B::Hooks::EndOfScope' => '0.07', # when changing, also change version in namespace/clean.pm
20 is_smoker() ? ( 'Devel::Hide' => 0 ) : (), # make sure we smoke the pure-perl version
25 homepage => 'http://search.cpan.org/dist/namespace-clean',
27 # EUMM not supporting nested meta :(
30 # url => 'git://git.shadowcat.co.uk/p5sagit/namespace-clean.git',
31 # web => 'http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit/namespace-clean.git',
34 # mailto => 'bug-namespace-clean@rt.cpan.org',
35 # web => 'http://rt.cpan.org/Public/Dist/Display.html?Name=namespace-clean',
38 repository => 'git://git.shadowcat.co.uk/p5sagit/namespace-clean.git',
39 bugtracker => 'http://rt.cpan.org/Public/Dist/Display.html?Name=namespace-clean',
43 my %WriteMakefileArgs = (
44 'NAME' => 'namespace::clean',
45 'VERSION_FROM' => 'lib/namespace/clean.pm',
46 'ABSTRACT' => 'Keep imports and functions out of your namespace',
47 'AUTHOR' => 'Robert \'phaylon\' Sedlacek <rs@474.at>, Florian Ragwitz <rafl@debian.org>, Jesse Luehrs <doy@tozt.net>',
50 %RUN_DEPS, %OPT_RUN_DEPS,
51 $mymeta_works ? () : (%BUILD_DEPS),
55 ? ( # BUILD_REQUIRES makes MYMETA right, requires stops META being wrong
56 'BUILD_REQUIRES' => \%BUILD_DEPS,
59 requires => \%RUN_DEPS,
62 : ( # META_ADD both to get META right - only Makefile written
65 requires => \%RUN_DEPS,
66 build_requires => \%BUILD_DEPS,
71 ($mymeta and !$mymeta_works) ? ( 'NO_MYMETA' => 1 ) : (),
77 unless ( eval { ExtUtils::MakeMaker->VERSION('6.56') } ) {
78 my $br = delete $WriteMakefileArgs{BUILD_REQUIRES};
79 my $pp = $WriteMakefileArgs{PREREQ_PM};
80 for my $mod ( keys %$br ) {
81 if ( exists $pp->{$mod} ) {
82 $pp->{$mod} = $br->{$mod} if $br->{$mod} > $pp->{$mod};
85 $pp->{$mod} = $br->{$mod};
90 delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
91 unless eval { ExtUtils::MakeMaker->VERSION('6.52') };
93 WriteMakefile(%WriteMakefileArgs);
96 # can we locate a (the) C compiler
98 my @chunks = split(/ /, $Config::Config{cc}) or return;
100 # $Config{cc} may contain args; try to find out the program part
102 return can_run("@chunks") || (pop(@chunks), next);
108 # check if we can run some command
112 return $cmd if -x $cmd;
113 if (my $found_cmd = MM->maybe_command($cmd)) {
117 for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') {
119 my $abs = File::Spec->catfile($dir, $cmd);
120 return $abs if (-x $abs or $abs = MM->maybe_command($abs));
127 return ( $ENV{AUTOMATED_TESTING} && ! $ENV{PERL5_CPANM_IS_RUNNING} && ! $ENV{RELEASE_TESTING} )