Alien-SNMP

 view release on metacpan or  search on metacpan

alienfile  view on Meta::CPAN

};

my $copy_tree = sub {
  my ($src_dir, $dst_dir, $skip) = @_;
  $src_dir->visit(sub {
    my ($src) = @_;
    return if $src->is_dir || $src->basename eq '.exists';
    my $rel = $src->relative($src_dir);
    return if "$rel" =~ $skip;
    my $dst = $dst_dir->child($rel);
    $dst->parent->mkpath;
    $dst->remove;   # blib .pm files are mode 0444: a rebuild could not reopen them
    File::Copy::copy("$src", "$dst") or die "can't copy $src to $dst: $!";
    chmod((stat "$src")[2] & 0777, "$dst");
  }, { recurse => 1 });
};

# Bundle/MakefileSubs.pm is net-snmp's own Makefile.PL helper (it declares `package
# MakefileSubs;` despite its path); only the source tree's Makefile.PLs use it.
my $not_shippable = qr{(?:^|/)Bundle/};

alienfile  view on Meta::CPAN

# $DESTDIR: doing so fails wherever the real target is not writable at build time
# (CPAN smokers on system perl, root-owned site perl, packaging roots).  So hand them
# to *this* distribution's blib and let ExtUtils::Install place them at `make
# install`, which honors DESTDIR, INSTALL_BASE, PREFIX and local::lib, and which owns
# the .packlist / perllocal.pod bookkeeping.  net-snmp's own `make install` already
# staged a copy under $DESTDIR; that copy is discarded with the staging dir.
my $install_perl_modules_into_blib = sub {
  my ($build) = @_;
  # install_prop->{root} is documented as absolute, and is <dist>/_alien under
  # Alien::Build::MM.
  my $blib = Path::Tiny->new($build->install_prop->{root})->parent->child('blib');

  foreach my $section (qw( lib arch man3 )) {
    my $src = Path::Tiny->new('perl', 'blib', $section);
    if ($section ne 'man3' && !$has_shippable_files->($src)) {
      die "net-snmp built no perl/blib/$section, so the bundled SNMP and NetSNMP "
        . "modules would be missing from this distribution.  Check that "
        . "perl module support is still in the configure flags and that net-snmp "
        . "still builds its perl modules with ExtUtils::MakeMaker.\n";
    }
    next unless $src->is_dir;

lib/Alien/SNMP.pm  view on Meta::CPAN

package Alien::SNMP;

use strict;
use warnings;
use 5.010001;
use parent qw(Alien::Base);

our $VERSION = '4.0509050202';

# Preload the dynamic Net-SNMP library with global symbol visibility so that
# the bundled SNMP XS module (which has `use Alien::SNMP;` injected ahead of
# its XSLoader call) and any downstream XS resolve libnetsnmp from our share
# dir whatever path was baked into them: the loader matches the already-loaded
# image by SONAME on ELF, and by install name on darwin.  This is what lets the
# test suite pass before `make install` populates the final share dir (the
# window CPAN Testers run in), and lets the distribution work with no

t/00_diag.txt  view on Meta::CPAN

Alien::Base
File::ShareDir
Test::More
Test::Alien
parent



( run in 3.340 seconds using v1.01-cache-2.11-cpan-bbc515a03b3 )