=================================================================== RCS file: /cvs/trango/Net-Telnet-Trango/Build.PL,v retrieving revision 1.3 retrieving revision 1.9 diff -u -r1.3 -r1.9 --- trango/Net-Telnet-Trango/Build.PL 2007/02/05 19:39:33 1.3 +++ trango/Net-Telnet-Trango/Build.PL 2009/07/08 18:36:55 1.9 @@ -2,47 +2,106 @@ use warnings; use Module::Build; use File::Spec; -# $RedRiver: Build.PL,v 1.2 2007/02/05 19:21:02 andrew Exp $ -my $cfg_file = File::Spec->catfile('t', 'do_network.tests'); +# $RedRiver: Build.PL,v 1.8 2007/02/06 21:19:40 andrew Exp $ +my $cfg_file = File::Spec->catfile( 't', 'tests.cfg' ); + my $builder = Module::Build->new( - module_name => 'Net::Telnet::Trango', - license => 'perl', - dist_author => 'Andrew Fresh ', - dist_version_from => 'lib/Net/Telnet/Trango.pm', + module_name => 'Net::Telnet::Trango', + license => 'perl', + dist_author => 'Andrew Fresh ', + dist_version_from => 'lib/Net/Telnet/Trango.pm', + requires => { + 'perl' => '5.6.1', + 'Net::Telnet' => '0', + }, build_requires => { - 'Test::More' => 0, + 'Test::More' => '0', }, - add_to_cleanup => [ 'Net-Telnet-Trango-*', $cfg_file ], + add_to_cleanup => [ 'Net-Telnet-Trango-*', $cfg_file ], + create_makefile_pl => 'traditional', + create_readme => 1, + create_html => 1, + dynamic_config => 1, + auto_features => { + YAML_support => { + description => "Use YAML.pm to write META.yml files", + requires => { YAML => ' >= 0.35, != 0.49_01 ' }, + }, + manpage_support => { + description => "Create Unix man pages", + requires => { 'Pod::Man' => 0 }, + }, + HTML_support => { + description => "Create HTML documentation", + requires => { 'Pod::Html' => 0 }, + }, + }, ); -my %cfg; -get_ap_config(\%cfg); +get_config(); -if (%cfg && open T,">$cfg_file") { - while (my ($key, $value) = each %cfg) { - print T $key, "\t", $value,"\n"; +$builder->create_build_script(); + +sub get_config { + my %cfg; + print <$cfg_file" ) { + while ( my ( $key, $value ) = each %cfg ) { + print T $key, "\t", $value, "\n"; + } + close T; } - close T; + } -$builder->create_build_script(); +sub get_ap_config { + my $cfg = shift; -sub get_ap_config -{ + print 'To run the AP tests, we need an IP and a password of an AP.', "\n"; + + $cfg->{AP} = $builder->prompt( "AP IP: ", $cfg->{AP} ) || return; + $cfg->{AP_PASSWD} = $builder->prompt( "AP Password:", $cfg->{AP_PASSWD} ) + || return; +} + +sub get_sudb_config { my $cfg = shift; - print <{SU_ID} = $builder->prompt( "SU ID: ", $cfg->{SU_ID} ) || return; + $cfg->{SU_MAC} = $builder->prompt( "SU MAC:", $cfg->{SU_MAC} ) || return; +} -To skip these tests, hit "return". +sub get_su_config { + my $cfg = shift; -EOB + print 'To run the SU tests, we need an IP and a password of an SU.', "\n"; - $cfg->{AP} = $builder->prompt("AP: ", $cfg->{AP}) || return; - $cfg->{PASSWD} = $builder->prompt("Password:", $cfg->{PASSWD}) || return; + $cfg->{SU} = $builder->prompt( "SU IP: ", $cfg->{SU} ) || return; + $cfg->{SU_PASSWD} = $builder->prompt( "SU Password:", $cfg->{SU_PASSWD} ) + || return; } +