Astro-SpaceTrack
view release on metacpan or search on metacpan
Makefile.PL view on Meta::CPAN
use 5.006002;
use strict;
use warnings;
use lib qw{ inc };
use My::Module::Meta;
use My::Module::Recommend;
use Config;
use ExtUtils::MakeMaker qw{WriteMakefile prompt};
use FileHandle;
use Getopt::Std;
my $meta = My::Module::Meta->new();
my %opt;
getopts ('ny', \%opt) or die <<'EOD';
The only legal options are
-n = answer all questions 'no'.
-y = answer all questions 'yes'.
You may not assert both of these at once - it's too confusing.
EOD
my @exe_files = map {"script/$_"} $meta->notice( \%opt );
( my $mmv = ExtUtils::MakeMaker->VERSION ) =~ s/_//g;
my %args = (
ABSTRACT => $meta->abstract(),
AUTHOR => $meta->author(),
DISTNAME => $meta->dist_name(),
EXE_FILES => \@exe_files,
NAME => $meta->module_name(),
PREREQ_PM => $meta->requires(),
PL_FILES => {}, # Prevent old MakeMaker from running Build.PL
realclean => {
FILES => join( ' ', @{ $meta->add_to_cleanup() } ),
},
VERSION_FROM => $meta->version_from(),
);
$mmv >= 6.31
and $args{LICENSE} = $meta->license();
if ( $mmv >= 6.4501 ) {
$args{META_ADD} = {
no_index => $meta->no_index(),
$meta->provides(),
};
$args{META_MERGE} = $meta->meta_merge();
}
$mmv >= 6.4701
and $args{MIN_PERL_VERSION} = $meta->requires_perl();
if ( $mmv >= 6.52 ) {
$args{BUILD_REQUIRES} = $meta->build_requires();
$args{CONFIGURE_REQUIRES} = $meta->configure_requires();
} elsif ( $mmv >= 6.5501 ) {
$args{BUILD_REQUIRES} = $meta->build_requires();
$args{META_MERGE}{configure_requires} = $meta->configure_requires();
} elsif ( $mmv >= 6.4501 ) {
$args{META_MERGE}{build_requires} = $meta->build_requires();
$args{META_MERGE}{configure_requires} = $meta->configure_requires();
} else {
foreach my $method ( qw{ configure_requires build_requires } ) {
my $req = $meta->$method();
foreach my $key ( keys %{ $req } ) {
exists $args{PREREQ_PM}{$key}
( run in 0.579 second using v1.01-cache-2.11-cpan-0b5f733616e )