Debian lenny version packages
[pkg-perl] / deb-src / libnet-ssleay-perl / libnet-ssleay-perl-1.35 / inc / Module / Install / External.pm
1 #line 1
2 package Module::Install::External;
3
4 # Provides dependency declarations for external non-Perl things
5
6 use strict;
7 use Module::Install::Base;
8
9 use vars qw{$VERSION $ISCORE @ISA};
10 BEGIN {
11         $VERSION = '0.76';
12         $ISCORE  = 1;
13         @ISA     = qw{Module::Install::Base};
14 }
15
16 sub requires_external_cc {
17         my $self = shift;
18
19         # We need a C compiler, use the can_cc method for this
20         unless ( $self->can_cc ) {
21                 print "Unresolvable missing external dependency.\n";
22                 print "This package requires a C compiler.\n";
23                 print STDERR "NA: Unable to build distribution on this platform.\n";
24                 exit(0);
25         }
26
27         # Unlike some of the other modules, while we need to specify a
28         # C compiler as a dep, it needs to be a build-time dependency.
29
30         1;
31 }
32
33 sub requires_external_bin {
34         my ($self, $bin, $version) = @_;
35         if ( $version ) {
36                 die "requires_external_bin does not support versions yet";
37         }
38
39         # Load the package containing can_run early,
40         # to avoid breaking the message below.
41         $self->load('can_run');
42
43         # Locate the bin
44         print "Locating required external dependency bin:$bin...";
45         my $found_bin = $self->can_run( $bin );
46         if ( $found_bin ) {
47                 print " found at $found_bin.\n";
48         } else {
49                 print " missing.\n";
50                 print "Unresolvable missing external dependency.\n";
51                 print "Please install '$bin' seperately and try again.\n";
52                 print STDERR "NA: Unable to build distribution on this platform.\n";
53                 exit(0);
54         }
55
56         # Once we have some way to specify external deps, do it here.
57         # In the mean time, continue as normal.
58
59         1;
60 }
61
62 1;
63
64 __END__
65
66 #line 138