[BACK]Return to Build.PL CVS log [TXT][DIR] Up to [local] / trango / Net-Telnet-Trango

Annotation of trango/Net-Telnet-Trango/Build.PL, Revision 1.9

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

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>