File: Build.PL

package info (click to toggle)
libhtml-mason-perl 1%3A1.39-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 2,072 kB
  • ctags: 1,535
  • sloc: perl: 17,624; sh: 187; makefile: 12
file content (62 lines) | stat: -rw-r--r-- 1,567 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
use strict;

use 5.006;

use lib 'inc';

use Mason::Build;

use File::Spec;

my %prereq = ( 'Cache::Cache'     => 1.00,
               'Class::Container' => 0.07,
               'CGI'              => 2.46,
               'Exception::Class' => 1.15,
               'File::Spec'       => 0.8,
               'Params::Validate' => 0.70,
               'Scalar::Util'     => 1.01,
             );

my $is_dist = grep { /dist=1/ } @ARGV;

unless ($is_dist)
{
    my $has_mod_perl_1 = eval { require mod_perl } || 0;
    if ($has_mod_perl_1)
    {
        $prereq{mod_perl} = 1.24;
    }

    my $has_mod_perl_2 = eval { require mod_perl2 } || 0;
    my $has_only_mp2 = ! $has_mod_perl_1 && $has_mod_perl_2;

    # XXX - this really isn't right since we really want to know which
    # version of mod_perl they _intend_ to use with Mason, rather than
    # just blindly adding all these prereqs.
    if ($has_mod_perl_1)
    {
        $prereq{'Apache::Request'} = 1.05; # minimum for OSX
    }

    if ($has_only_mp2)
    {
        $prereq{CGI} = 3.08;
        $prereq{mod_perl2} = 1.999022;
    }
}

my $build = Mason::Build->new
  ( module_name => 'HTML::Mason',
    requires    => \%prereq,
    build_requires => { 'HTML::Entities' => 0,
                        'Module::Build'  => 0.26,
                        'Test'           => 0,
                        'Test::Builder'  => 0,
                      },
    license     => 'perl',
    create_makefile_pl => 'passthrough',
    is_dist     => $is_dist,
    recursive_test_files => 1,
  );

$build->create_build_script;