File: Makefile.PL

package info (click to toggle)
libcgi-formbuilder-perl 2.12-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 264 kB
  • ctags: 32
  • sloc: perl: 1,897; makefile: 2
file content (42 lines) | stat: -rw-r--r-- 1,243 bytes parent folder | download
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
use ExtUtils::MakeMaker;

# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.

sub modcheck () {
    # check to see if our template modules are present, as they're optional
    my $failed = '';
    for ('HTML::Template 2.06', 'Text::Template 1.43', 'Template 2.08') {
        my($mod,$ver) = split;
        eval "use $mod $ver";
        if ($@) {
            my($err) = split / at | \(/, $@;
            $failed .= "    $_  ($err)\n";
        }
    }
    if ($failed) {
        warn <<EOW;

Warning: The following OPTIONAL template modules are not installed:

$failed
FormBuilder will still work just fine, a-ok, no problem... unless you
want to use one of these modules for templates. You can always install
them later, FormBuilder will run without them.

EOW
        sleep 3;
    }
    return {};      # hashref is expected by MakeMaker
}

WriteMakefile(
    NAME           => 'CGI::FormBuilder',
    VERSION_FROM   => 'FormBuilder.pm',     # finds $VERSION
    PREREQ_PM      => { CGI => 0 },
    CONFIGURE      => \&modcheck,
    ($] >= 5.005 ?
      (ABSTRACT_FROM => 'FormBuilder.pod',  # abstract from POD
       AUTHOR        => 'Nathan Wiger (nate@sun.com)') : ()
    ),
);