4 use warnings FATAL => 'all';
6 use ExtUtils::MakeMaker ();
12 our $VERSION = '0.002000';
13 $VERSION = eval $VERSION;
15 my $MM_VER = eval $ExtUtils::MakeMaker::VERSION;
18 author manifest_include readme_generator
23 warnings->import(FATAL => 'all');
24 shift->export_to_level(1,@_);
41 '' => qr{Changes|MANIFEST|README|LICENSE|META\.yml},
42 'maint' => qr{[^.].*},
45 sub manifest_include {
49 sub readme_generator {
50 die "readme_generator unsupported" if @_ && $_[0];
53 sub write_manifest_skip {
54 my @files = @Manifest;
56 while (my ($dir, $spec) = splice(@files, 0, 2)) {
57 my $re = ($dir ? $dir.'/' : '').
58 ((ref($spec) eq 'Regexp')
62 # print ref as well as stringification in case of overload ""
63 : die "spec must be string or regexp, was: ${spec} (${\ref $spec})");
66 my $final = '^(?!'.join('|', map "${_}\$", @parts).')';
67 open my $skip, '>', 'MANIFEST.SKIP'
68 or die "can't open MANIFEST.SKIP: $!";
69 print $skip "${final}\n";
76 @MM::ISA = (__PACKAGE__);
79 my ($class, $args) = @_;
80 return $class->SUPER::new({
82 MIN_PERL_VERSION => '5.006',
83 AUTHOR => ($MM_VER >= 6.5702 ? $Distar::Author : join(', ', @$Distar::Author)),
85 ABSTRACT_FROM => $args->{VERSION_FROM},
86 test => { TESTS => ($args->{test}{TESTS}||'t/*.t').' xt/*.t xt/*/*.t' },
87 realclean => { FILES => (
88 ($args->{realclean}{FILES}||'')
89 . ' Distar/ MANIFEST.SKIP MANIFEST MANIFEST.bak'
96 Distar::write_manifest_skip();
97 $self->SUPER::flush(@_);
102 my $dist_test = $self->SUPER::dist_test(@_);
104 $dist_test .= <<"END";
106 # --- Distar section:
108 REMAKE = \$(PERLRUN) Makefile.PL @{[ map { $self->quote_literal($_) } @ARGV ]}
111 $dist_test .= <<'END';
113 $(ABSPERLRUN) Distar/helpers/preflight $(VERSION)
116 $(RM_RF) $(DISTVNAME)
117 $(MAKE) $(DISTVNAME).tar$(SUFFIX)
118 git commit -a -m "Release commit for $(VERSION)"
119 git tag v$(VERSION) -m "release v$(VERSION)"
120 cpan-upload $(DISTVNAME).tar$(SUFFIX)
121 git push origin v$(VERSION) HEAD
123 readmefile: create_distdir $(DISTVNAME)/README
124 $(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) ../Distar/helpers/add-to-manifest README
125 $(DISTVNAME)/README: $(VERSION_FROM)
126 $(NOECHO) $(MKPATH) $(DISTVNAME)
127 pod2text $(VERSION_FROM) >$(DISTVNAME)/README
128 disttest: distmanicheck
129 distmanicheck: create_distdir
130 cd $(DISTVNAME) && $(ABSPERLRUN) "-MExtUtils::Manifest=manicheck" -e "exit manicheck"
132 $(ABSPERLRUN) Distar/helpers/add-changelog-heading $(VERSION) Changes
135 cd Distar && git pull
141 if (open my $fh, '<', 'maint/Makefile.include') {
142 $include = "\n# --- Makefile.include:\n" . do { local $/; <$fh> };
145 for my $type ('', 'minor', 'major') {
146 if ($include !~ /^bump$type:/m) {
147 my $arg = $type || '$(V)';
148 $dist_test .= <<"END"
150 \$(ABSPERLRUN) Distar/helpers/bump-version --git \$(VERSION) $arg
151 \$(RM_F) \$(FIRST_MAKEFILE)
157 $dist_test .= $include . "\n";