~ubuntu-branches/ubuntu/jaunty/libdata-structure-util-perl/jaunty

« back to all changes in this revision

Viewing changes to Makefile.PL

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan McDowell
  • Date: 2008-03-27 11:33:05 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20080327113305-k49px3pw4yameox0
Tags: 0.15-1
* New upstream release.
  * Fixes building with Perl 5.10. Closes: #467426
* Update Standards-Version to 3.7.3 (no changes).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
unless (eval "use Module::Build::Compat 0.02; 1" ) {
2
 
  print "This module requires Module::Build to install itself.\n";
3
 
 
4
 
  require ExtUtils::MakeMaker;
5
 
  my $yn = ExtUtils::MakeMaker::prompt
6
 
    ('  Install Module::Build from CPAN?', 'y');
7
 
 
8
 
  if ($yn =~ /^y/i) {
9
 
    require Cwd;
10
 
    require File::Spec;
11
 
    require CPAN;
12
 
 
13
 
    # Save this 'cause CPAN will chdir all over the place.
14
 
    my $cwd = Cwd::cwd();
15
 
    my $makefile = File::Spec->rel2abs($0);
16
 
 
17
 
    CPAN::Shell->install('Module::Build::Compat');
18
 
 
19
 
    chdir $cwd or die "Cannot chdir() back to $cwd: $!";
20
 
    exec $^X, $makefile, @ARGV;  # Redo now that we have Module::Build
21
 
  } else {
22
 
    warn " *** Cannot install without Module::Build.  Exiting ...\n";
23
 
    exit 1;
24
 
  }
25
 
}
26
 
Module::Build::Compat->run_build_pl(args => \@ARGV);
27
 
Module::Build::Compat->write_makefile();
 
1
use 5.008;
 
2
 
 
3
use strict;
 
4
 
 
5
use lib qw(inc);
 
6
use Config;
 
7
use Devel::CheckLib;
 
8
use ExtUtils::MakeMaker;
 
9
 
 
10
# Check that we have a C compiler
 
11
check_lib_or_exit();
 
12
 
 
13
my %mm_args = (
 
14
    ( MM->can( 'signature_target' ) ? ( SIGN => 1 ) : () ),
 
15
    NAME          => 'Data::Structure::Util',
 
16
    AUTHOR        => 'Andy Armstrong <andy@hexten.net>',
 
17
    VERSION_FROM  => 'lib/Data/Structure/Util.pm',
 
18
    ABSTRACT_FROM => 'lib/Data/Structure/Util.pm',
 
19
    PL_FILES      => {},
 
20
    PREREQ_PM     => {
 
21
        'Digest::MD5'  => 0,
 
22
        'Scalar::Util' => '1.01',
 
23
        'Test::More'   => 0,
 
24
        'Test::Pod'    => 0,
 
25
        'Test::Simple' => 0,
 
26
    },
 
27
    LIBS   => [''],
 
28
    DEFINE => '',
 
29
    INC    => '',
 
30
    dist   => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
 
31
    clean => { FILES => 'Data-Structure-Util-*' },
 
32
);
 
33
 
 
34
{
 
35
    local $^W = 0;    # Silence warning about non-numeric version
 
36
    if ( $ExtUtils::MakeMaker::VERSION >= '6.31' ) {
 
37
        $mm_args{LICENSE} = 'perl';
 
38
    }
 
39
}
 
40
 
 
41
WriteMakefile( %mm_args );
 
42
 
 
43
package MY;
 
44
 
 
45
sub metafile {
 
46
    my @lines = split /\n/, shift->SUPER::metafile_target( @_ );
 
47
 
 
48
    my @exclude = qw( Devel::CheckLib IO::CaptureOutput );
 
49
    my $pad     = ' ' x 4;
 
50
    die "Can't parse Makefile fragment"
 
51
      unless $lines[-2] =~ /^([^"']*(["'])).*?(\2[^"']*)$/;
 
52
    splice @lines, -1, 0, map { "$1$_$3" } (
 
53
        'no_index:', "${pad}package:",
 
54
        map { "${pad}${pad}- $_" } @exclude
 
55
    );
 
56
 
 
57
    return join "\n", @lines;
 
58
}