ASNMTAP

 view release on metacpan or  search on metacpan

Makefile.PL  view on Meta::CPAN

# This -*- perl -*- script writes the Makefile for ASNMTAP
# $Id: Makefile.PL, v3.2.3 2010/xx/xx 18:14:00 Alex Peeters Exp $

use 5.008000;
use strict;

# - - - - - - - - - - UPDATE VERSION EVERY NEW RELEASE: - - - - - - - - -

# Prepare new release ---------------------------------------------------
# copy current release '3.002.003' to '3.002.004'
#                       3.002.xxx      3.001.yyy

# replace 'Version      : 3.002.xxx'  with `3.002.yyy;`

# rename `MANIFEST-3.002.xxx` with `MANIFEST-3.002.yyy.sql`
# rename `asnmtap-3.002.xxx.sql` with `asnmtap-3.002.yyy.sql`

# replace `asnmtap-3.002.xxx` with `asnmtap-3.002.yyy`

# replace `(q$Revision: 3.002.xxx$ =~ /\d+/g)` with `(q$Revision: 3.002.yyy$ =~ /\d+/g)`
# replace `v3.002.xxx;` with `v3.002.yyy;`
# replace `'3.002.xxx'` with `'3.002.yyy'`
# replace ASNMTAP 3.002.xxx postfix; nl-BE; rv:3.002.xxx) Gecko/yyyymmdd with ASNMTAP 3.002.yyy postfix; nl-BE; rv:3.002.yyy) Gecko/2010....

# Upload new release ----------------------------------------------------
# replace 'Latest update: dd month 2011' with 'Latest update: .. ... 2010'
# replace `# 2010/mm/dd, v` with `# 2010/../.., v`

# Module section  - - - - - - - - - - - - - - - - - - - - - - - - - - - -

use Config qw(%Config);
use ExtUtils::MakeMaker qw(WriteMakefile prompt);

my $module  = 'ExtUtils::MakeMaker';
my $version = '6.32';

unless ( eval ( "require $module; Exporter::require_version ( '$module', $version );" ) ) {
  print "\n$module v$version, required for 'perl Makefile.PL' via CPAN\n";
  print "\nperl -MCPAN -e 'install $module'\n\n";
  exit;
}

# $module  = 'ExtUtils::Autoconf';
# $version = '0.02';

# unless ( eval ( "require $module; Exporter::require_version ( '$module', $version );" ) ) {
#   print "\n$module v$version, required for 'perl Makefile.PL' via CPAN\n";
#   print "\nperl -MCPAN -e 'install $module'\n\n";
#   exit;
# }

# Configuration section - - - - - - - - - - - - - - - - - - - - - - - - -

