3 # Make a fetchmail release.
4 # Dumps a release notice and diffs as a MIME multipart message
7 use POSIX qw(strftime);
8 $timezone = strftime('%z', localtime) || "-0500";
9 $tmp = $ENV{TMPDIR} || $ENV{TMP} || $ENV{TEMP} || "/tmp";
11 $project = "fetchmail";
12 $svnrepos = "https://decoy.wox.org/svn/$project";
13 $website = "http://developer.berlios.de/projects/$project";
14 $mailfrom = "<$project-devel-owner\@lists.berlios.de> (Fetchmail Development Team)";
20 $errnull = "2>/dev/null";
21 while ($i = shift @ARGV)
23 if ($i =~ /^(--diffs|-d)$/i)
29 if ($i =~ /^(--verbose|-v)$/i)
36 die "Error: Unknown option: $i\n";
39 # extract version from source
40 $version=`grep 'AC_INIT' configure.ac`;
41 $version =~ /AC_INIT\([^,]*,\[?([0-9.rc-]+)\]?\)/;
43 die "cannot determine version" unless defined $1;
44 $tag = "RELEASE_$version";
47 # extract existing tags
48 open(ID, "-|", "svn", "ls", $svnrepos . "/tags") || die "cannot run svn ls: $!\naborting";
50 if (m{^(RELEASE_.*)/}) {
51 unshift(@versions, $1);
54 close ID || die "svn ls failed, aborting";
56 if ($versions[0] eq $tag) {
58 $oldtag = $versions[1];
61 $oldtag = $versions[0];
64 $ENV{PATH} .= ":./dist-tools:./dist-tools/shipper:.";
66 print "Building $version release, tag $tag, previous tag $oldtag\n";
68 if (-d autom4te.cache) {
69 system("rm -rf autom4te.cache")
70 and die "Failure in removing autom4te.cache";
73 if (system("autoreconf -isv")) {
74 die("Failure in regenerating autoconf files\n");
77 if (system("./configure && make clean && make -C po update-po && make clean")) {
78 die("Failure in translation-file rebuild\n");
81 print "### Test-building the software...\n";
82 if (system("./configure && make clean && make distcheck")) {
83 die("Compilation failure\n");
86 print "### Building the distribution...\n";
87 if (system("make dist $null")) {
88 die("Distribution-build failure\n");
91 print "### Building the RPMs...\n";
92 if (system("buildrpms $project-${version}.tar.gz $null")) {
93 die("RPM-build failure\n");
96 open(REPORT, ">$tmp/$project.PREAMBLE.$$");
100 Subject: The $version release of $project is available
102 The $version release of $project is now available at the usual locations,
103 including <URL:$website>.
105 The source archive is available at:
106 <URL:$website/$project-${version}.tar.gz>
108 Here are the release notes:
112 # Extract the current notes
129 $oldver =~ s/^RELEASE_//;
132 print REPORT "Diffs from the previous ($oldver) release follow as a MIME attachment."
134 print REPORT "By popular demand, diffs from the previous release have been omitted."
141 if ($tag eq '<workfile>') {
142 system("svn diff -r$oldtag $errnull >$tmp/$project.DIFFS.$$");
144 system("svn diff -r$oldtag -r$tag $errnull >$tmp/$project.DIFFS.$$");
147 system("wc <$tmp/$project.DIFFS.$$");
151 ." -D '$project-$tag announcement' -m 'text/plain' -e 7bit -f $tmp/$project.PREAMBLE.$$"
152 ." -n -D 'diff between $oldver and $version' -m 'text/plain' -e 7bit -f $tmp/$project.DIFFS.$$"
153 ." -o ANNOUNCE.EMAIL";
155 rename("$tmp/$project.PREAMBLE.$$", "ANNOUNCE.EMAIL");
157 #system("chown esr ANNOUNCE.EMAIL");
158 #chmod(0700, "ANNOUNCE.EMAIL");
160 #unlink("$tmp/$project.PREAMBLE.$$");
161 unlink("$tmp/$project.DIFFS.$$");
163 print "Building index page...\n";
164 system("rm -f index.html; indexgen.sh");
166 if (-r "testsites") {
167 print "Building test server list...\n";
168 system("rm -f testservers.html; testservers-gen.sh >testservers.html");
171 print "Making activity graph...";
176 # makerelease ends here