~ubuntu-branches/ubuntu/wily/libio-socket-ssl-perl/wily

« back to all changes in this revision

Viewing changes to Makefile.PL

  • Committer: Package Import Robot
  • Author(s): Sebastien Bacher
  • Date: 2014-01-17 11:28:23 UTC
  • mfrom: (41.1.2 trusty-proposed)
  • Revision ID: package-import@ubuntu.com-20140117112823-xemv5h0jdtms3oee
Tags: 1.965-1ubuntu1
* Resynchronize on Debian, remaining change
* Prefer the ipv6 alternatives for the recommendations.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#
2
 
# a MakeMaker script for IO::Socket::SSL (aspa@hip.fi).
3
 
#
4
 
# $Id: Makefile.PL,v 1.1 2000/07/04 10:09:57 aspa Exp $.
5
 
#
 
1
# vim: set sts=4 sw=4 ts=8 ai:
6
2
 
7
3
use 5.008; 
8
4
use ExtUtils::MakeMaker;
10
6
 
11
7
# Test to make sure that Net::SSLeay can be properly seeded!
12
8
unless (defined $ENV{EGD_PATH}) {
13
 
        foreach (qw(/var/run/egd-pool /dev/egd-pool /etc/egd-pool /etc/entropy)) {
14
 
                if (-S) { $ENV{EGD_PATH}=$_; last }
15
 
        }
 
9
    foreach (qw(/var/run/egd-pool /dev/egd-pool /etc/egd-pool /etc/entropy)) {
 
10
        if (-S) { $ENV{EGD_PATH}=$_; last }
 
11
    }
16
12
}
17
13
 
18
14
$| = 1;
19
15
 
