fixup version bump to nuke Makefile, make Makefile.PL use new location of maint include
[p5sagit/Module-Metadata.git] / maint / Makefile.PL.include
CommitLineData
a4891190 1use strict;
2use warnings FATAL => 'all';
3
534471a1 4my $POSTAMBLE = q{bump:
5 maint/bump-version
f1d18ad3 6 rm Makefile
534471a1 7bumpminor:
8 maint/bump-version minor
f1d18ad3 9 rm Makefile
534471a1 10bumpmajor:
11 maint/bump-version major
f1d18ad3 12 rm Makefile
13upload: $(DISTVNAME).tar$(SUFFIX)
14 cpan-upload $<
534471a1 15};
16
a4891190 17{
18 package MY;
534471a1 19
b98e2d46 20 {
21 no warnings 'once'; push @ExtUtils::MakeMaker::Overridable, 'find_tests';
22 }
534471a1 23
a4891190 24 sub find_tests {
25 shift->SUPER::find_tests.' xt/*.t';
26 }
534471a1 27
28 sub postamble { $POSTAMBLE }
a4891190 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
43sub 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
62manifest_include(
63 'lib' => '.pm',
64 't' => '.t',
65 't/lib' => '.pm',
80b3eb9c 66 'xt' => '.t',
67 'xt/lib' => '.pm',
a4891190 68 '' => '.PL',
f1d18ad3 69 '' => qr{Changes|MANIFEST|README|META\.yml},
70 'maint' => qr{[^.].*},
a4891190 71);
72
731;