about summary refs log tree commit
diff options
context:
space:
mode:
authorSteve Hay <steve.m.hay@googlemail.com>2014-05-22 18:11:33 +0100
committerSteve Hay <steve.m.hay@googlemail.com>2014-05-22 18:11:33 +0100
commitc144fd71ae82ebcd3c6dfa519ae787a66f4ca2e4 (patch)
tree5fd247b5b6a5427056b630a9328ae740fa499983
parentb76af9289d4542cf2b9e1f3c2de0baf0ba8bae09 (diff)
downloadperl-libnet-c144fd71ae82ebcd3c6dfa519ae787a66f4ca2e4.tar.gz
Bump/set minimum Perl and EU::MM versions and overhaul Makefile.PL
Also add a .gitignore file.
-rw-r--r--.gitignore15
-rw-r--r--Changes10
-rw-r--r--MANIFEST16
-rw-r--r--Makefile.PL220
4 files changed, 146 insertions, 115 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..f82529a
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,15 @@
+# Files generated by Makefile.PL
+libnet.cfg
+Makefile
+MYMETA.json
+MYMETA.yml
+
+# Files generated by *make
+blib/
+pm_to_blib
+
+# Files generated by *make clean
+Makefile.old
+
+# Files generated by *make dist
+libnet-*.tar.gz
diff --git a/Changes b/Changes
index e54695e..b41d5ec 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,13 @@
+libnet 1.26  -- TODO
+
+  * Set minimum required ExtUtils::MakeMaker version to 6.64 to ensure that all
+    parameters used are supported, to save jumping through hoops to support
+    earlier versions.  (This should not be a problem since ExtUtils::MakeMaker
+    6.64 is easily installed into Perl 5.8.1 and above, that being the whole
+    point of the new choice of minimum supported Perl version.)
+  * Set minimum required Perl version to 5.8.1.  This is in line with the
+    minimum requirement of the "Perl Toolchain".
+
 libnet 1.25  -- Tue Feb 04 2014
 
   * Fix Net::FTP::pasv_wait() not handling errors from Net::Cmd::reponse()
diff --git a/MANIFEST b/MANIFEST
index ea66ab0..d83ff13 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1,23 +1,23 @@
 Changes
 Config.eg
 Configure
-Hostname.pm.eg                        Example replacement for Hostname.pm
+Hostname.pm.eg                           Example replacement for Hostname.pm
 MANIFEST
 Makefile.PL
 Net/Cmd.pm
 Net/Config.pm
-Net/Domain.pm                        DNS Domain name lookup
-Net/FTP.pm                        File Transfer Protocol Client
+Net/Domain.pm                            DNS Domain name lookup
+Net/FTP.pm                               File Transfer Protocol Client
 Net/FTP/A.pm
 Net/FTP/E.pm
 Net/FTP/I.pm
 Net/FTP/L.pm
 Net/FTP/dataconn.pm
-Net/NNTP.pm                        Network News Transfer Protocol
-Net/Netrc.pm                        .netrc lookup routines
-Net/POP3.pm                        Post Office Protocol
-Net/SMTP.pm                        Simple Mail Transfer Protocol Client
-Net/Time.pm                        time & nettime protocols
+Net/NNTP.pm                              Network News Transfer Protocol
+Net/Netrc.pm                             .netrc lookup routines
+Net/POP3.pm                              Post Office Protocol
+Net/SMTP.pm                              Simple Mail Transfer Protocol Client
+Net/Time.pm                              time & nettime protocols
 Net/libnetFAQ.pod
 README
 demos/ftp
