diff options
author | Graham Barr <gbarr@pobox.com> | 1998-07-04 18:14:25 +0000 |
---|---|---|
committer | Graham Barr <gbarr@pobox.com> | 1998-07-04 18:14:25 +0000 |
commit | fef487c94039c8c46fd617bf0e8d250671c7611f (patch) | |
tree | b57fa774545fdd164042cca83cf376416e3ce854 | |
parent | 7cce163ae6dd50dd1ba42e5c0a04f1f65ec39a11 (diff) | |
download | perl-libnet-fef487c94039c8c46fd617bf0e8d250671c7611f.tar.gz |
- Added Config.eg, an example Config.pm
- Removed set method from Net::Config - Removed check for Data::Dumper from Makefile.PL
-rw-r--r-- | Config.eg | 49 | ||||
-rwxr-xr-x | Configure | 60 | ||||
-rw-r--r-- | MANIFEST | 1 | ||||
-rw-r--r-- | Makefile.PL | 8 | ||||
-rw-r--r-- | README | 10 |
5 files changed, 59 insertions, 69 deletions
diff --git a/Config.eg b/Config.eg new file mode 100644 index 0000000..450acac --- /dev/null +++ b/Config.eg @@ -0,0 +1,49 @@ +package Net::Config; + +require Exporter; +use vars qw(@ISA @EXPORT %NetConfig); +use strict; + +@EXPORT = qw(%NetConfig); +@ISA = qw(Exporter); + +# WARNING WARNING WARNING WARNING WARNING WARNING WARNING +# WARNING WARNING WARNING WARNING WARNING WARNING WARNING +# +# Below this line is auto-generated, *ANY* changes will be lost + +%NetConfig = ( + # the followinf parameters are all lists of hosts for the + # respective protocols. + nntp_hosts => [], + snpp_hosts => [], + pop3_hosts => [], + smtp_hosts => [], + ph_hosts => [], + daytime_hosts => [], + time_hosts => [], + + # your internet domain + inet_domain => undef, + + # If you have an ftp proxy firewall (not a http firewall) + # then set this to the name of the firewall + ftp_firewall => undef, + + # set if all connections done via the firewall should use + # passive data connections + ftp_ext_passive => 0, + + # set if all connections not done via the firewall should use + # passive data connections + ftp_int_passive => 0, + + # If set the make test will attempt to connect to the hosts above + test_hosts => 0, + + # Used during Configure (which you are not using) to do + # DNS lookups to ensure hosts exist + test_exist => 0, + +); +1; @@ -477,63 +477,3 @@ use strict; @EXPORT = qw(%NetConfig); @ISA = qw(Exporter); -sub set -{ - my $pkg = shift if @_ % 2; - my %cfg = @_; - - return unless @_; - - # Only require these modules if we need to - require Data::Dumper; - require IO::File; - require Carp; - require File::Copy; - - my $mod = $INC{'Net/Config.pm'} or - Carp::croak("Can't find myself"); - - my $bak = $mod . "~"; - - print "Updating $mod...\n"; - - File::Copy::copy($mod,$bak) or - Carp::croak("Cannot create backup file $bak: $!"); - - print "...backup at $bak\n"; - - my $old = new IO::File $bak,"r" or - Carp::croak("Can't open $bak: $!"); - - my $new = new IO::File $mod,"w" or - Carp::croak("Can't open $mod: $!"); - - # If we fail below, then we must restore from backup - local $SIG{'__DIE__'} = sub { - print "Restoring $mod from backup!!\n"; - unlink $mod; - rename $bak, $mod; - print "Done.\n"; - exit 1; - }; - - %NetConfig = (%NetConfig, %cfg); - - while (<$old>) - { - last if /^%NetConfig/; - $new->print($_); - } - - $new->print ( Data::Dumper->Dump([\%NetConfig],['*NetConfig']) ); - - $new->print("\n1;\n"); - - close $old; - close $new; -} - -# WARNING WARNING WARNING WARNING WARNING WARNING WARNING -# WARNING WARNING WARNING WARNING WARNING WARNING WARNING -# -# Below this line is auto-generated, *ANY* changes will be lost @@ -1,5 +1,6 @@ ChangeLog Configure +Config.eg FAQ Hostname.pm.eg Example replacement for Hostname.pm MANIFEST diff --git a/Makefile.PL b/Makefile.PL index c6c798d..b47067a 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -83,13 +83,6 @@ chk_version(IO::Socket => '1.05') or . "*** For Net::Cmd to work you require version 1.05, or later, of\n" . " IO/Socket.pm from CPAN/modules/by-module/IO/IO-x.x.tar.gz\n\n"; -chk_version(Data::Dumper => '0.01') or - warn "\n" - . "*** To be able to use the dynamic capabilities of Net::Config\n" - . " you will need to install Data::Dumper\n" - . " You can obtain this from\n" - . " CPAN/modules/by-module/Data/Data-Dumper-x.x.tar.gz\n\n"; - #--- Write the Makefile my @clean = qw(*% *.html *.b[ac]k *.old *.orig *.rej); @@ -109,7 +102,6 @@ WriteMakefile( 'clean' => {FILES => join(" ", @clean, )}, 'realclean' => {FILES => $config_pm}, PREREQ_PM => { - Data::Dumper => 0.01, Socket => 1.3, IO::Socket => 1.05 }, @@ -59,6 +59,14 @@ installation for a few packages that are recommended to be installed together with libnet. These packages should be available on CPAN (described above). +CONFIGURE + +Normally when perl Makefile.PL is run it will run Configure which will ask some +questions about your system. The results of these questions will be stored in +the Net::Config package. If you are on a system when this script cannot be run +for some reason then the file Config.eg can be edited manually and installed +as Net::Config (Net/Comfig.pm) + DOCUMENTATION See ChangeLog for recent changes. POD style documentation is included @@ -88,7 +96,7 @@ include a transcript of a run. COPYRIGHT - © 1996, 1997 Graham Barr. All rights reserved. + © 1996-98 Graham Barr. All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. |