| 1 |
# Load the Module::Install bundled in ./inc/ |
| 2 |
use inc::Module::Install; |
| 3 |
|
| 4 |
############################################################################## |
| 5 |
# Define metadata (we read it from the binary) |
| 6 |
|
| 7 |
name 'check_lm_sensors'; |
| 8 |
version_from 'check_lm_sensors'; |
| 9 |
perl_version_from 'check_lm_sensors'; |
| 10 |
all_from 'check_lm_sensors.pod'; |
| 11 |
|
| 12 |
############################################################################## |
| 13 |
# Specific dependencies |
| 14 |
|
| 15 |
include 'version'; |
| 16 |
|
| 17 |
my %prereqs = ( |
| 18 |
'Carp' => 0, |
| 19 |
'English' => 0, |
| 20 |
'Getopt::Long' => 0, |
| 21 |
'List::MoreUtils' => 0, |
| 22 |
'version' => 0, |
| 23 |
); |
| 24 |
|
| 25 |
if( eval { require Monitoring::Plugin } ) { |
| 26 |
$prereqs{'Monitoring::Plugin'} = 0.31; |
| 27 |
} |
| 28 |
else { |
| 29 |
$prereqs{'Nagios::Plugin'} = 0; |
| 30 |
} |
| 31 |
|
| 32 |
if( eval { require Monitoring::Plugin::Threshold } ) { |
| 33 |
$prereqs{'Monitoring::Plugin::Threshold'} = 0; |
| 34 |
} |
| 35 |
else { |
| 36 |
$prereqs{'Nagios::Plugin::Threshold'} = 0; |
| 37 |
} |
| 38 |
|
| 39 |
if( eval { require Monitoring::Plugin::Getopt } ) { |
| 40 |
$prereqs{'Monitoring::Plugin::Getopt'} = 0; |
| 41 |
} |
| 42 |
else { |
| 43 |
$prereqs{'Nagios::Plugin::Getopt'} = 0; |
| 44 |
} |
| 45 |
|
| 46 |
install_script 'check_lm_sensors'; |
| 47 |
|
| 48 |
auto_install; |
| 49 |
|
| 50 |
WriteMakefile( |
| 51 |
PREREQ_PM => \%prereqs, |
| 52 |
INSTALLSCRIPT => '/usr/lib/nagios/plugins/contrib', |
| 53 |
INSTALLBIN => '/usr/lib/nagios/plugins/contrib', |
| 54 |
INSTALLSITESCRIPT => '/usr/lib/nagios/plugins/contrib', |
| 55 |
); |