return $class->SUPER::new({
LICENSE => 'perl_5',
MIN_PERL_VERSION => '5.006',
- AUTHOR => ($MM_VER >= 6.5702 ? $Distar::Author : join(', ', @$Distar::Author)),
+ ($Distar::AUTHOR ? (
+ AUTHOR => ($MM_VER >= 6.5702 ? $Distar::Author : join(', ', @$Distar::Author)),
+ ) : ()),
(exists $args->{ABSTRACT} ? () : (ABSTRACT_FROM => $args->{VERSION_FROM})),
%$args,
test => \%test,
$targets;
}
+ sub init_dist {
+ my $self = shift;
+ my $pre_tar = $self->{TAR};
+ my $out = $self->SUPER::init_dist(@_);
+
+ my $tar = $self->{TAR};
+ my $gtar;
+ my $set_user;
+ my $version = `$tar --version`;
+ if ($version =~ /GNU tar/) {
+ $gtar = 1;
+ }
+ elsif (!$pre_tar && `gtar --version`) {
+ $tar = 'gtar';
+ $gtar = 1;
+ }
+ my $tarflags = $self->{TARFLAGS};
+ if (my ($flags) = $tarflags =~ /^-?([cvhlLf]+)$/) {
+ if ($flags =~ s/c// && $flags =~ s/f//) {
+ $tarflags = '--format=ustar -c'.$flags.'f';
+ if ($gtar) {
+ $tarflags = '--owner=0 --group=0 '.$tarflags;
+ $set_user = 1;
+ }
+ }
+ }
+
+ if (!$set_user) {
+ my $warn = '';
+ if ($> >= 2**21) {
+ $warn .= "uid ($>)";
+ }
+ if ($) >= 2**21) {
+ $warn .= ($warn ? ' and ' : '').'gid('.(0+$)).')';
+ }
+ if ($warn) {
+ warn "$warn too large! Max is ".(2**21-1).".\n"
+ ."Dist creation will likely fail. Install GNU tar to work around.\n";
+ }
+ }
+
+ $self->{TAR} = $tar;
+ $self->{TARFLAGS} = $tarflags;
+
+ $out;
+ }
+
+ sub tarfile_target {
+ my $self = shift;
+ my $out = $self->SUPER::tarfile_target(@_);
+ my $verify = <<'END_FRAG';
+ $(ABSPERLRUN) $(HELPERS)/verify-tarball $(DISTVNAME).tar $(DISTVNAME)/MANIFEST --tar="$(TAR)"
+END_FRAG
+ $out =~ s{(\$\(TAR\).*\n)}{$1$verify};
+ $out;
+ }
+
sub dist_test {
my $self = shift;
BRANCH => $self->{BRANCH} ||= 'master',
CHANGELOG => $self->{CHANGELOG} ||= 'Changes',
DEV_NULL_STDOUT => ($self->{DEV_NULL} ? '>'.File::Spec->devnull : ''),
- FAKE_RELEASE => '',
+ DISTTEST_MAKEFILE_PARAMS => '',
);
+ my $dist_test = $self->SUPER::dist_test(@_);
+ $dist_test =~ s/(\bMakefile\.PL\b)/$1 \$(DISTTEST_MAKEFILE_PARAMS)/;
+
join('',
- $self->SUPER::dist_test(@_),
+ $dist_test,
"\n\n# --- Distar section:\n\n",
(map "$_ = $vars{$_}\n", sort keys %vars),
<<'END',
check-cpan-upload:
$(NOECHO) cpan-upload -h $(DEV_NULL_STDOUT)
releasetest:
- $(MAKE) disttest RELEASE_TESTING=1 PASTHRU="$(PASTHRU) TEST_FILES=\"$(TEST_FILES)\""
+ $(MAKE) disttest RELEASE_TESTING=1 DISTTEST_MAKEFILE_PARAMS="PREREQ_FATAL=1" PASTHRU="$(PASTHRU) TEST_FILES=\"$(TEST_FILES)\""
release: preflight
$(MAKE) releasetest
git commit -a -m "Release commit for $(VERSION)"
git push origin v$(VERSION) HEAD
distdir: readmefile
readmefile: create_distdir
- $(NOECHO) $(MAKE) $(DISTVNAME)/README
+ $(NOECHO) $(TEST_F) $(DISTVNAME)/README || $(MAKE) $(DISTVNAME)/README
$(DISTVNAME)/README: $(VERSION_FROM)
$(NOECHO) $(MKPATH) $(DISTVNAME)
pod2text $(VERSION_FROM) >$(DISTVNAME)/README
$(NOECHO) $(ABSPERLRUN) $(HELPERS)/add-to-manifest -d $(DISTVNAME) README
+distsignature: readmefile
disttest: distmanicheck
distmanicheck: create_distdir
cd $(DISTVNAME) && $(ABSPERLRUN) "-MExtUtils::Manifest=manicheck" -e "exit manicheck"
nextrelease:
$(ABSPERLRUN) $(HELPERS)/add-changelog-heading --git $(VERSION) $(CHANGELOG)
refresh:
- cd $(DISTAR) && git pull
+ cd $(DISTAR) && git pull || $(TRUE)
$(RM_F) $(FIRST_MAKEFILE)
$(REMAKE)
END
F<Makefile.PL>:
use ExtUtils::MakeMaker;
- (do 'maint/Makefile.PL.include' or die $@) unless -f 'META.yml';
+ (do './maint/Makefile.PL.include' or die $@) unless -f 'META.yml';
WriteMakefile(...);
$ make nextrelease # add version heading to Changes file
$ make releasetest # build dist and test (with xt/ and RELEASE_TESTING=1)
$ make preflight # check that repo and file state is release ready
- $ make release # check releasetest and preflight, then build and
- # upload to CPAN, tag release, push tag and branch
+ $ make release # check releasetest and preflight, commits and tags,
+ # builds and uploads to CPAN, and pushes commits and
+ # tag
+ $ make release FAKE_RELEASE=1
+ # builds a release INCLUDING committing and tagging,
+ # but does not upload to cpan or push anything to git
=head1 DESCRIPTION
Releasing will generate a dist tarball and upload it to CPAN using cpan-upload.
It will also create a git tag for the release, and push the tag and branch.
-=head2 FAKE_RELEASE
+=head3 FAKE_RELEASE
If release is run with FAKE_RELEASE=1 set, it will skip uploading to CPAN and
pushing to git. A release commit will still be created and tagged locally.
=head2 bump
Bumps the version number. This will try to preserve the length and format of
-the version number. The least significant digit will be incremented.
+the version number. The least significant digit will be incremented. Versions
+with underscores will preserve the underscore in the same position.
Optionally accepts a C<V> option to set the version to a specific value.
The version changes will automatically be committed. Unstaged modifications to
the files will be left untouched.
+=head3 V
+
+The V option will be passed along to the version bumping script. It can accept
+a space separated list of options, including an explicit version number.
+
+Options:
+
+=over 4
+
+=item --force
+
+Updates version numbers even if they do not match the current expected version
+number.
+
+=item --stable
+
+Attempts to convert the updated version to a stable version, removing any
+underscore.
+
+=item --alpha
+
+Attempts to convert the updated version to an alpha version, adding an
+underscore in an appropriate place.
+
+=back
+
=head2 bumpminor
Like bump, but increments the minor segment of the version. This will treat
haarg - Graham Knop (cpan:HAARG) <haarg@cpan.org>
-ether = Karen Etheridge (cpan:ETHER) <ether@cpan.org>
+ether - Karen Etheridge (cpan:ETHER) <ether@cpan.org>
frew - Arthur Axel "fREW" Schmidt (cpan:FREW) <frioux@gmail.com>