#!/usr/bin/perl # # Make a fetchmail release. Must be run as root, to make RPMs. # Dumps a release notice and diffs as a MIME multipart message # in RELEASE_NOTES # $timezone = "-0500"; $diffs = 0; $verbose = 0; $null = ">/dev/null"; while ($i = shift @ARGV) { if ($i =~ /^(--diffs|-d)$/i) { $diffs = 1; next; } if ($i =~ /^(--verbose|-v)$/i) { $verbose = 1; $null = ""; next; } die "Error: Unknown option: $i\n"; } $version=`grep 'VERSION *=' Makefile.in`; $version =~ /VERSION *= *(.*)/; $version = $1; $rcsid = $version; $rcsid =~ tr/./-/; open(ID, "rlog -h NEWS|"); while () { last if /^symbolic names/; } while () { if (/^\t(.*):/) { push(@versions, $1); } } close(ID); if ($versions[0] eq $rcsid) { $rcsid = $versions[0]; $oldid = $versions[1]; } else { $rcsid = ''; $oldid = $versions[0]; } #$ENV{'PATH'} = "~esr/bin:/bin:/usr/bin"; print "Building $version release, RCS ID $rcsid, previous RCS ID $oldid\n"; print "### Test-building the software...\n"; if (system("configure --disable-nls; make")) { die("Compilation failure\n"); } print "### Building the distribution...\n"; if (system("make dist $null")) { die("Distribution-build failure\n"); } print "### Building the RPMs...\n"; if (system("make rpm $null && chown esr *.rpm")) { die("RPM-build failure\n"); } # Clean up permissions so next build won't foo up. system("chown esr config.log stamp-h po/Makefile"); open(REPORT, ">PREAMBLE.$$"); print REPORT <. The source archive is available at: Here are the release notes: EOF # Extract the current notes open(NEWS, "NEWS"); while () { if (/^fetchmail/) { print REPORT $_; last; } } while () { if (/^fetchmail/) { last; } print REPORT $_; } $oldrcs = $oldid; $oldrcs =~ tr/-/./; if ($diffs) { print REPORT "Diffs from the previous ($oldrcs) release follow as a MIME attachment." } else { print REPORT "By popular demand, diffs from the previous release have been omitted." } close(NEWS); close(REPORT); if ($rcsid eq '') { system("rcsdiff -u -r$oldid RCS/* 2>/dev/null >DIFFS.$$"); } else { system("rcsdiff -u -r$oldid -r$rcsid RCS/* 2>/dev/null >DIFFS.$$"); } print "Diff size:"; system("wc testservers.html"); print "Making activity graph..."; growthplot; print "Making LSM..."; $keywords="mail, client, POP, POP2, POP3, APOP, RPOP, KPOP, IMAP, ETRN, ODMR, SMTP, ESMTP, GSSAPI, RPA, NTLM, CRAM-MD5, SASL" system("rpm2lsm $version -k $keywords fetchmail-$version-1.i386.rpm >fetchmail.lsm"); system("ls -l fetchmail.lsm") print "Done\n"; # makerelease ends here