File: Makefile.PL

package info (click to toggle)
libperl-version-perl 1.009-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 176 kB
  • ctags: 37
  • sloc: perl: 2,111; makefile: 2
file content (60 lines) | stat: -rw-r--r-- 1,422 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
use strict;
use warnings;
use ExtUtils::MakeMaker;

eval 'use ExtUtils::MakeMaker::Coverage';

my %EXE = (
  'perl-reversion' => {
    PREREQ_PM => {
      'Getopt::Long' => '2.34',
      'Pod::Usage'   => '1.3',
      'File::Slurp'  => '9999.12',
    },
    EXE_FILES => ['examples/perl-reversion'],
  }
);

my %ARGS = (
  license( 'perl' ),
  NAME          => 'Perl::Version',
  AUTHOR        => 'Andy Armstrong <andy@hexten.net>',
  VERSION_FROM  => 'lib/Perl/Version.pm',
  ABSTRACT_FROM => 'lib/Perl/Version.pm',
  PL_FILES      => {},
  PREREQ_PM     => {
    'Test::More'   => 0,
    'Scalar::Util' => 0,
  },
  dist  => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
  clean => { FILES    => 'Perl-Version-*' },
);

$ARGS{SIGN} = 1 if MM->can( 'signature_target' );

while ( my ( $exe, $spec ) = each %EXE ) {
  my $yn = prompt( "Install $exe script?", "N" );
  if ( $yn =~ /^y/i ) {
    while ( my ( $key, $val ) = each %$spec ) {
      if ( ref $val eq 'HASH' ) {
        $ARGS{$key} = { %{ $ARGS{$key} || {} }, %$val };
      }
      elsif ( ref $val eq 'ARRAY' ) {
        push @{ $ARGS{$key} }, @$val;
      }
      else {
        die "Can't merge $key: value not handled\n";
      }
    }
  }
}

WriteMakefile( %ARGS );

sub license {
  my $lic = shift;
  local $^W = 0;    # Silence warning about non-numeric version
  return
   unless $ExtUtils::MakeMaker::VERSION >= '6.31';
  return ( LICENSE => $lic );
}