-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBuild.PL
66 lines (59 loc) · 1.41 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
#!/usr/bin/perl
use strict;
use warnings;
use Module::Build;
# Scan for TESTPORT argument
my $dpfile = "t/DefaultPort.pm";
my (@passargs, $serialPort);
if (@ARGV) {
foreach my $arg (@ARGV) {
my ($key,$value)=split /=/, $arg, 2;
if ($key eq "TESTPORT") {
$serialPort = $value;
}
else {
push(@passargs,$arg);
}
}
}
@ARGV=@passargs;
if ($serialPort) {
open (my $default, '>', $dpfile) or die "Can't create $dpfile: $!\n";
print $default <<EOF;
# Created by Build.PL
package DefaultPort;
\$Serial_Test_Port = "$serialPort";
EOF
close $default;
}
else {
unlink $dpfile if -e $dpfile;
print "\nTo enable serial port tests, use:\n";
print "\tperl Build.PL TESTPORT=<DEVICE>\n";
print "where <DEVICE> is the serial port to test with\n\n";
}
my $build = Module::Build->new(
module_name => 'Control::CLI',
license => 'perl',
requires => {
'Exporter' => 0,
'Term::ReadKey' => 0,
'Time::HiRes' => 0,
'IO::Handle' => 0,
'IO::Socket::INET' => 0,
perl => '5.6.0',
},
build_requires => {
'Net::Telnet' => 0,
'IO::Interactive' => 0,
},
configure_requires => { 'Module::Build' => 0.36 },
meta_merge => {
resources => {
repository => 'https://github.com/lgastevens/Control-CLI',
bugtracker => 'https://github.com/lgastevens/Control-CLI/issues',
# bugtracker => 'https://rt.cpan.org/Public/Dist/Display.html?Name=Control-CLI',
}
},
);
$build->create_build_script;