my $VERSION = do { my @r = (q$Revision: 3.002.003$ =~ /\d+/g); sprintf "%d."."%03d" x $#r, @r }; # must be all on one line or MakeMaker will get confused.

my $PERL_AUTOINSTALL     = exists $ENV{PERL_AUTOINSTALL}     ? $ENV{PERL_AUTOINSTALL}     : 0;
my $ASNMTAP_APPLICATIONS = exists $ENV{ASNMTAP_APPLICATIONS} ? $ENV{ASNMTAP_APPLICATIONS} : 0;
my $ASNMTAP_PLUGINS      = exists $ENV{ASNMTAP_PLUGINS}      ? $ENV{ASNMTAP_PLUGINS}      : 0;
my $ASNMTAP_UID          = exists $ENV{ASNMTAP_UID}          ? $ENV{ASNMTAP_UID}          : '500';
my $ASNMTAP_GID          = exists $ENV{ASNMTAP_GID}          ? $ENV{ASNMTAP_GID}          : '500';
my $ASNMTAP_PATH         = exists $ENV{ASNMTAP_PATH}         ? $ENV{ASNMTAP_PATH}         : '/opt/asnmtap';
my $ASNMTAP_PROXY        = exists $ENV{ASNMTAP_PROXY}        ? $ENV{ASNMTAP_PROXY}        : '0.0.0.0';

# End Configuration - You should not have to change anything below this line

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

# This hash will contain a list of all Application System Network Monitoring Toolkit Alex Peeters files
my %PM;

$PM{'lib/ASNMTAP/PseudoHash.pm'}                      = '$(INST_LIBDIR)/ASNMTAP/PseudoHash.pm';
$PM{'lib/ASNMTAP/PseudoHash.pod'}                     = '$(INST_LIBDIR)/ASNMTAP/PseudoHash.pod';

$PM{'lib/ASNMTAP/Time.pm'}                            = '$(INST_LIBDIR)/ASNMTAP/Time.pm';
$PM{'lib/ASNMTAP/Time.pod'}                           = '$(INST_LIBDIR)/ASNMTAP/Time.pod';

$PM{'lib/ASNMTAP/Asnmtap.pm'}                         = '$(INST_LIBDIR)/ASNMTAP/Asnmtap.pm';
$PM{'lib/ASNMTAP/Asnmtap.pod'}                        = '$(INST_LIBDIR)/ASNMTAP/Asnmtap.pod';

$PM{'lib/ASNMTAP/Asnmtap/Applications.pm'}            = '$(INST_LIBDIR)/ASNMTAP/Asnmtap/Applications.pm';
$PM{'lib/ASNMTAP/Asnmtap/Applications.pod'}           = '$(INST_LIBDIR)/ASNMTAP/Asnmtap/Applications.pod';
$PM{'lib/ASNMTAP/Asnmtap/Applications/CGI.pm'}        = '$(INST_LIBDIR)/ASNMTAP/Asnmtap/Applications/CGI.pm';
$PM{'lib/ASNMTAP/Asnmtap/Applications/CGI.pod'}       = '$(INST_LIBDIR)/ASNMTAP/Asnmtap/Applications/CGI.pod';
$PM{'lib/ASNMTAP/Asnmtap/Applications/Collector.pm'}  = '$(INST_LIBDIR)/ASNMTAP/Asnmtap/Applications/Collector.pm';
$PM{'lib/ASNMTAP/Asnmtap/Applications/Collector.pod'} = '$(INST_LIBDIR)/ASNMTAP/Asnmtap/Applications/Collector.pod';
$PM{'lib/ASNMTAP/Asnmtap/Applications/Display.pm'}    = '$(INST_LIBDIR)/ASNMTAP/Asnmtap/Applications/Display.pm';
$PM{'lib/ASNMTAP/Asnmtap/Applications/Display.pod'}   = '$(INST_LIBDIR)/ASNMTAP/Asnmtap/Applications/Display.pod';

$PM{'lib/ASNMTAP/Asnmtap/Plugins.pm'}                 = '$(INST_LIBDIR)/ASNMTAP/Asnmtap/Plugins.pm';
$PM{'lib/ASNMTAP/Asnmtap/Plugins.pod'}                = '$(INST_LIBDIR)/ASNMTAP/Asnmtap/Plugins.pod';
$PM{'lib/ASNMTAP/Asnmtap/Plugins/IO.pm'}              = '$(INST_LIBDIR)/ASNMTAP/Asnmtap/Plugins/IO.pm';
$PM{'lib/ASNMTAP/Asnmtap/Plugins/IO.pod'}             = '$(INST_LIBDIR)/ASNMTAP/Asnmtap/Plugins/IO.pod';
$PM{'lib/ASNMTAP/Asnmtap/Plugins/Mail.pm'}            = '$(INST_LIBDIR)/ASNMTAP/Asnmtap/Plugins/Mail.pm';
$PM{'lib/ASNMTAP/Asnmtap/Plugins/Mail.pod'}           = '$(INST_LIBDIR)/ASNMTAP/Asnmtap/Plugins/Mail.pod';
$PM{'lib/ASNMTAP/Asnmtap/Plugins/Modem.pm'}           = '$(INST_LIBDIR)/ASNMTAP/Asnmtap/Plugins/Modem.pm';
$PM{'lib/ASNMTAP/Asnmtap/Plugins/Modem.pod'}          = '$(INST_LIBDIR)/ASNMTAP/Asnmtap/Plugins/Modem.pod';
$PM{'lib/ASNMTAP/Asnmtap/Plugins/Nagios.pm'}          = '$(INST_LIBDIR)/ASNMTAP/Asnmtap/Plugins/Nagios.pm';
$PM{'lib/ASNMTAP/Asnmtap/Plugins/Nagios.pod'}         = '$(INST_LIBDIR)/ASNMTAP/Asnmtap/Plugins/Nagios.pod';
$PM{'lib/ASNMTAP/Asnmtap/Plugins/NPTest.pm'}          = '$(INST_LIBDIR)/ASNMTAP/Asnmtap/Plugins/NPTest.pm';
$PM{'lib/ASNMTAP/Asnmtap/Plugins/SOAP.pm'}            = '$(INST_LIBDIR)/ASNMTAP/Asnmtap/Plugins/SOAP.pm';
$PM{'lib/ASNMTAP/Asnmtap/Plugins/SOAP.pod'}           = '$(INST_LIBDIR)/ASNMTAP/Asnmtap/Plugins/SOAP.pod';
$PM{'lib/ASNMTAP/Asnmtap/Plugins/WebTransact.pm'}     = '$(INST_LIBDIR)/ASNMTAP/Asnmtap/Plugins/WebTransact.pm';
$PM{'lib/ASNMTAP/Asnmtap/Plugins/WebTransact.pod'}    = '$(INST_LIBDIR)/ASNMTAP/Asnmtap/Plugins/WebTransact.pod';
$PM{'lib/ASNMTAP/Asnmtap/Plugins/XML.pod'}            = '$(INST_LIBDIR)/ASNMTAP/Asnmtap/Plugins/XML.pod';
$PM{'lib/ASNMTAP/Asnmtap/Plugins/XML.pm'}             = '$(INST_LIBDIR)/ASNMTAP/Asnmtap/Plugins/XML.pm';

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

Makefile.PL  view on Meta::CPAN

        next if ( $version =~ /^\*\d{2,2}(?:\d{2,2}(?:\d{2,2})?)?$/ );
        $PREREQ_PM{$_} = $version unless ( defined $PREREQ_PM{$_} and $PREREQ_PM{$_} >= $version );
      }
    }
  }
} while (! $proceed);

print "\n";

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

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)



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