File: Makefile.PL

package info (click to toggle)
libobject-insideout-perl 3.64-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 812 kB
  • ctags: 149
  • sloc: perl: 4,730; makefile: 2
file content (139 lines) | stat: -rw-r--r-- 3,972 bytes parent folder | download | duplicates (2)
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
130
131
132
133
134
135
136
137
138
139
# 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 ($@) {
    # Not found - require minimum version
    $Scalar::Util::VERSION = 1.10;
} elsif (! Scalar::Util->can('weaken')) {
    # Scalar::Util is 'pure Perl' version
    if ($Scalar::Util::VERSION eq '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_
    }
    if ($Scalar::Util::VERSION lt '1.10') {
        # Require minimum version
        $Scalar::Util::VERSION = 1.10;
    } else {
        # Require next higher version
        $Scalar::Util::VERSION += 0.01;
    }
}


# 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.12) {
    print(<<_WANT_);

Checking prerequisites...
 * Want ($Want::VERSION) is installed, but we prefer to have 0.12 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 < 5.04) {
    print(<<_MRMA_);

Checking prerequisites...
 * Math::Random::MT::Auto ($Math::Random::MT::Auto::VERSION) is installed, but we prefer to have 5.04 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'     => 0,
                         'Scalar::Util'     => $Scalar::Util::VERSION,
                         'Exception::Class' => 1.29,
                         'Test::More'       => 0.50,
                       },
    ((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: 5.04' >>$(DISTVNAME)/META.yml
	$(NOECHO) $(ECHO) '    Want: 0.12' >>$(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