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 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
|
# Module makefile for Object::InsideOut (using ExtUtils::MakeMaker)
require 5.006;
use strict;
use warnings;
use ExtUtils::MakeMaker;
# Check for Scalar::Util::weaken()
eval { require Scalar::Util; };
if (! $@ &&
! Scalar::Util->can('weaken') &&
$Scalar::Util::VERSION ge '1.20')
{
die <<_NO_WEAKEN_;
You must reinstall Scalar::Util in order to install Object::InsideOut
because the currently installed Scalar::Util is a 'pure perl' version
that is missing the 'weaken()' function.
_NO_WEAKEN_
}
# Check for Want module
eval { require Want; };
if ($@) {
print(<<_WANT_);
Checking prerequisites...
* Optional prerequisite Want is not installed
ERRORS/WARNINGS FOUND IN PREREQUISITES. You may wish to install the versions
of the modules indicated above before proceeding with this installation
_WANT_
} elsif ($Want::VERSION < 0.21) {
print(<<_WANT_);
Checking prerequisites...
* Want ($Want::VERSION) is installed, but we prefer to have 0.21 or later
ERRORS/WARNINGS FOUND IN PREREQUISITES. You may wish to install the versions
of the modules indicated above before proceeding with this installation
_WANT_
}
# Check for MRMA
eval { require Math::Random::MT::Auto; };
if ($@) {
print(<<_MRMA_);
Checking prerequisites...
* Optional prerequisite Math::Random::MT::Auto is not installed
ERRORS/WARNINGS FOUND IN PREREQUISITES. You may wish to install the versions
of the modules indicated above before proceeding with this installation
_MRMA_
} elsif ($Math::Random::MT::Auto::VERSION < 6.18) {
print(<<_MRMA_);
Checking prerequisites...
* Math::Random::MT::Auto ($Math::Random::MT::Auto::VERSION) is installed, but we prefer to have 6.18 or later
ERRORS/WARNINGS FOUND IN PREREQUISITES. You may wish to install the versions
of the modules indicated above before proceeding with this installation
_MRMA_
}
# Construct make file
WriteMakefile(
'NAME' => 'Object::InsideOut',
'AUTHOR' => 'Jerry D. Hedden <jdhedden AT cpan DOT org>',
'VERSION_FROM' => 'lib/Object/InsideOut.pm',
'ABSTRACT_FROM' => 'lib/Object/InsideOut.pod',
'PREREQ_PM' => { 'strict' => 0,
'warnings' => 0,
'attributes' => 0,
'overload' => 0,
'Config' => 0,
'B' => 0,
'Data::Dumper' => 2.131,
'Scalar::Util' => 1.23,
'Exception::Class' => 1.32,
'Test::More' => 0.98,
},
((ExtUtils::MakeMaker->VERSION() lt '6.25')
? ('PL_FILES' => { }) : ()),
((ExtUtils::MakeMaker->VERSION() gt '6.30')
? ('LICENSE' => 'perl') : ()),
);
package MY;
# Add to metafile target
sub metafile
{
my $inherited = shift->SUPER::metafile_target(@_);
$inherited .= <<'_MOREMETA_';
$(NOECHO) $(ECHO) 'recommends:' >>$(DISTVNAME)/META.yml
$(NOECHO) $(ECHO) ' Math::Random::MT::Auto: 6.18' >>$(DISTVNAME)/META.yml
$(NOECHO) $(ECHO) ' Want: 0.21' >>$(DISTVNAME)/META.yml
_MOREMETA_
return $inherited;
}
# Additional 'make' targets
sub postamble
{
return <<'_EXTRAS_';
fixfiles:
@dos2unix `cat MANIFEST`
@$(CHMOD) 644 `cat MANIFEST`
yapi:
$(NOECHO) $(ABSPERLRUN) -MExtUtils::Install -e 'pm_to_blib({@ARGV}, '\''$(INST_LIB)/auto'\'', '\''$(PM_FILTER)'\'')' -- \
examples/YAPI.pm blib/lib/Term/YAPI.pm
$(NOECHO) $(TOUCH) pm_to_blib
_EXTRAS_
}
# EOF
|