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

File: [local] / trango / Net-Telnet-Trango / Build.PL (download)

Revision 1.4, Mon Feb 5 21:36:42 2007 UTC (17 years, 3 months ago) by andrew
Branch: MAIN
Changes since 1.3: +25 -4 lines

some Build.PL additions, and change the config file name.

use strict;
use warnings;
use Module::Build;
use File::Spec;
# $RedRiver: Build.PL,v 1.3 2007/02/05 19:39:33 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 <andrew@cpan.org>',
    dist_version_from   => 'lib/Net/Telnet/Trango.pm',
    build_requires => {
        'Test::More' => 0,
    },
    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);

if (%cfg && open T,">$cfg_file") {
    while (my ($key, $value) = each %cfg) {
        print T $key, "\t", $value,"\n";
    }
    close T;
}

$builder->create_build_script();

sub get_ap_config
{
    my $cfg = shift;

    print <<EOB;

Net::Telnet::Trango needs to log into an AP to
perform it\'s full suite of tests. To log in, we
need a test AP and a password.

To skip these tests, hit "return".

EOB

    $cfg->{AP}        = $builder->prompt("AP: ", $cfg->{AP}) || return;
    $cfg->{AP_PASSWD} = $builder->prompt("Password:", $cfg->{AP_PASSWD}) || return;
}