File: CheckLib.pm

package info (click to toggle)
libcrypt-dh-perl 0.07-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 264 kB
  • sloc: perl: 3,098; makefile: 2
file content (63 lines) | stat: -rwxr-xr-x 1,377 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#line 1
package Module::Install::CheckLib;

use strict;
use warnings;
use File::Spec;
use base qw(Module::Install::Base);
use vars qw($VERSION);

$VERSION = '0.08';

sub checklibs {
  my $self = shift;
  my @parms = @_;
  return unless scalar @parms;

  unless ( $Module::Install::AUTHOR ) {
     require Devel::CheckLib;
     Devel::CheckLib::check_lib_or_exit( @parms );
     return;
  }

  _author_side();
}

sub assertlibs {
  my $self = shift;
  my @parms = @_;
  return unless scalar @parms;

  unless ( $Module::Install::AUTHOR ) {
     require Devel::CheckLib;
     Devel::CheckLib::assert_lib( @parms );
     return;
  }

  _author_side();
}

sub _author_side {
  mkdir 'inc';
  mkdir 'inc/Devel';
  print "Extra directories created under inc/\n";
  require Devel::CheckLib;
  local $/ = undef;
  open(CHECKLIBPM, $INC{'Devel/CheckLib.pm'}) ||
    die("Can't read $INC{'Devel/CheckLib.pm'}: $!");
  (my $checklibpm = <CHECKLIBPM>) =~ s/package Devel::CheckLib/package #\nDevel::CheckLib/;
  close(CHECKLIBPM);
  open(CHECKLIBPM, '>'.File::Spec->catfile(qw(inc Devel CheckLib.pm))) ||
    die("Can't write inc/Devel/CheckLib.pm: $!");
  print CHECKLIBPM $checklibpm;
  close(CHECKLIBPM);

  print "Copied Devel::CheckLib to inc/ directory\n";
  return 1;
}

'All your libs are belong';

__END__

#line 126