-
Notifications
You must be signed in to change notification settings - Fork 36
/
Build.PL
146 lines (135 loc) · 4.7 KB
/
Build.PL
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
142
143
144
145
146
use 5.006001;
use strict;
use lib 'lib'; # use our self to install
# bootstrap configure_requires prereqs
BEGIN { do './inc/bootstrap.pl' }
# We use Module::Build to test & install itself.
use Module::Build;
# <remove_me> This code is only present for M::B developers, not on CPAN
# A custom builder that does some special stuff during the 'dist' phase
use lib 'inc';
use ModuleBuildBuilder;
# </remove_me>
my $build = ModuleBuildBuilder->new(
module_name => 'Module::Build',
license => 'perl',
configure_requires => {
'CPAN::Meta' => '2.142060',
'Perl::OSType' => 1,
'Module::Metadata' => '1.000002',
'version' => '0.87',
'File::Spec' => '0.82',
'File::Copy' => 0,
'File::Basename' => 0,
'File::Path' => 0,
},
# 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::InstallPaths'=> 0.003,
'ExtUtils::Manifest' => 0,
'ExtUtils::Mkbootstrap' => 0,
'ExtUtils::ParseXS' => 2.21, # various bug fixes
'Cwd' => 0,
'Text::Abbrev' => 0,
'Text::ParseWords' => 0,
'Getopt::Long' => 0,
'TAP::Harness' => 3.29,
'CPAN::Meta' => '2.142060',
'Perl::OSType' => ( $^O eq 'bitrig' ? 1.004 : 1 ), # needs 1.0 API
'version' => 0.87, # No longer requires M::B
'Module::Metadata' => 1.000002, # uses version.pm
($^O eq 'MSWin32' ? ('ExtUtils::PL2Bat' => 0) : ())
},
test_requires => {
'File::Temp' => 0.15, # tmpdir() + fixes
'Test::More' => 0.49,
'TAP::Harness' => 3.29, # TAP::Harness::Env
'Parse::CPAN::Meta' => '1.4401',
'CPAN::Meta::YAML' => 0.003,
},
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 && $] < 5.011 ? '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.103009
},
},
PPM_support => {
description => "Generate PPM files for distributions",
},
inc_bundling_support => {
description => "Bundle Module::Build in inc/",
requires => {
'inc::latest' => 0.500, # split out from Module::Build
'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:[email protected]',
repository => 'https://github.com/Perl-Toolchain-Gang/Module-Build',
IRC => 'irc://irc.perl.org/#toolchain',
}
},
);
$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