#!/usr/bin/perl ########################################### # mr -- Module Releaser # Mike Schilli, 2002 (m@perlmeister.com) ########################################### use warnings; use strict; use Pod::Usage; our $VERSION = "0.03"; our $CVSVERSION = '$Revision: 1.3 $'; pod2usage "usage: $0" if @ARGV; my $MAKE = "gmake"; my $CVS = "cvs"; my $MKM = "mkm"; my $UR = "updreadme"; ########################################### # Cleanup ########################################### print "Cleanup ...\n"; if(-f "Makefile") { # Make clean system("$MAKE clean") and die "Cannot run $MAKE"; } unlink "Makefile.old" if -f "Makefile.old"; my @tarfiles = <*.tar.gz>; if(@tarfiles) { unlink @tarfiles or die "Cannot unlink @tarfiles"; } ########################################### # Update the README file ########################################### my $version = ""; print "Updating README ...\n"; open PIPE, "$UR |" or die "failed"; while() { ($version) = /((?:\d+\.)+\d+)/; } close PIPE or die "failed"; ########################################### # Update the MANIFEST ########################################### print "Updating MANIFEST ...\n"; system("$MKM") and die "failed"; ########################################### # Do we have entries in Changes? ########################################### print "Checking Changes ...\n"; open FILE, "; close FILE; if($data !~ /$version/) { print "No entry in Changes for $version. Please add.\n"; exit 1; } ########################################### # Check if there's anything not checked # into CVS ########################################### print "CVS check ...\n"; open PIPE, "$CVS -q update |" or die "Cannot $CVS update"; while() { if(/ /) { chomp; print "Whoops -- something's not checked in:\n"; print " '$_'\n"; print "Please run a $CVS update to verify.\n"; exit 1; } } close PIPE or die "Cannot $CVS update"; ########################################### # Tag the release ########################################### (my $tagversion = $version) =~ s/\./_/g; print "Tagging release with $tagversion ...\n"; system("$CVS -Q tag rel_$tagversion") and die "failed"; ########################################### # Do the tarball ########################################### system("perl Makefile.PL") and die ""; system("$MAKE test") and die ""; system("$MAKE tardist") and die ""; system("$MAKE clean") and die ""; unlink "Makefile.old" if -f "Makefile.old"; print "\nRelease Tarball v$version ready.\n"; __END__ =head1 NAME mr - Release a CVS-controlled Perl module =head1 DOWNLOAD _SRC_HERE_ =head1 SYNOPSIS mr =head1 REQUIREMENTS It requires the scripts C and C, freely available from http://perlmeister.com/scripts =head1 DESCRIPTION Releasing a CVS-controlled Perl module requires a number of repetitive tasks: Verify if everything's checked in, check if we have entries in C for the current release, update the MANIFEST file, update the README, figure out the current release number, tag all files in the CVS with it and finally generate the tarball. This script does it all. =head1 LEGALESE Copyright 2002 by Mike Schilli, all rights reserved. This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself. =head1 AUTHOR Mike Schilli Em@perlmeister.comE