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