2 #===============================================================================
7 # Makefile creation script.
10 # Copyright (C) 2014 Steve Hay. All rights reserved.
13 # You may distribute under the terms of either the GNU General Public License
14 # or the Artistic License, as specified in the LICENCE file.
16 #===============================================================================
23 use ExtUtils::MakeMaker 6.64;
24 use ExtUtils::MakeMaker qw(WriteMakefile);
26 ## no critic (Subroutines::ProhibitSubroutinePrototypes)
28 sub running_under_cpan();
30 #===============================================================================
32 #===============================================================================
34 our($CfgFile, $CfgPath);
37 $CfgFile = 'libnet.cfg';
38 $CfgPath = "Net/$CfgFile";
41 #===============================================================================
43 #===============================================================================
47 $prereq_pms{'Convert::EBCDIC'} = '0.06' if $^O eq 'os390';
50 if (not running_under_cpan() and not $ENV{PERL_CORE}) {
51 $xt = prompt("Should I do external tests?\n" .
52 "These tests will fail if there is no internet" .
53 " connection or if a firewall\n" .
54 "blocks or modifies some traffic.\n" .
59 $tests .= ' t/external/*.t' if $xt =~ m/^y/io;
64 ABSTRACT => 'Collection of network protocol modules',
65 AUTHOR => 'Graham Barr <gbarr@pobox.com>, Steve Hay <shay@cpan.org>',
77 url => 'https://github.com/steve-m-hay/perl-libnet.git'
81 optional_features => {
83 description => 'APOP support',
94 description => 'AUTH support',
98 'Authen::SASL' => '0',
106 description => 'SSL support',
110 'IO::Socket::SSL' => '2.007'
117 description => 'IPv6 support',
121 'IO::Socket::IP' => '0.20'
122 # or IO::Socket::INET6 2.62
129 description => 'Perl::Critic testing',
133 'Test::Perl::Critic' => '0'
140 description => 'POD testing',
144 'Test::Pod' => '1.00'
151 description => 'POD coverage testing',
155 'Test::Pod::Coverage' => '0.08'
163 MIN_PERL_VERSION => '5.008001',
165 CONFIGURE_REQUIRES => {
166 'ExtUtils::MakeMaker' => '6.64',
167 'Getopt::Std' => '0',
169 'perl' => '5.008001',
186 'File::Basename' => '0',
189 'IO::Socket' => '1.05',
193 'Time::Local' => '0',
199 INSTALLDIRS => 'perl',
210 PREOP => 'find $(DISTVNAME) -type d -print|xargs chmod 0755 && ' .
211 'find $(DISTVNAME) -type f -print|xargs chmod 0644',
212 TO_UNIX => 'find $(DISTVNAME) -type f -print|xargs dos2unix'
217 #===============================================================================
218 # MAKEMAKER OVERRIDES
219 #===============================================================================
221 sub MY::post_initialize {
224 return '' if $self->{PERL_CORE};
226 if (not -f $CfgFile) {
227 my @args = qw(Configure);
228 push @args, '-d' if $ENV{PERL5_CPAN_IS_RUNNING} ||
229 $ENV{PERL5_CPANPLUS_IS_RUNNING} ||
230 $ENV{PERL5_CPANM_IS_RUNNING};
231 system(($^O eq 'VMS' ? 'mcr ': ()), $^X, @args)
234 $self->{PM}{$CfgFile} = $self->catfile('$(INST_LIBDIR)',$CfgPath);
239 #===============================================================================
241 #===============================================================================
243 sub running_under_cpan() {
244 return $ENV{PERL5_CPAN_IS_RUNNING} || # cpan
245 $ENV{PERL5_CPANPLUS_IS_RUNNING} || # cpanp
246 $ENV{PERL5_CPANM_IS_RUNNING}; # cpanm
249 #===============================================================================