fixup version bump to nuke Makefile, make Makefile.PL use new location of maint include
[p5sagit/Module-Metadata.git] / maint / Makefile.PL.include
1 use strict;
2 use warnings FATAL => 'all';
3
4 my $POSTAMBLE = q{bump:
5         maint/bump-version
6         rm Makefile
7 bumpminor:
8         maint/bump-version minor
9         rm Makefile
10 bumpmajor:
11         maint/bump-version major
12         rm Makefile
13 upload: $(DISTVNAME).tar$(SUFFIX)
14         cpan-upload $<
15 };
16
17 {
18   package MY;
19
20   {
21     no warnings 'once'; push @ExtUtils::MakeMaker::Overridable, 'find_tests';
22   }
23
24   sub find_tests {
25     shift->SUPER::find_tests.' xt/*.t';
26   }
27
28   sub postamble { $POSTAMBLE }
29 }
30
31 {
32   no warnings 'redefine';
33   sub WriteMakefile {
34     my %args = @_;
35     ExtUtils::MakeMaker::WriteMakefile(
36       %args,
37       AUTHOR => 'Ken Williams <kwilliams@cpan.org>, Randy W. Sims <RandyS@ThePierianSpring.org>',
38       ABSTRACT_FROM => $args{VERSION_FROM},
39     );
40   }
41 }
42
43 sub manifest_include {
44   use autodie;
45   my @files = @_;
46   my @parts;
47   while (my ($dir, $spec) = splice(@files, 0, 2)) {
48     my $re = ($dir ? $dir.'/' : '').
49       ((ref($spec) eq 'Regexp')
50         ? $spec
51         : !ref($spec)
52           ? ".*\Q${spec}\E"
53           : die "spec must be string or regexp, was: ${spec} (${\ref $spec})");
54     push @parts, $re;
55   }
56   my $final = '^(?!'.join('|', map "${_}\$", @parts).')';
57   open my $skip, '>', 'MANIFEST.SKIP';
58   print $skip "${final}\n";
59   close $skip;
60 }
61
62 manifest_include(
63   'lib' => '.pm',
64   't' => '.t',
65   't/lib' => '.pm',
66   'xt' => '.t',
67   'xt/lib' => '.pm',
68   '' => '.PL',
69   '' => qr{Changes|MANIFEST|README|META\.yml},
70   'maint' => qr{[^.].*},
71 );
72
73 1;