-
Notifications
You must be signed in to change notification settings - Fork 0
/
.build.PL
43 lines (34 loc) · 1.37 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
use strict;
use warnings;
use Module::Build ##{ $meta2{prereqs}->{configure}->{requires}->{'Module::Build'} ##};
my $perl_ver = ##{ $meta2{prereqs}->{runtime}->{requires}->{perl} ##};
my $name = '##{ $zilla->name ##}'; $name =~ s{ - }{::}gmx;
my $prereqs = {
##{ $plugin->get_prereqs( 1 ) ##}
};
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 },
##{ $plugin->get_default('share_dir') ##}
)->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;
}