File: Makefile.PL.include

package info (click to toggle)
libmodule-metadata-perl 1.000009-1%2Bdeb7u1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 212 kB
  • sloc: perl: 1,644; makefile: 2
file content (61 lines) | stat: -rw-r--r-- 1,276 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
use strict;
use warnings FATAL => 'all';

{
  package MY;

  {
    no warnings 'once'; push @ExtUtils::MakeMaker::Overridable, 'find_tests';
  }

  sub find_tests {
    shift->SUPER::find_tests.' xt/*.t';
  }

  sub postamble { 'include maint/Makefile.include' }
}

{
  no warnings 'redefine';
  sub WriteMakefile {
    my %args = @_;
    ExtUtils::MakeMaker::WriteMakefile(
      %args,
      AUTHOR => 'Ken Williams <kwilliams@cpan.org>, Randy W. Sims <RandyS@ThePierianSpring.org>',
      ABSTRACT_FROM => $args{VERSION_FROM},
      LICENSE => 'perl',
    );
  }
}

sub manifest_include {
  use autodie;
  my @files = @_;
  my @parts;
  while (my ($dir, $spec) = splice(@files, 0, 2)) {
    my $re = ($dir ? $dir.'/' : '').
      ((ref($spec) eq 'Regexp')
        ? $spec
        : !ref($spec)
          ? ".*\Q${spec}\E"
          : die "spec must be string or regexp, was: ${spec} (${\ref $spec})");
    push @parts, $re;
  }
  my $final = '^(?!'.join('|', map "${_}\$", @parts).')';
  open my $skip, '>', 'MANIFEST.SKIP';
  print $skip "${final}\n";
  close $skip;
}

manifest_include(
  'lib' => '.pm',
  't' => '.t',
  't/lib' => '.pm',
  'xt' => '.t',
  'xt/lib' => '.pm',
  '' => '.PL',
  '' => qr{Changes|MANIFEST|README|META\.yml},
  'maint' => qr{[^.].*},
);

1;