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',
17 'B::Hooks::EndOfScope' => '0.07', # when changing, also change version in namespace/clean.pm
18 is_smoker() ? ( 'Devel::Hide' => 0 ) : (), # make sure we smoke the pure-perl version
24 homepage => 'http://search.cpan.org/dist/namespace-clean',
26 # EUMM not supporting nested meta :(
29 # url => 'git://git.shadowcat.co.uk/p5sagit/namespace-clean.git',
30 # web => 'http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit/namespace-clean.git',
33 # mailto => 'bug-namespace-clean@rt.cpan.org',
34 # web => 'http://rt.cpan.org/Public/Dist/Display.html?Name=namespace-clean',
37 repository => 'git://git.shadowcat.co.uk/p5sagit/namespace-clean.git',
38 bugtracker => 'http://rt.cpan.org/Public/Dist/Display.html?Name=namespace-clean',
42 my %WriteMakefileArgs = (
43 'NAME' => 'namespace::clean',
44 'VERSION_FROM' => 'lib/namespace/clean.pm',
45 'ABSTRACT' => 'Keep imports and functions out of your namespace',
46 'AUTHOR' => 'Robert \'phaylon\' Sedlacek <rs@474.at>, Florian Ragwitz <rafl@debian.org>, Jesse Luehrs <doy@tozt.net>',
50 $mymeta_works ? () : (%BUILD_DEPS),
54 ? ( # BUILD_REQUIRES makes MYMETA right, requires stops META being wrong
55 'BUILD_REQUIRES' => \%BUILD_DEPS,
58 requires => \%RUN_DEPS,
61 : ( # META_ADD both to get META right - only Makefile written
64 requires => \%RUN_DEPS,
65 build_requires => \%BUILD_DEPS,
70 ($mymeta and !$mymeta_works) ? ( 'NO_MYMETA' => 1 ) : (),
76 unless ( eval { ExtUtils::MakeMaker->VERSION('6.56') } ) {
77 my $br = delete $WriteMakefileArgs{BUILD_REQUIRES};
78 my $pp = $WriteMakefileArgs{PREREQ_PM};
79 for my $mod ( keys %$br ) {
80 if ( exists $pp->{$mod} ) {
81 $pp->{$mod} = $br->{$mod} if $br->{$mod} > $pp->{$mod};
84 $pp->{$mod} = $br->{$mod};
89 delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
90 unless eval { ExtUtils::MakeMaker->VERSION('6.52') };
92 WriteMakefile(%WriteMakefileArgs);
95 # can we locate a (the) C compiler
97 my @chunks = split(/ /, $Config::Config{cc}) or return;
99 # $Config{cc} may contain args; try to find out the program part
101 return can_run("@chunks") || (pop(@chunks), next);
107 # check if we can run some command
111 return $cmd if -x $cmd;
112 if (my $found_cmd = MM->maybe_command($cmd)) {
116 for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') {
118 my $abs = File::Spec->catfile($dir, $cmd);
119 return $abs if (-x $abs or $abs = MM->maybe_command($abs));
126 return ( $ENV{AUTOMATED_TESTING} && ! $ENV{PERL5_CPANM_IS_RUNNING} && ! $ENV{RELEASE_TESTING} )