]> Pileus Git - ~andy/fetchmail/blob - makerelease
Added LMTP support.
[~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 Reply-To: esr\@thyrsus.com (Eric S. Raymond)
57 Subject: The $version release of fetchmail is available
58 FCC: ~/postings/outmail
59
60 The $version release of fetchmail is now available at the usual locations,
61 including http://$ENV{'WWWHOST'}/~esr/fetchmail.  Here are the release notes:
62
63 EOF
64
65 # Extract the current notes
66 open(NEWS, "NEWS");
67 while (<NEWS>) {
68     if (/^fetchmail/) {
69         print REPORT $_;
70         last;
71     }
72 }
73 while (<NEWS>) {
74     if (/^fetchmail/) {
75         last;
76     }
77     print REPORT $_;
78 }
79
80 $oldrcs = $oldid;
81 $oldrcs =~ tr/-/./;
82 print REPORT <<EOF;
83
84 By popular demand, diffs from the previous release have been omitted.
85 EOF
86 #Diffs from the previous ($oldrcs) release follow as a MIME attachment.
87
88 close(NEWS);
89
90 close(REPORT);
91
92 if ($rcsid eq '<workfile>') {
93     system("rcsdiff -u -r$oldid          RCS/* 2>/dev/null >DIFFS.$$");
94 } else {
95     system("rcsdiff -u -r$oldid -r$rcsid RCS/* 2>/dev/null >DIFFS.$$");
96 }
97
98 rename("PREAMBLE.$$", "RELEASE.NOTES");
99 system("chown esr RELEASE.NOTES");
100 chmod(0700, "RELEASE.NOTES");
101 # If we ever want to go back to enclosing diffs.
102 #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";
103
104 unlink("PREAMBLE.$$");
105 unlink("DIFFS.$$");
106
107 print "Building index page...\n";
108 system("rm -f index.html; indexgen.sh");
109
110 print "Done\n";
111
112 # makerelease ends here