2 #===============================================================================
7 # Makefile creation script.
10 # Copyright (C) 2014, 2015 Steve Hay. All rights reserved.
13 # This script is free software; you can redistribute it and/or modify it under
14 # the same terms as Perl itself, i.e. under the terms of either the GNU
15 # General Public License or the Artistic License, as specified in the LICENCE
18 #===============================================================================
25 use ExtUtils::MakeMaker 6.64;
26 use ExtUtils::MakeMaker qw(WriteMakefile);
28 ## no critic (Subroutines::ProhibitSubroutinePrototypes)
30 sub running_under_cpan();
32 #===============================================================================
34 #===============================================================================
36 our($CfgFile, $CfgPath);
39 $CfgFile = 'libnet.cfg';
40 $CfgPath = "Net/$CfgFile";
43 #===============================================================================
45 #===============================================================================
49 $prereq_pms{'Convert::EBCDIC'} = '0.06' if $^O eq 'os390';
52 if (not running_under_cpan() and not $ENV{PERL_CORE}) {
53 $xt = prompt("Should I do external tests?\n" .
54 "These tests will fail if there is no internet" .
55 " connection or if a firewall\n" .
56 "blocks or modifies some traffic.\n" .
61 $tests .= ' t/external/*.t' if $xt =~ m/^y/io;
66 ABSTRACT => 'Collection of network protocol modules',
67 AUTHOR => 'Graham Barr <gbarr@pobox.com>, Steve Hay <shay@cpan.org>',
79 url => 'https://github.com/steve-m-hay/perl-libnet.git'
83 optional_features => {
85 description => 'APOP support',
96 description => 'AUTH support',
100 'Authen::SASL' => '0',
101 'MIME::Base64' => '0'
108 description => 'SSL support',
112 'IO::Socket::SSL' => '2.007'
119 description => 'IPv6 support',
123 'IO::Socket::IP' => '0.25'
124 # or IO::Socket::INET6 2.62
131 description => 'Changes testing',
135 'Test::CPAN::Changes' => '0'
142 description => 'Perl::Critic testing',
146 'Test::Perl::Critic' => '0'
153 description => 'POD testing',
157 'Test::Pod' => '1.00'
164 description => 'POD coverage testing',
168 'Test::Pod::Coverage' => '0.08'
176 MIN_PERL_VERSION => '5.008001',
178 CONFIGURE_REQUIRES => {
179 'ExtUtils::MakeMaker' => '6.64',
180 'Getopt::Std' => '0',
182 'perl' => '5.008001',
199 'File::Basename' => '0',
202 'IO::Socket' => '1.05',
206 'Time::Local' => '0',
213 INSTALLDIRS => ($] < 5.011 ? 'perl' : 'site'),
224 PREOP => 'find $(DISTVNAME) -type d -print|xargs chmod 0755 && ' .
225 'find $(DISTVNAME) -type f -print|xargs chmod 0644',
226 TO_UNIX => 'find $(DISTVNAME) -type f -print|xargs dos2unix'
231 #===============================================================================
232 # MAKEMAKER OVERRIDES
233 #===============================================================================
235 sub MY::post_initialize {
238 return '' if $self->{PERL_CORE};
240 if (not -f $CfgFile) {
241 my @args = qw(Configure);
242 push @args, '-d' if $ENV{PERL5_CPAN_IS_RUNNING} ||
243 $ENV{PERL5_CPANPLUS_IS_RUNNING} ||
244 $ENV{PERL5_CPANM_IS_RUNNING};
245 system(($^O eq 'VMS' ? 'mcr ': ()), $^X, @args)
248 $self->{PM}{$CfgFile} = $self->catfile('$(INST_LIBDIR)',$CfgPath);
253 #===============================================================================
255 #===============================================================================
257 sub running_under_cpan() {
258 return $ENV{PERL5_CPAN_IS_RUNNING} || # cpan
259 $ENV{PERL5_CPANPLUS_IS_RUNNING} || # cpanp
260 $ENV{PERL5_CPANM_IS_RUNNING}; # cpanm
263 #===============================================================================