1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141
|
use 5.006001;
use strict;
BEGIN {
die "CPANPLUS::Dist::Build version 0.08 or later is required to install Module::Build\n"
if $INC{'CPANPLUS/Dist/Build.pm'} && CPANPLUS::Dist::Build->VERSION lt '0.08';
}
# On some platforms (*ahem*, MacPerl 5.6.1) "use lib qw(lib);" doesn't
# find the local "lib" directory, so we use File::Spec to do it properly.
use File::Spec 0.82;
use lib File::Spec->catdir('lib'); # use our self to install
# XXX This doesn't carry over to sub processes
use lib File::Spec->catdir('t', 'bundled'); # use bundled modules
use lib File::Spec->catdir('t', 'lib'); # our utilities
# bootstrap configure_requires prereqs
BEGIN { do 'inc/bootstrap.pl' }
# We use Module::Build to test & install itself.
use Module::Build;
#
my $build = Module::Build->new(
module_name => 'Module::Build',
license => 'perl',
build_requires => {
'File::Temp' => 0.15, # tmpdir() + fixes
'Test::More' => 0.49,
'Test::Harness' => 3.16, # PERL5LIB fixes
'Parse::CPAN::Meta' => '1.4401',
'CPAN::Meta::YAML' => 0.003,
},
# KEEP 'requires' as low as possible and target Build/test/install
# Requirements for authors should be implemented as optional features
requires => {
'perl' => '5.006001',
'Data::Dumper' => 0,
'File::Basename' => 0,
'File::Compare' => 0,
'File::Copy' => 0,
'File::Find' => 0,
'File::Path' => 0,
'File::Spec' => ($^O eq 'MSWin32' ? 3.30 : '0.82'), # rel2abs()
'ExtUtils::CBuilder' => 0.27, # major platform fixes
'ExtUtils::Install' => 0,
'ExtUtils::Manifest' => 0,
'ExtUtils::Mkbootstrap' => 0,
'ExtUtils::ParseXS' => 2.21, # various bug fixes
'IO::File' => 0,
'Cwd' => 0,
'Text::Abbrev' => 0,
'Text::ParseWords' => 0,
'Getopt::Long' => 0,
'Test::Harness' => 0,
'CPAN::Meta' => '2.110420',
'Perl::OSType' => 1, # needs 1.0 API
'version' => 0.87, # No longer requires M::B
'Module::Metadata' => 1.000002, # uses version.pm
},
recommends => {
'ExtUtils::Install' => 0.30,
'ExtUtils::Manifest' => 1.54, # public maniskip()
},
recursive_test_files => 1,
sign => 0,
create_readme => 1,
create_license => 1,
# overwrite the M::B that shipped in core
installdirs => ($] >= 5.009004 ? 'core' : 'site'),
# Some CPANPLUS::Dist::Build versions need to allow mismatches
# On logic: thanks to Module::Install, CPAN.pm must set both keys, but
# CPANPLUS sets only the one
allow_mb_mismatch => (
$ENV{PERL5_CPANPLUS_IS_RUNNING} && ! $ENV{PERL5_CPAN_IS_RUNNING} ? 1 : 0
),
auto_features => {
dist_authoring => {
description => "Create new distributions",
requires => {
'Archive::Tar' => 1.09,
},
recommends => {
'Pod::Readme' => 0.04,
'Module::Signature' => 0.21,
},
},
license_creation => {
description => "Create licenses automatically in distributions",
requires => {
'Software::License' => 0,
},
},
PPM_support => {
description => "Generate PPM files for distributions",
requires => {'IO::File' => 1.13}, # binmode bug in older core IO::File
},
inc_bundling_support => {
description => "Bundle Module::Build in inc/",
requires => {
'ExtUtils::Install' => 1.54, # also gets us ExtUtils::Installed 1.999_001
'ExtUtils::Installed' => 1.999, # technically 1.999_001 is what's available
},
},
manpage_support => {
description => "Create Unix man pages",
requires => {'Pod::Man' => 0 },
},
HTML_support => {
description => "Create HTML documentation",
requires => {'Pod::Html' => 0},
},
},
add_to_cleanup => ['t/Sample/pod2htm*'],
script_files => ['bin/config_data'],
meta_merge => {
resources => {
MailingList => 'mailto:module-build@perl.org',
repository => 'https://github.com/Perl-Toolchain-Gang/Module-Build'
}
},
);
$build->create_build_script;
if (-f "META.yml" && ! -f "MYMETA.yml") { # fallback if we don't have CPAN::Meta
require File::Copy;
File::Copy::copy("META.yml", "MYMETA.yml") or warn "Error: $!\n";
if ( -f 'MYMETA.yml' ) {
warn "Copied META.yml to MYMETA.yml for bootstrapping\n";
}
else {
warn "Could not copy META.yml to MYMETA.yml. That's odd!\n";
}
}
# vim:ts=2:sw=2:et:sta
|