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 $b_h_eos_req in namespace/clean.pm
21 # these pieces are needed if using the debugger on the perl range
22 ($] > 5.008_008_9 && $] < 5.013_005_1)
23 ? ( 'Sub::Name' => '0.04', 'Sub::Identify' => '0.04' ) # when changing, also change $sn_ver and $si_ver in namespace/clean.pm
27 # make sure we smoke the pure-perl version
28 is_smoker() ? ( 'Devel::Hide' => 0 ) : (),
33 homepage => 'http://search.cpan.org/dist/namespace-clean',
35 # EUMM not supporting nested meta :(
38 # url => 'git://git.shadowcat.co.uk/p5sagit/namespace-clean.git',
39 # web => 'http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit/namespace-clean.git',
42 # mailto => 'bug-namespace-clean@rt.cpan.org',
43 # web => 'http://rt.cpan.org/Public/Dist/Display.html?Name=namespace-clean',
46 repository => 'git://git.shadowcat.co.uk/p5sagit/namespace-clean.git',
47 bugtracker => 'http://rt.cpan.org/Public/Dist/Display.html?Name=namespace-clean',
51 my %WriteMakefileArgs = (
52 'NAME' => 'namespace::clean',
53 'VERSION_FROM' => 'lib/namespace/clean.pm',
54 'ABSTRACT' => 'Keep imports and functions out of your namespace',
55 'AUTHOR' => 'Robert \'phaylon\' Sedlacek <rs@474.at>, Florian Ragwitz <rafl@debian.org>, Jesse Luehrs <doy@tozt.net>',
58 %RUN_DEPS, %OPT_RUN_DEPS,
59 $mymeta_works ? () : (%BUILD_DEPS),
63 ? ( # BUILD_REQUIRES makes MYMETA right, requires stops META being wrong
64 'BUILD_REQUIRES' => \%BUILD_DEPS,
67 requires => \%RUN_DEPS,
70 : ( # META_ADD both to get META right - only Makefile written
73 requires => \%RUN_DEPS,
74 build_requires => \%BUILD_DEPS,
79 ($mymeta and !$mymeta_works) ? ( 'NO_MYMETA' => 1 ) : (),
85 unless ( eval { ExtUtils::MakeMaker->VERSION('6.56') } ) {
86 my $br = delete $WriteMakefileArgs{BUILD_REQUIRES};
87 my $pp = $WriteMakefileArgs{PREREQ_PM};
88 for my $mod ( keys %$br ) {
89 if ( exists $pp->{$mod} ) {
90 $pp->{$mod} = $br->{$mod} if $br->{$mod} > $pp->{$mod};
93 $pp->{$mod} = $br->{$mod};
98 delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
99 unless eval { ExtUtils::MakeMaker->VERSION('6.52') };
101 WriteMakefile(%WriteMakefileArgs);
104 # can we locate a (the) C compiler
106 my @chunks = split(/ /, $Config::Config{cc}) or return;
108 # $Config{cc} may contain args; try to find out the program part
110 return can_run("@chunks") || (pop(@chunks), next);
116 # check if we can run some command
120 return $cmd if -x $cmd;
121 if (my $found_cmd = MM->maybe_command($cmd)) {
125 for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') {
127 my $abs = File::Spec->catfile($dir, $cmd);
128 return $abs if (-x $abs or $abs = MM->maybe_command($abs));
135 return ( $ENV{AUTOMATED_TESTING} && ! $ENV{PERL5_CPANM_IS_RUNNING} && ! $ENV{RELEASE_TESTING} )