You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by jm...@apache.org on 2004/06/18 07:56:29 UTC
svn commit: rev 21408 - in incubator/spamassassin/trunk: . spamc
Author: jm
Date: Thu Jun 17 22:56:28 2004
New Revision: 21408
Added:
incubator/spamassassin/trunk/spamc/version.h.pl (contents, props changed)
Modified:
incubator/spamassassin/trunk/MANIFEST
incubator/spamassassin/trunk/Makefile.PL
incubator/spamassassin/trunk/spamc/configure.pl
incubator/spamassassin/trunk/spamc/spamc.c
incubator/spamassassin/trunk/spamc/version.h.in
Log:
bug 3509: make building spamc easier for packagers with new version.h.pl script
Modified: incubator/spamassassin/trunk/MANIFEST
==============================================================================
--- incubator/spamassassin/trunk/MANIFEST (original)
+++ incubator/spamassassin/trunk/MANIFEST Thu Jun 17 22:56:28 2004
@@ -161,6 +161,7 @@
spamc/config.h.in
spamc/config.h.win
spamc/version.h.in
+spamc/version.h.pl
spamc/configure
spamc/configure.in
spamc/configure.pl
Modified: incubator/spamassassin/trunk/Makefile.PL
==============================================================================
--- incubator/spamassassin/trunk/Makefile.PL (original)
+++ incubator/spamassassin/trunk/Makefile.PL Thu Jun 17 22:56:28 2004
@@ -1030,7 +1030,7 @@
LIBSPAMC_SRC = spamc/libspamc.c spamc/utils.c
$(SPAMC_MAKEFILE): $(SPAMC_MAKEFILE).in $(SPAMC_MAKEFILE).win
- $(CONFIGURE) VERSION="$(VERSION)" --prefix="$(I_PREFIX)" --sysconfdir="$(I_SYSCONFDIR)" --datadir="$(I_DATADIR)" --enable-ssl="$(ENABLE_SSL)"
+ $(CONFIGURE) --prefix="$(I_PREFIX)" --sysconfdir="$(I_SYSCONFDIR)" --datadir="$(I_DATADIR)" --enable-ssl="$(ENABLE_SSL)"
spamc_has_moved:
$(NOECHO) echo "***"
Modified: incubator/spamassassin/trunk/spamc/configure.pl
==============================================================================
--- incubator/spamassassin/trunk/spamc/configure.pl (original)
+++ incubator/spamassassin/trunk/spamc/configure.pl Thu Jun 17 22:56:28 2004
@@ -59,32 +59,18 @@
# Create version.h platform independently.
-print "configure.pl: creating version.h\n";
-if ($ENV{VERSION})
+print join(' ', $Config{'perlpath'}, "version.h.pl") . "\n";
{
- $ENV{VERSION} =~ /^(\d+)\.(?:(\d\d\d)(\d\d\d)|(\d+)\.(\d+))/;
- my %ver = (
- MAJOR => $1 * 1,
- MINOR => $2 * 1,
- REVISION => $3 * 1,
- );
-
- open(IN => "<version.h.in") || die "Can't open version.h.in: $!";
- open(OUT => ">version.h") || die "Can't open version.h: $!";
-
- print OUT "/* version.h. Generated by configure.pl. */\n";
- foreach (<IN>) {
- s/^#undef\s+(VERSION_EXACT)/#define $1/;
- s/^(#define VERSION_)(MAJOR|MINOR|REVISION)\s+.*$/$1$2 "$ver{$2}"/;
- print OUT;
+ # Do the same thing as for the preprocessor below.
+ package version_h;
+ my $Z = $0;
+ local $0 = "version.h.pl";
+ local @ARGV = ();
+ # Got to check for defined because the script returns shell error level!
+ unless (defined do $0) {
+ $0 = $Z;
+ die $@ ? $@ : "Can't exec `$::args[0]': $!";
}
-
- close(IN);
- close(OUT);
-}
-else
-{
- copy(q{version.h.in}, q{version.h}) || die "Can't copy version.h.in to version.h: $!";
}
Modified: incubator/spamassassin/trunk/spamc/spamc.c
==============================================================================
--- incubator/spamassassin/trunk/spamc/spamc.c (original)
+++ incubator/spamassassin/trunk/spamc/spamc.c Thu Jun 17 22:56:28 2004
@@ -94,18 +94,7 @@
void
print_version(void)
{
- char *maj = VERSION_MAJOR;
- char *min = VERSION_MINOR;
- char *rev = VERSION_REVISION;
-
-#ifndef VERSION_EXACT
- rev = strdup(rev);
- rev += strlen("LastChangedRevision");
- strncpy(rev, "x-r", 3);
- rev[strlen(rev) - 2] = '\0';
-#endif
-
- fprintf(stderr, "%s version %s.%s.%s\n", "SpamAssassin Client", maj, min, rev);
+ fprintf(stderr, "%s version %s\n", "SpamAssassin Client", VERSION_STRING);
}
static void
Modified: incubator/spamassassin/trunk/spamc/version.h.in
==============================================================================
--- incubator/spamassassin/trunk/spamc/version.h.in (original)
+++ incubator/spamassassin/trunk/spamc/version.h.in Thu Jun 17 22:56:28 2004
@@ -1,9 +1,4 @@
-/* version.h.in. template for configure.pl, called from Makefile.PL. */
-/* can be copied to version.h manually if really needed. */
+/* version.h.in. template for version.h.pl, called from configure.pl. */
-#undef VERSION_EXACT
-
-#define VERSION_MAJOR "3"
-#define VERSION_MINOR "x"
-#define VERSION_REVISION "$LastChangedRevision$"
+#define VERSION_STRING "3.x"
Added: incubator/spamassassin/trunk/spamc/version.h.pl
==============================================================================
--- (empty file)
+++ incubator/spamassassin/trunk/spamc/version.h.pl Thu Jun 17 22:56:28 2004
@@ -0,0 +1,55 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use lib '../lib';
+
+my $fil = "version.h";
+my $ver;
+
+foreach (@ARGV) {
+ my ($opt, $arg) = (split(/=/, $_, 2));
+ if ($opt eq '--with-version') {
+ if ($arg =~ /^(\d)\.(\d\d\d)_?(\d\d\d)/) {
+ $ver = join(".", $1*1, $2*1, $3*1);
+ }
+ else {
+ $ver = $arg;
+ }
+ }
+}
+
+print "version.h.pl: creating $fil\n";
+unless ($ver) {
+ if (-e '../lib/Mail/SpamAssassin.pm') {
+ eval {
+ require Mail::SpamAssassin;
+ $ver = Mail::SpamAssassin::Version();
+ };
+ }
+ else {
+ $@ = "File not found.";
+ }
+ unless ($ver) {
+ die join("\n", "Failed to get the version from Mail::SpamAssassin.",
+ "Please use the --with-version= switch to specify it manually.",
+ "",
+ "The error was:",
+ $@,
+ );
+ }
+}
+
+open IN, "<$fil.in" || die "Failed to open $fil.in: $!";
+open OUT, ">$fil" || die "Failed to open $fil: $!";
+
+print OUT "/* $fil. Generated by $0. */\n";
+foreach (<IN>) {
+ s/(#define\s+VERSION_STRING\s+)".*"/$1"$ver"/;
+ print OUT;
+}
+
+close IN;
+close OUT;
+
Re: svn commit: rev 21408 - in incubator/spamassassin/trunk: . spamc
Posted by Daniel Quinlan <qu...@pathname.com>.
"Malte S. Stretz" <ms...@gmx.net> writes:
> Actually, have you followed the Lenya-discussion on the general@incubator
> list? They wanted to do a preprelease, too, and needed (a) an ok by the
> incubator and (b) tag it clearly as an incubated release.
I missed that one. It's a bit late now as the release has been built
and announced. :-/
Daniel
--
Daniel Quinlan
http://www.pathname.com/~quinlan/
Re: svn commit: rev 21408 - in incubator/spamassassin/trunk: . spamc
Posted by "Malte S. Stretz" <ms...@gmx.net>.
On Saturday 19 June 2004 23:15 CET Daniel Quinlan wrote:
> Michael Parker <pa...@pobox.com> writes:
> > Yes, I think we should do one ASAP. Do we need permission from the
> > incubator for pre-releases?
>
> No, we just need to have three +1 votes. (Nobody can veto a release.)
Actually, have you followed the Lenya-discussion on the general@incubator
list? They wanted to do a preprelease, too, and needed (a) an ok by the
incubator and (b) tag it clearly as an incubated release.
The threads in question are:
Leo Simons: "Re: Releasing Lenya 1.2" (09.06)
Rolf Kulemann: "Re: [Summary ]Re: [TEST+VOTE] Lenya 1.2 Release" (11.06)
Rolf Kulemann: "[REQUEST] Lenya 1.2 release endorsement and
approval" (12.06)
Also interesting is
Cliff Schmidt: "FW: [VOTE][RESULT] Release of
incubating-xmlbeans-1.0.2" (11.05)
Which points to
http://incubator.apache.org/incubation/Incubation_Policy.html#Podling+Constraints%0A
Cheers,
Malte
--
[SGT] Simon G. Tatham: "How to Report Bugs Effectively"
<http://www.chiark.greenend.org.uk/~sgtatham/bugs.html>
[ESR] Eric S. Raymond: "How To Ask Questions The Smart Way"
<http://www.catb.org/~esr/faqs/smart-questions.html>
Re: svn commit: rev 21408 - in incubator/spamassassin/trunk: . spamc
Posted by Theo Van Dinter <fe...@kluge.net>.
On Sat, Jun 19, 2004 at 02:15:30PM -0700, Dan Quinlan wrote:
> No, we just need to have three +1 votes. (Nobody can veto a release.)
I don't know if I like that actually. We should really sit down and
discuss what policies we want to use. The incubator/apache published
ones are just suggestions/guidelines, not required.
--
Randomly Generated Tagline:
"I decry the current tendency to seek patents on algorithms. There are
better ways to earn a living than to prevent other people from making use of
one's contributions to computer science." - Donald E. Knuth
Re: svn commit: rev 21408 - in incubator/spamassassin/trunk: . spamc
Posted by Daniel Quinlan <qu...@pathname.com>.
Michael Parker <pa...@pobox.com> writes:
> Yes, I think we should do one ASAP. Do we need permission from the
> incubator for pre-releases?
No, we just need to have three +1 votes. (Nobody can veto a release.)
Daniel
--
Daniel Quinlan
http://www.pathname.com/~quinlan/
Re: svn commit: rev 21408 - in incubator/spamassassin/trunk: . spamc
Posted by Michael Parker <pa...@pobox.com>.
On Sat, Jun 19, 2004 at 01:08:47PM -0700, Justin Mason wrote:
>
> Are we going to put out a -pre1 release?
>
Yes, I think we should do one ASAP. Do we need permission from the
incubator for pre-releases?
Michael
Re: svn commit: rev 21408 - in incubator/spamassassin/trunk: . spamc
Posted by "Malte S. Stretz" <ms...@gmx.net>.
On Friday 18 June 2004 20:52 CET Michael Parker wrote:
> I don't think it's that big of a deal, but I had to do a make clean
> after updating to this rev. [...]
We could add a dependency on version.h to the spamc target in the Makefile.
Anybody think its worth it?
Cheers,
Malte
--
[SGT] Simon G. Tatham: "How to Report Bugs Effectively"
<http://www.chiark.greenend.org.uk/~sgtatham/bugs.html>
[ESR] Eric S. Raymond: "How To Ask Questions The Smart Way"
<http://www.catb.org/~esr/faqs/smart-questions.html>
Re: svn commit: rev 21408 - in incubator/spamassassin/trunk: . spamc
Posted by Michael Parker <pa...@pobox.com>.
On Fri, Jun 18, 2004 at 05:56:29AM -0000, jm@apache.org wrote:
> Author: jm
> Date: Thu Jun 17 22:56:28 2004
> New Revision: 21408
>
> Added:
> incubator/spamassassin/trunk/spamc/version.h.pl (contents, props changed)
> Modified:
> incubator/spamassassin/trunk/MANIFEST
> incubator/spamassassin/trunk/Makefile.PL
> incubator/spamassassin/trunk/spamc/configure.pl
> incubator/spamassassin/trunk/spamc/spamc.c
> incubator/spamassassin/trunk/spamc/version.h.in
> Log:
> bug 3509: make building spamc easier for packagers with new version.h.pl script
>
I don't think it's that big of a deal, but I had to do a make clean
after updating to this rev. Here is the error:
gcc -Wall -g -O2 spamc/spamc.c spamc/libspamc.c spamc/utils.c \
-o spamc/spamc -ldl
spamc/spamc.c: In function `print_version':
spamc/spamc.c:97: error: `VERSION_STRING' undeclared (first use in
this function)
spamc/spamc.c:97: error: (Each undeclared identifier is reported only
once
spamc/spamc.c:97: error: for each function it appears in.)
make[1]: *** [spamc/spamc] Error 1
Once I did make clean all was well.
Michael