[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.3

1.1       andrew      1: use strict;
                      2: use warnings;
                      3: use Module::Build;
1.3     ! andrew      4: use File::Spec;
        !             5: # $RedRiver: Build.PL,v 1.2 2007/02/05 19:21:02 andrew Exp $
1.2       andrew      6:
                      7: my $cfg_file = File::Spec->catfile('t', 'do_network.tests');
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',
                     14:     build_requires => {
                     15:         'Test::More' => 0,
                     16:     },
1.2       andrew     17:     add_to_cleanup      => [ 'Net-Telnet-Trango-*', $cfg_file ],
1.1       andrew     18: );
                     19:
1.3     ! andrew     20: my %cfg;
        !            21: get_ap_config(\%cfg);
        !            22:
        !            23: if (%cfg && open T,">$cfg_file") {
        !            24:     while (my ($key, $value) = each %cfg) {
        !            25:         print T $key, "\t", $value,"\n";
        !            26:     }
        !            27:     close T;
        !            28: }
1.2       andrew     29:
1.1       andrew     30: $builder->create_build_script();
1.2       andrew     31:
1.3     ! andrew     32: sub get_ap_config
1.2       andrew     33: {
1.3     ! andrew     34:     my $cfg = shift;
        !            35:
1.2       andrew     36:     print <<EOB;
                     37:
                     38: Net::Telnet::Trango needs to log into an AP to
                     39: perform it\'s full suite of tests. To log in, we
1.3     ! andrew     40: need a test AP and a password.
1.2       andrew     41:
                     42: To skip these tests, hit "return".
                     43:
                     44: EOB
                     45:
1.3     ! andrew     46:     $cfg->{AP}       = $builder->prompt("AP: ", $cfg->{AP}) || return;
        !            47:     $cfg->{PASSWD}   = $builder->prompt("Password:", $cfg->{PASSWD}) || return;
1.2       andrew     48: }

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