-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBuild.PL
77 lines (67 loc) · 2.09 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
use strict;
use warnings;
use Module::Build 0.4004;
my $perl_ver = 5.010001;
my $name = 'HTML-StateTable'; $name =~ s{ - }{::}gmx;
my $prereqs = {
'build_requires' => {
'Module::Build' => '0.4004',
'version' => '0.88'
},
'configure_requires' => {
'Module::Build' => '0.4004',
'version' => '0.88'
},
'requires' => {
'HTML::Parser' => '3.76',
'HTML::Tiny' => '1.08',
'JSON::MaybeXS' => '1.004004',
'Module::Runtime' => '0.016',
'Moo' => '2.005005',
'MooX::HandlesVia' => '0.001008',
'Ref::Util' => '0.204',
'Sub::Exporter' => '0.987',
'Sub::Install' => '0.929',
'Text::CSV_XS' => '1.56',
'Try::Tiny' => '0.31',
'Type::Tiny' => '2.002001',
'Unexpected' => 'v1.0.1',
'namespace::autoclean' => '0.29',
'namespace::clean' => '0.27',
'perl' => '5.010001',
'strictures' => '2.000000'
},
'test_requires' => {
'File::Spec' => '0',
'Module::Build' => '0.4004',
'Module::Metadata' => '0',
'Sys::Hostname' => '0',
'Test::Requires' => '0.06',
'version' => '0.88'
},
};
my $testing = sub { $ENV{AUTOMATED_TESTING}
|| $ENV{PERL_CPAN_REPORTER_CONFIG}
|| $ENV{PERL5_CPANPLUS_IS_VERSION} };
my $whimper = sub { print {*STDOUT} $_[ 0 ]."\n"; exit 0 };
my $stop = sub {
$testing->() or $whimper->( $_[ 0 ] );
$prereqs->{build_requires} = { %{ $prereqs->{configure_requires} } };
$prereqs->{test_requires } = { %{ $prereqs->{configure_requires} } };
$prereqs->{test_requires }->{ 'Test::Requires' } = 0.06;
delete $prereqs->{requires};
};
# Not interested in reports below min perl ver
$] < $perl_ver and $stop->( "Minimum required Perl version is ${perl_ver}" );
Module::Build->subclass( code => do { local $/; <DATA> } )->new(
'module_name' => $name,
'notes' => { min_perl_version => $perl_ver, testing => $testing->() },
%{ $prereqs },
)->create_build_script;
exit 0;
__DATA__
sub _added_to_INC { # CVE-2016-1238
my $self = shift; my %seen;
for ($self->_default_INC) { $seen{ $_ }++ }
return grep { not $seen{ $_ }++ } $self->base_dir, @INC;
}