ASNMTAP

 view release on metacpan or  search on metacpan

Makefile.PL  view on Meta::CPAN


# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

if ( $ASNMTAP_PLUGINS or $ASNMTAP_APPLICATIONS ) {
  foreach my $prerequisite ( @prerequisites ) {
    my ($feature, $default, $files) = ( @{$prerequisite}[1], @{$prerequisite}[4..5] );

    if ( $default == 1 || $default == 2 ) {
      if ( defined $files ) {
        foreach ( @$files ) {
          my $file  = @$_[0];
          my $mode  = @$_[1];
          my @files = glob($file);

          foreach my $file (@files) {
            my $destination = ( $file =~ /^\// ? $file : $ASNMTAP_PATH .'/'. $file );
            $destination .= '-orig' if ( $mode =~ /^[RX]$/ );
            $file = substr($file, 1) if ( $file =~ /^\// );

            if ( $mode =~ /^[dD]$/ ) {
              $file .= '/.exists';
			        $destination .= '/.exists';
            }

            $PM{$file} = $destination;
          }
        }
      }
    }
  }

  print "\n";
}

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

if ( $PERL_AUTOINSTALL ) {
  my ($module, $version, $installed);
  $module    = 'Module::AutoInstall';
  $version   = '1.03';
  $installed = eval ( "require $module; Exporter::require_version ( '$module', $version );" );

  if ( $installed ) {
    print "\nAutomatic install of dependencies via CPAN\n";

    eval ( "
       use Module::AutoInstall ( -config => { force => 1, do_once => 1 } ); 
       Module::AutoInstall->install( [], %PREREQ_PM );
    " );

    print "\n";
  } else {
    print "\n$module required for automatic install of dependencies via CPAN\n";
    print "\nperl -MCPAN -e 'install $module'\n\n";
  }
}

# Ok, now it is time to really generate the Makefile  - - - - - - - - - -

# my $ac = ExtUtils::Autoconf->new;
# $ac->configure;

WriteMakefile(
  NAME              => 'ASNMTAP',
  AUTHOR            => "alex.peeters\@citap.be",
  ABSTRACT          => "Application System Network Monitoring Toolkit Alex Peeters",
  VERSION           => $VERSION,
  LICENSE           => 'perl',
  PM                => \%PM,
  MAN3PODS          => { map { my $man3pod = $_; $man3pod =~ s/\//::/g; ("lib/ASNMTAP/$_.pod" => "\$(INST_MAN3DIR)/ASNMTAP::$man3pod.\$(MAN3EXT)") } @man3pods },
  PREREQ_PM         => \%PREREQ_PM,
  ($] >= 5.005 ?
    (ABSTRACT       => 'Application System Network Monitoring Toolkit Alex Peeters',
     AUTHOR         => 'Alex Peeters <alex.peeters@citap.com>') : ()
    ),
  'dist'            => { COMPRESS => 'gzip -9f', SUFFIX => 'gz' },
# 'dist'            => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', PREOP => q{$(PERLRUN) -MExtUtils::Autoconf -e'ExtUtils::Autoconf->run_autogen'} },
);


# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

package MY;

# What happens when we say 'make ...' - - - - - - - - - - - - - - - - - -

# sub postamble {
#   return <<"EOM";
# autogen :
# \t\$(PERLRUN) -MExtUtils::Autoconf -e 'ExtUtils::Autoconf->run_autogen'

# configure :
# \t\$(PERLRUN) -MExtUtils::Autoconf -e'ExtUtils::Autoconf->run_configure'

# autoclean :
# \t\$(PERLRUN) -MExtUtils::Autoconf -e'ExtUtils::Autoconf->run_realclean'

# realclean purge ::
# \t\$(PERLRUN) -MExtUtils::Autoconf -e 'ExtUtils::Autoconf->run_realclean'

# clean ::
# \t\$(PERLRUN) -MExtUtils::Autoconf -e 'ExtUtils::Autoconf->run_clean'
# EOM
# }

# What happens when we say 'make test'  - - - - - - - - - - - - - - - - -

sub test {
  q(
TEST_VERBOSE=0

test: all
	$(FULLPERL) t/TEST $(TEST_VERBOSE)
  );
}

# Determine things that should *not* be installed - - - - - - - - - - - -

sub libscan {
  my ($self, $path) = @_;

  return '' if $path =~ m:\betc\/:;
  return '' if $path =~ m:\busr\/:;
  return '' if $path =~ m:\bCVS\/:;
  $path;
}

# Pass ASNMTAP version number to pod2man  - - - - - - - - - - - - - - - -

sub manifypods {
  my $self = shift;

  my $version = $self->{VERSION} || $VERSION;
  local ($_) = $self->SUPER::manifypods(@_);
  s/pod2man\s*$/pod2man --release ASNMTAP-$version/m;
  $_;
}

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



( run in 1.057 second using v1.01-cache-2.11-cpan-39bf76dae61 )