4 use warnings FATAL => 'all';
6 use ExtUtils::MakeMaker ();
9 our $VERSION = '0.002000';
10 $VERSION = eval $VERSION;
12 my $MM_VER = eval $ExtUtils::MakeMaker::VERSION;
15 author manifest_include readme_generator
20 warnings->import(FATAL => 'all');
21 shift->export_to_level(1,@_);
38 '' => qr{Changes|MANIFEST|README|LICENSE|META\.yml},
39 'maint' => qr{[^.].*},
42 sub manifest_include {
46 sub readme_generator {
47 die "readme_generator unsupported" if @_ && $_[0];
50 sub write_manifest_skip {
51 my @files = @Manifest;
53 while (my ($dir, $spec) = splice(@files, 0, 2)) {
54 my $re = ($dir ? $dir.'/' : '').
55 ((ref($spec) eq 'Regexp')
59 # print ref as well as stringification in case of overload ""
60 : die "spec must be string or regexp, was: ${spec} (${\ref $spec})");
63 my $final = '^(?!'.join('|', map "${_}\$", @parts).')';
64 open my $skip, '>', 'MANIFEST.SKIP'
65 or die "can't open MANIFEST.SKIP: $!";
66 print $skip "${final}\n";
73 @MM::ISA = (__PACKAGE__);
76 my ($class, $args) = @_;
77 return $class->SUPER::new({
79 MIN_PERL_VERSION => '5.006',
80 AUTHOR => ($MM_VER >= 6.5702 ? $Distar::Author : join(', ', @$Distar::Author)),
82 ABSTRACT_FROM => $args->{VERSION_FROM},
83 test => { TESTS => ($args->{test}{TESTS}||'t/*.t').' xt/*.t xt/*/*.t' },
84 realclean => { FILES => (
85 ($args->{realclean}{FILES}||'')
86 . ' Distar/ MANIFEST.SKIP MANIFEST MANIFEST.bak'
93 Distar::write_manifest_skip();
94 $self->SUPER::flush(@_);
99 my $dist_test = $self->SUPER::dist_test(@_);
101 $dist_test .= <<"END";
103 # --- Distar section:
105 REMAKE = \$(PERLRUN) Makefile.PL @{[ map { $self->quote_literal($_) } @ARGV ]}
108 $dist_test .= <<'END';
110 $(ABSPERLRUN) Distar/helpers/preflight $(VERSION)
113 $(RM_RF) $(DISTVNAME)
114 $(MAKE) $(DISTVNAME).tar$(SUFFIX)
115 git commit -a -m "Release commit for $(VERSION)"
116 git tag v$(VERSION) -m "release v$(VERSION)"
117 cpan-upload $(DISTVNAME).tar$(SUFFIX)
118 git push origin v$(VERSION) HEAD
120 readmefile: create_distdir $(DISTVNAME)/README
121 $(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) ../Distar/helpers/add-to-manifest README
122 $(DISTVNAME)/README: $(VERSION_FROM)
123 $(NOECHO) $(MKPATH) $(DISTVNAME)
124 pod2text $(VERSION_FROM) >$(DISTVNAME)/README
125 disttest: distmanicheck
126 distmanicheck: create_distdir
127 cd $(DISTVNAME) && $(ABSPERLRUN) "-MExtUtils::Manifest=manicheck" -e "exit manicheck"
129 $(ABSPERLRUN) Distar/helpers/add-changelog-heading $(VERSION) Changes
130 GIT_DIFF_OPTS=-u`$(ABSPERLRUN) Distar/helpers/changelog-context $(VERSION) Changes` git add -p Changes
132 cd Distar && git pull
138 if (open my $fh, '<', 'maint/Makefile.include') {
139 $include = "\n# --- Makefile.include:\n" . do { local $/; <$fh> };
142 for my $type ('', 'minor', 'major') {
143 if ($include !~ /^bump$type:/m) {
144 my $arg = $type || '$(V)';
145 $dist_test .= <<"END"
147 \$(ABSPERLRUN) Distar/helpers/bump-version --git \$(VERSION) $arg
148 \$(RM_F) \$(FIRST_MAKEFILE)
154 $dist_test .= $include . "\n";