1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
|
use warnings;
use strict;
use Module::Build;
my $prompt = 'Would you like to enable network tests?';
my $prompt_components =
qq| If you would like to test the jabberd14 and jabberd20 component connection \n|.
qq| facilities, you will need to have already configured both servers to accept \n|.
qq| connections. If this sounds like a hassle please answer 'N' to the \n|.
qq| following question. \n\nDo you want to enable tests for jabberd14 and \n|.
qq| jabberd20 component connections?|;
my $j14 = qq|### JABBERD14 ###\n|;
my $j20 = qq|### JABBERD20 ###\n|;
my @comps = ($j14, $j20);
my $prompt_ip = 'Please enter the ip address of the server.';
my $prompt_port = 'Please enter the listening port on the server.';
my $prompt_hostname = 'Please enter the hostname the component will represent.';
my $prompt_username = qq|Please enter the username the component will represent. \n| .
qq|(NOTE: only valid for JABBERD20)|;
my $prompt_secret = 'Please enter the secret that will be used to auth.';
my $ret;
if (grep /^--default$/, @ARGV) {
print $prompt, " [n] n\n\n";
} else {
$ret = Module::Build->prompt($prompt, 'n');
}
if($ret =~ /^y/i)
{
open(my $file, '>', 'run_network_tests');
$ret = Module::Build->prompt($prompt_components, 'n');
if($ret =~ /^y/i)
{
foreach my $comp (@comps)
{
print "\n" . $comp;
print $file $comp;
print $file 'IP=' . Module::Build->prompt($prompt_ip, '127.0.0.1') . "\n";
print $file 'PORT=' . Module::Build->prompt($prompt_port, '5234') . "\n";
print $file 'HOST=' . Module::Build->prompt($prompt_hostname, 'component.localhost') . "\n";
print $file 'USER=' . Module::Build->prompt($prompt_username, 'jabberd') . "\n";
print $file 'SECRET=' . Module::Build->prompt($prompt_secret, 'secret') . "\n";
}
}
close($file);
} else {
unlink 'run_network_tests' if -e 'run_network_tests';
}
Module::Build->new
(
'module_name' => 'POE::Component::Jabber',
'license' => 'gpl',
'create_makefile_pl' => 'passthrough',
'create_readme' => 1,
'requires' =>
{
'perl' => '5.8.8',
'POE' => '0.9500',
'Filter::Template' => '1.01',
'Digest::SHA1' => '2.11',
'Authen::SASL' => '2.10',
'MIME::Base64' => '3.07',
'POE::Component::SSLify' => '0.06',
'POE::Filter::XML' => '0.31',
}
)->create_build_script();
|