diff --git a/Makefile.PL b/Makefile.PL
index 95feb8a..1cb5be7 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -1,121 +1,127 @@
-# This -*- perl -*- script makes the Makefile
-
-#--- Distribution section ---
-
-$NAME     = 'Net';
-$DISTNAME = "libnet";
-$VERSION  = "1.25";
-
-BEGIN { require 5.002 }
-
-use ExtUtils::MakeMaker;
-use ExtUtils::Manifest qw(maniread);
-
-#--- Installation check
-
-sub chk_version
-{
- my($pkg,$wanted,$msg) = @_;
-
- local($|) = 1;
- print "Checking for $pkg...";
-
- eval { my $p; ($p = $pkg . ".pm") =~ s#::#/#g; require $p; };
-
- my $vstr = ${"${pkg}::VERSION"} ? "found v" . ${"${pkg}::VERSION"}
-                                 : "not found";
- my $vnum = ${"${pkg}::VERSION"} || 0;
-
- print $vnum >= $wanted ? "ok\n" : " " . $vstr . "\n";
-
- $vnum >= $wanted;
+#!perl
+#===============================================================================
+#
+# Makefile.PL
+#
+# DESCRIPTION
+#   Makefile creation script.
+#
+# COPYRIGHT
+#   Copyright (C) 2014 Steve Hay.  All rights reserved.
+#
+# LICENCE
+#   You may distribute under the terms of either the GNU General Public License
+#   or the Artistic License, as specified in the LICENCE file.
+#
+#===============================================================================
+
+use 5.008001;
+
+use strict;
+use warnings;
+
+use ExtUtils::MakeMaker 6.64;
+use ExtUtils::MakeMaker qw(WriteMakefile);
+
+#===============================================================================
+# INITIALIZATION
+#===============================================================================
+
+our($CfgFile, $CfgPath);
+
+BEGIN {
+    $CfgFile = 'libnet.cfg';
+    $CfgPath = "Net/$CfgFile";
 }
 
-sub MY::post_initialize
-{
- my ($self) = @_;
-
- #--- Create Net::Config
+#===============================================================================
+# MAIN PROGRAM
+#===============================================================================
+
+MAIN: {
+    my %prereq_pms = ();
+    $prereq_pms{'Convert::EBCDIC'} = '0.06' if $^O eq 'os390';
+
+    WriteMakefile(
+        NAME     => 'Net',
+        DISTNAME => 'libnet',
+        ABSTRACT => 'Collection of network protocol modules',
+        AUTHOR   => 'Graham Barr <gbarr@pobox.com>, Steve Hay <shay@cpan.org>',
+        LICENSE  => 'perl_5',
+        VERSION  => '1.25',
+
+        META_MERGE => {
+            'meta-spec' => {
+                version => 2
+            },
+
+            resources => {
+                repository => 'https://github.com/steve-m-hay/perl-libnet',
+            }
+        },
 
- my $config_pm = "Net/libnet.cfg";
- my $libnet_cfg = "libnet.cfg";
+        MIN_PERL_VERSION => '5.008001',
 
- # Use %INC and ExtUtils::MakeMaker to determine how this machine
- # maps package names to path names
+        CONFIGURE_REQUIRES => {
+            'ExtUtils::MakeMaker' => '6.64',
+            'Getopt::Std'         => 0,
+            'IO:File'             => 0,
+            'strict'              => 0,
+            'vars'                => 0,
+            'warnings'            => 0
+        },
 
- foreach (keys %INC) {
-  last if ($config_pm = $_) =~ s/^ExtUtils(.)MakeMaker.pm/Net${1}libnet.cfg/;
- }
+        TEST_REQUIRES => {
+            'Cwd'                 => 0,
+            'IO::File'            => 0,
+            'strict'              => 0
+        },
 
- system(($^O eq 'VMS' ? 'mcr ': ()),$^X, 'Configure')
-        unless -f $libnet_cfg;
+        PREREQ_PM => {
+            %prereq_pms,
+          # 'Authen::SASL'        => 0,      # Only required for AUTH support
+            'Carp'                => 0,
+          # 'Digest::MD5'         => 0,      # Only required for APOP support
+            'Errno'               => 0,
+            'Exporter'            => 0,
+            'Fcntl'               => 0,
+            'File::Basename'      => 0,
+            'FileHandle'          => 0,
+            'IO::Select'          => 0,
+            'IO::Socket'          => '1.05',
+          # 'MIME::Base64'        => 0,      # Only required for AUTH support
+            'POSIX'               => 0,
+            'Socket'              => '1.3',
+            'Symbol'              => 0,
+            'Time::Local'         => 0,
+            'strict'              => 0,
+            'vars'                => 0
+        },
 
- $self->{PM}->{$libnet_cfg} = $self->catfile('$(INST_LIBDIR)',$config_pm);
+        INSTALLDIRS => 'perl',
 
- "";
-}
+        realclean => {
+            FILES => $CfgFile
+        },
 
-#--- Check for Socket
-
-chk_version(Socket => '1.30') or
-    warn  "\n"
-        . "*** For Net::Cmd to work you require version 1.30, or later, of\n"
-        . "    Socket.pm from CPAN/modules/by-module/Socket/Socket-x.x.tar.gz\n\n";
-
-chk_version(IO::Socket => '1.05') or
-    warn  "\n"
-        . "*** 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";
-
-if ($^O eq 'os390')
-{
-  chk_version(Convert::EBCDIC => '0.06') or
-   warn  "\n"
-   . "*** For Net::Cmd to work on $^O version 0.06, or later, of\n"
-   . "    Convert::EBCDIC is required, which can be found at"
-   . "    CPAN/modules/by-module/Convert/Convert-EBCDIC-x.x.tar.gz\n\n";
+        dist => {
+            PREOP   => 'find $(DISTVNAME) -type f -print|xargs chmod 0644 && ' .
+                       'find $(DISTVNAME) -type d -print|xargs chmod 0755',
+            TO_UNIX => 'find $(DISTVNAME) -type f -print|xargs dos2unix'
+        }
+    );
 }
 
-#--- Write the Makefile
-
-my @ppd;
+#===============================================================================
+# MAKEMAKER OVERRIDES
+#===============================================================================
 
-if ($] >= 5.00503) {
-  @ppd = (
-    AUTHOR    => 'Graham Barr <gbarr@pobox.com>',
-    ABSTRACT  => 'Collection of Network protocol modules',
-  );
+sub MY::post_initialize {
+    my $self = shift;
+    return '' if $self->{PERL_CORE};
+    system(($^O eq 'VMS' ? 'mcr ': ()), $^X, 'Configure') unless -f $CfgFile;
+    $self->{PM}{$CfgFile} = $self->catfile('$(INST_LIBDIR)',$CfgPath);
+    return '';
 }
 
-WriteMakefile(
-  INSTALLDIRS => ($] >= 5.008 ? 'perl' : 'site'),
-  VERSION     => $VERSION,
-  DISTNAME    => $DISTNAME,
-  NAME        => $NAME,
-  'realclean' => {FILES => $config_pm},
-  PREREQ_PM   => {
-                Socket     => 1.3,
-                IO::Socket => 1.05
-              },
-  dist => { DIST_DEFAULT => 'mydist', },
-  (eval { ExtUtils::MakeMaker->VERSION(6.21) } ? (LICENSE => 'perl') : ()),
-  ( eval { ExtUtils::MakeMaker->VERSION(6.46) } ? (
-      META_MERGE => {
-        resources => {    ##
-          repository => 'http://github.com/steve-m-hay/perl-libnet',
-        },
-      }
-      )
-    : ()
-  ),
-  @ppd,
-);
-
-sub MY::postamble {
-  return <<'POSTAMBLE';
-
-mydist : distmeta tardist
-
-POSTAMBLE
-
-}
+#===============================================================================