Annotation of trango/Net-Telnet-Trango/Build.PL, Revision 1.8
1.1 andrew 1: use strict;
2: use warnings;
3: use Module::Build;
1.3 andrew 4: use File::Spec;
1.8 ! andrew 5: # $RedRiver: Build.PL,v 1.7 2007/02/06 20:41:10 andrew Exp $
1.2 andrew 6:
1.4 andrew 7: my $cfg_file = File::Spec->catfile('t', 'tests.cfg');
1.1 andrew 8:
9: my $builder = Module::Build->new(
10: module_name => 'Net::Telnet::Trango',
11: license => 'perl',
12: dist_author => 'Andrew Fresh <andrew@cpan.org>',
13: dist_version_from => 'lib/Net/Telnet/Trango.pm',
1.8 ! andrew 14: requires => {
! 15: 'perl' => '5.6.1',
! 16: 'Net::Telnet' => '0',
! 17: },
1.1 andrew 18: build_requires => {
19: 'Test::More' => 0,
20: },
1.2 andrew 21: add_to_cleanup => [ 'Net-Telnet-Trango-*', $cfg_file ],
1.4 andrew 22: create_makefile_pl => 'traditional',
23: create_readme => 1,
24: create_html => 1,
25: dynamic_config => 1,
26: auto_features => {
27: YAML_support =>
28: {
29: description => "Use YAML.pm to write META.yml files",
30: requires => { YAML => ' >= 0.35, != 0.49_01 ' },
31: },
32: manpage_support =>
33: {
34: description => "Create Unix man pages",
35: requires => { 'Pod::Man' => 0 },
36: },
37: HTML_support =>
38: {
39: description => "Create HTML documentation",
40: requires => { 'Pod::Html' => 0 },
41: },
42: },
1.1 andrew 43: );
44:
1.5 andrew 45: get_config();
1.3 andrew 46:
1.5 andrew 47: $builder->create_build_script();
48:
49: sub get_config {
50: my %cfg;
51: print <<EOB;
52:
53: Net::Telnet::Trango needs some additional information and setup to
54: perform it\'s full suite of tests.
55:
56: These tests MAY change settings on the units it connects to, so please
57: do not use equipment that is in production.
58:
59: To skip these tests, hit "return".
60:
61: EOB
62:
63: get_ap_config(\%cfg);
64:
65: get_sudb_config(\%cfg) if $cfg{AP} && $cfg{AP_PASSWD};
66:
67: get_su_config(\%cfg);
68:
1.6 andrew 69: if (open T,">$cfg_file") {
1.5 andrew 70: while (my ($key, $value) = each %cfg) {
71: print T $key, "\t", $value,"\n";
72: }
73: close T;
1.3 andrew 74: }
1.5 andrew 75:
1.3 andrew 76: }
1.2 andrew 77:
1.5 andrew 78: sub get_ap_config {
79: my $cfg = shift;
80:
1.7 andrew 81: print 'To run the AP tests, we need an IP and a password of an AP.', "\n";
1.5 andrew 82:
83: $cfg->{AP} = $builder->prompt("AP IP: ", $cfg->{AP}) || return;
84: $cfg->{AP_PASSWD} = $builder->prompt("AP Password:", $cfg->{AP_PASSWD})
85: || return;
86: }
1.2 andrew 87:
1.5 andrew 88: sub get_sudb_config {
1.3 andrew 89: my $cfg = shift;
90:
1.5 andrew 91: print <<EOL;
92: To run the SUDB tests, we need an suid and mac address of an
93: SU that can reliably link to the AP.
94: EOL
1.2 andrew 95:
1.5 andrew 96: $cfg->{SU_ID} = $builder->prompt("SU ID: ", $cfg->{SU_ID}) || return;
97: $cfg->{SU_MAC} = $builder->prompt("SU MAC:", $cfg->{SU_MAC}) || return;
98: }
1.2 andrew 99:
1.5 andrew 100: sub get_su_config {
101: my $cfg = shift;
1.2 andrew 102:
1.5 andrew 103: print 'To run the SU tests, we need an IP and a password of an SU.', "\n";
1.2 andrew 104:
1.5 andrew 105: $cfg->{SU} = $builder->prompt("SU IP: ", $cfg->{SU}) || return;
106: $cfg->{SU_PASSWD} = $builder->prompt("SU Password:", $cfg->{SU_PASSWD})
107: || return;
1.2 andrew 108: }
1.5 andrew 109:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>