]> Pileus Git - ~andy/fetchmail/blob - makerelease
Added dropdelivered.
[~andy/fetchmail] / makerelease
1 #!/usr/bin/perl
2 #
3 # Make a fetchmail release.  Must be run as root, to make RPMs.
4 # Dumps a release notice and diffs as a MIME multipart message 
5 # in RELEASE_NOTES
6 #
7 $timezone = "-0500";
8
9 $version=`grep 'VERSION *=' Makefile.in`;
10 $version =~ /VERSION *= *(.*)/;
11 $version = $1;
12 $rcsid = $version;
13 $rcsid =~ tr/./-/;
14
15 open(ID, "rlog -h NEWS|");
16 while (<ID>) {
17     last if /^symbolic names/;
18 }
19 while (<ID>) {
20     if (/^\t(.*):/) {
21         push(@versions, $1);
22     }
23 }
24 close(ID);
25
26 if ($versions[0] eq $rcsid) {
27     $rcsid = $versions[0];
28     $oldid = $versions[1];
29 } else {
30     $rcsid = '<workfile>';
31     $oldid = $versions[0];
32 }
33
34 #$ENV{'PATH'} = "~esr/bin:/bin:/usr/bin";
35
36 print "Building $version release, RCS ID $rcsid, previous RCS ID $oldid\n";
37
38 print "Test-building the software...\n";
39 if (system("su -c 'make >/dev/null' esr")) {
40         die("Compilation failure\n");
41 }
42
43 print "Building the distribution...\n";
44 if (system("su -c 'make dist >/dev/null' esr")) {
45         die("Distribution-build failure\n");
46 }
47
48 print "Building the RPMs...\n";
49 if (system("make rpm >/dev/null 2>/dev/null && chown esr *.rpm")) {
50         die("RPM-build failure\n");
51 }
52
53 open(REPORT, ">PREAMBLE.$$");
54
55 print REPORT <<EOF;
56 From: esr\@thyrsus.com (Eric S. Raymond)
57 To: fetchmail-announce\@ccil.org
58 Reply-To: esr\@thyrsus.com (Eric S. Raymond)
59 Subject: The $version release of fetchmail is available
60 FCC: ~/postings/outmail
61
62 The $version release of fetchmail is now available at the usual locations,
63 including <URL:http://$ENV{'WWWVIRTUAL'}/~esr/fetchmail> and 
64 <URL:ftp://ftp.ccil.org/pub/esr/fetchmail>.
65
66 Here are the release notes:
67
68 EOF
69
70 # Extract the current notes
71 open(NEWS, "NEWS");
72 while (<NEWS>) {
73     if (/^fetchmail/) {
74         print REPORT $_;
75         last;
76     }
77 }
78 while (<NEWS>) {
79     if (/^fetchmail/) {
80         last;
81     }
82     print REPORT $_;
83 }
84
85 $oldrcs = $oldid;
86 $oldrcs =~ tr/-/./;
87 print REPORT <<EOF;
88
89 By popular demand, diffs from the previous release have been omitted.
90 EOF
91 #Diffs from the previous ($oldrcs) release follow as a MIME attachment.
92
93 close(NEWS);
94
95 close(REPORT);
96
97 if ($rcsid eq '<workfile>') {
98     system("rcsdiff -u -r$oldid          RCS/* 2>/dev/null >DIFFS.$$");
99 } else {
100     system("rcsdiff -u -r$oldid -r$rcsid RCS/* 2>/dev/null >DIFFS.$$");
101 }
102
103 rename("PREAMBLE.$$", "RELEASE.NOTES");
104 system("chown esr RELEASE.NOTES");
105 chmod(0700, "RELEASE.NOTES");
106 # If we ever want to go back to enclosing diffs.
107 #system "metasend -b -D 'fetchmail-$rcsid announcement' -m 'text/plain' -e 7bit -f PREAMBLE.$$ -n -D 'diff -u between -$oldrcs $rcsid' -m 'text/plain' -e 7bit -f DIFFS.$$ -o RELEASE_NOTES";
108
109 unlink("PREAMBLE.$$");
110 unlink("DIFFS.$$");
111
112 print "Building index page...\n";
113 system("rm -f index.html; indexgen.sh");
114
115 print "Making activity graph...";
116 growthplot;
117
118 print "Done\n";
119
120 # makerelease ends here