factor out author targets into a plain Makefile.include
[p5sagit/Module-Metadata.git] / maint / Makefile.PL.include
CommitLineData
a4891190 1use strict;
2use warnings FATAL => 'all';
3
4{
5 package MY;
534471a1 6
b98e2d46 7 {
8 no warnings 'once'; push @ExtUtils::MakeMaker::Overridable, 'find_tests';
9 }
534471a1 10
a4891190 11 sub find_tests {
12 shift->SUPER::find_tests.' xt/*.t';
13 }
534471a1 14
9a785a3b 15 sub postamble { 'include maint/Makefile.include' }
a4891190 16}
17
18{
19 no warnings 'redefine';
20 sub WriteMakefile {
21 my %args = @_;
22 ExtUtils::MakeMaker::WriteMakefile(
23 %args,
24 AUTHOR => 'Ken Williams <kwilliams@cpan.org>, Randy W. Sims <RandyS@ThePierianSpring.org>',
25 ABSTRACT_FROM => $args{VERSION_FROM},
26 );
27 }
28}
29
30sub manifest_include {
31 use autodie;
32 my @files = @_;
33 my @parts;
34 while (my ($dir, $spec) = splice(@files, 0, 2)) {
35 my $re = ($dir ? $dir.'/' : '').
36 ((ref($spec) eq 'Regexp')
37 ? $spec
38 : !ref($spec)
39 ? ".*\Q${spec}\E"
40 : die "spec must be string or regexp, was: ${spec} (${\ref $spec})");
41 push @parts, $re;
42 }
43 my $final = '^(?!'.join('|', map "${_}\$", @parts).')';
44 open my $skip, '>', 'MANIFEST.SKIP';
45 print $skip "${final}\n";
46 close $skip;
47}
48
49manifest_include(
50 'lib' => '.pm',
51 't' => '.t',
52 't/lib' => '.pm',
80b3eb9c 53 'xt' => '.t',
54 'xt/lib' => '.pm',
a4891190 55 '' => '.PL',
f1d18ad3 56 '' => qr{Changes|MANIFEST|README|META\.yml},
57 'maint' => qr{[^.].*},
a4891190 58);
59
601;