20
16
{
21
 
        # issue warning, if Net::SSLeay cannot find random generator
22
 
        # redefine __WARN__ only locally to allow detection of failures
23
 
        # in PREREQ_PM
24
 
        local $SIG{__WARN__} = sub {
25
 
                undef $SIG{__WARN__};
26
 
                my $warning      = shift;
27
 
                return unless $warning =~ /random/i;
28
 
                print "Net::SSLeay could not find a random number generator on\n";
29
 
                print "your system.      This will likely cause most of the tests\n";
30
 
                print "to fail.  Please see the README file for more information.\n";
31
 
                print "the message from Net::SSLeay was: $warning\n";
32
 
 
33
 
                # Taken from ExtUtils::MakeMaker 6.16 (Michael Schwern) so that 
34
 
                # the prompt() function can be emulated for older versions of ExtUtils::MakeMaker.
35
 
                my $isa_tty = -t STDIN && (-t STDOUT || !(-f STDOUT || -c STDOUT));
36
 
                
37
 
                if ($isa_tty) {
38
 
                        print "Do you REALLY want to continue? [Default: no] ";
39
 
                        die "User cancelled install!\n" if (<STDIN> !~ /^y(?:es)?$/);
40
 
                } else {
41
 
                        die "Install cancelled.\n";
42
 
                }
43
 
        };
44
 
 
45
 
        if (! defined $ENV{SKIP_RNG_TEST}) {
46
 
                eval { require Net::SSLeay; $Net::SSLeay::trace=1; Net::SSLeay::randomize(); };
47
 
                die $@ if $@ =~ /cancelled/;
 
17
    # issue warning, if Net::SSLeay cannot find random generator
 
18
    # redefine __WARN__ only locally to allow detection of failures
 
19
    # in PREREQ_PM
 
20
    local $SIG{__WARN__} = sub {
 
21
        undef $SIG{__WARN__};
 
22
        my $warning  = shift;
 
23
        return unless $warning =~ /random/i;
 
24
        print "Net::SSLeay could not find a random number generator on\n";
 
25
        print "your system.  This will likely cause most of the tests\n";
 
26
        print "to fail.  Please see the README file for more information.\n";
 
27
        print "the message from Net::SSLeay was: $warning\n";
 
28
 
 
29
        # Taken from ExtUtils::MakeMaker 6.16 (Michael Schwern) so that 
 
30
        # the prompt() function can be emulated for older versions of ExtUtils::MakeMaker.
 
31
        my $isa_tty = -t STDIN && (-t STDOUT || !(-f STDOUT || -c STDOUT));
 
32
        
 
33
        if ($isa_tty) {
 
34
            print "Do you REALLY want to continue? [Default: no] ";
 
35
            die "User cancelled install!\n" if (<STDIN> !~ /^y(?:es)?$/);
48
36
        } else {
49
 
                print "Random Number Generator test skipped.\n";
 
37
            die "Install cancelled.\n";
50
38
        }
 
39
    };
 
40
 
 
41
    if (! defined $ENV{SKIP_RNG_TEST}) {
 
42
        eval { require Net::SSLeay; $Net::SSLeay::trace=1; Net::SSLeay::randomize(); };
 
43
        die $@ if $@ =~ /cancelled/;
 
44
    } else {
 
45
        print "Random Number Generator test skipped.\n";
 
46
    }
 
47
}
 
48
 
 
49
{
 
50
    # don't support too old OpenSSL versions anymore, only causes trouble
 
51
    my $openssl = eval { 
 
52
        require Net::SSLeay; 
 
53
        Net::SSLeay::OPENSSL_VERSION_NUMBER()
 
54
    };
 
55
    die sprintf(
 
56
        "minimal required version for OpenSSL is 0.9.8, but your Net::SSLeay reports 0x%08x",
 
57
        $openssl) if $openssl && $openssl < 0x00908000;
51
58
}
52
59
 
53
60
# make sure that we have dualvar from the XS Version of Scalar::Util
54
61
if ( eval { require Scalar::Util } ) {
55
 
        eval { Scalar::Util::dualvar( 0,'' ) };
56
 
        die "You need the XS Version of Scalar::Util for dualvar() support" if ($@);
 
62
    eval { Scalar::Util::dualvar( 0,'' ) };
 
63
    die "You need the XS Version of Scalar::Util for dualvar() support" if ($@);
57
64
}
58
65
 
59
66
# check if we have something which handles IDN
60
67
if ( ! eval { require Net::IDN::Encode } and ! eval { require Net::LibIDN } and ! eval { require URI; URI->VERSION(1.50) }) {
61
 
        warn <<'EOM';
 
68
    warn <<'EOM';
62
69
 
63
70
WARNING
64
71
No library for handling international domain names found.
69
76
EOM
70
77
}
71
78
 
72
 
# check Version
73
 
if ( eval { require Net::SSLeay } and $Net::SSLeay::VERSION <1.33 ) {
74
 
        warn <<"EOM";
75
 
 
76
 
WARNING
77
 
You have version $Net::SSLeay::VERSION of Net::SSLeay.
78
 
Support for subjectAltNames in certificates is only available in Version >=1.33
79
 
so verifying a hostname against the certificate will not work.
80
 
It is recommended to upgrade to a current Net::SSLeay.
81
 
 
82
 
EOM
83
 
}
84
79
 
85
80
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
86
81
# the contents of the Makefile that is written.
87
82
WriteMakefile(
88
 
        'NAME' => 'IO::Socket::SSL',
89
 
        'AUTHOR' => 'Steffen Ullrich & Peter Behroozi & Marko Asplund',
90
 
        'ABSTRACT' => 'Nearly transparent SSL encapsulation for IO::Socket::INET.',
91
 
        'VERSION_FROM' => 'SSL.pm',
92
 
        'DISTNAME' => 'IO-Socket-SSL',
93
 
        'PREREQ_PM' => {
94
 
                'Net::SSLeay' => 1.21,
95
 
                'Scalar::Util' => 0,
 
83
    'NAME' => 'IO::Socket::SSL',
 
84
    'ABSTRACT' => 'Nearly transparent SSL encapsulation for IO::Socket::INET.',
 
85
    'AUTHOR' => "Steffen Ullrich <sullr@cpan.org>, Peter Behroozi, Marko Asplund",
 
86
    'LICENSE' => 'perl',
 
87
    'DISTNAME' => 'IO-Socket-SSL',
 
88
    'VERSION_FROM' => 'lib/IO/Socket/SSL.pm',
 
89
    'PREREQ_PM' => {
 
90
        'Net::SSLeay' => 1.46,
 
91
        'Scalar::Util' => 0,
 
92
    },
 
93
    'dist' => { COMPRESS => 'gzip', SUFFIX => 'gz', },
 
94
    $ExtUtils::MakeMaker::VERSION >= 6.46 ? (
 
95
        'META_MERGE' => {
 
96
            resources => {
 
97
                license     => 'http://dev.perl.org/licenses/',
 
98
                repository  => 'https://github.com/noxxi/p5-io-socket-ssl',
 
99
                homepage    => 'https://github.com/noxxi/p5-io-socket-ssl',
 
100
                bugtracker  => 'https://rt.cpan.org/Dist/Display.html?Queue=IO-Socket-SSL',
 
101
            },
96
102
        },
97
 
        'dist' => { COMPRESS => 'gzip', SUFFIX => 'gz', },
 
103
    ):(),
98
104
);