1# Build.PL, (C) IDEALX 2005 (See README for license details)
2
3# This script automatically builds a "Build" file in the current
4# directory (using an in-house subclass to Module::Build), which in
5# turn builds the Test-Group package.
6#
7# If you don't have Module::Build installed, use the following instead:
8#     perl Makefile.PL
9#     make
10#     make test
11#     make install
12
13use 5.004;
14
15use strict;
16use warnings;
17use Module::Build;
18
19
20my $builder = Module::Build->new
21    ( module_name         => 'Test::Group',
22      license             => 'perl',
23      dist_author         => [ 'Nick Cleaton <ncleaton@cpan.org>',
24                               'Dominique Quatravaux <domq@cpan.org>' ],
25      dist_version_from   => 'lib/Test/Group.pm',
26      requires            =>
27      {
28       'Exporter'     => 0,
29       'Test::Simple' => 0.59,  # Test::Builder->create() needed
30       'Test::Builder' => 0,
31       'Test::Cmd' => 0,
32       'File::Spec' => 0,
33       'IO::File' => 0,
34       'Carp' => 0,
35      },
36      build_requires     =>
37      {
38       'Test::More' => 0,
39       'File::Slurp' => 0,
40       'File::Temp' => 0,
41       'File::Spec::Functions' => 0,
42      },
43    add_to_cleanup      => [ 'Test-Group-*' ],
44## The Makefile.PL is now managed by hand:
45#    create_makefile_pl  => 'traditional',
46);
47
48# Fixes an @INC ordering problem dug up by CPAN testers, that causes
49# Module::Build's version detection algorithm to fail; see
50# http://www.nntp.perl.org/group/perl.cpan.testers/2007/02/msg422771.html
51if ( (! ($builder->prereq_failures &&
52         $builder->prereq_failures->{requires}->{"Test::Simple"})) &&
53     (`$^X -MTest::Builder -e "print 'ok' if Test::Builder->can('create');"`
54      !~ m/ok/) ) {
55    die <<"MESSAGE";
56
57ERROR IN PREREQUISITES
58There appears to be several versions of Test::Builder installed on your
59system, and I am not picking up the most recent one; Test::Group will not
60work in this situation.
61
62Please uninstall the oldest version of Test::Builder on your system,
63or otherwise rearrange the modules so that a recent version of
64Test::Builder comes first in \@INC (@INC)
65
66MESSAGE
67}
68
69$builder->create_build_script();
70
711;
72