[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#306739: jakarta-log4j: FTBFS: 'enum' is a keyword, and may not be used as an identifier

Package: jakarta-log4j
Version: 1.1.3-6
Severity: serious
Tags: patch

When trying to build 'jakarta-log4j' in a clean chroot with
sun-j2sdk1.5 installed, I get the following error:

    [javac] /jakarta-log4j-1.1.3/src/java/org/apache/log4j/test/Finalize.java:76: as of release 1.5, 'enum' is a keyword, and may not be used as an identifier
    [javac] (try -source 1.4 or lower to use 'enum' as an identifier)
    [javac]       ((org.apache.log4j.Appender) enum.nextElement()).close();
    [javac]                                    ^
    [javac] 15 errors


Please change the Build-Depends in debian/control from 'java2-compiler',
which includes 'sun-j2sdk1.5', to 'j2sdk1.4' to make it clear that
the package does not build with j2sdk1.5. Alternatively, the sources could
be fixed to replace all uses of 'enum' as an identifier with something else
like 'en'.

Please also change debian/rules to support the correct JAVA_HOME_DIRS
which are used by the packages created with make-jpkg from java-package.

Andreas Jochens

diff -urN ../tmp-orig/jakarta-log4j-1.1.3/debian/control ./debian/control
--- ../tmp-orig/jakarta-log4j-1.1.3/debian/control	2005-04-28 09:25:25.878644990 +0200
+++ ./debian/control	2005-04-28 09:25:06.379609294 +0200
@@ -2,7 +2,7 @@
 Section: contrib/libs
 Priority: optional
 Maintainer: Debian QA Group <packages@qa.debian.org>
-Build-Depends-Indep: debhelper (>> 4.0.0), java2-compiler, libxerces-java
+Build-Depends-Indep: debhelper, j2sdk1.4, libxerces-java
 Standards-Version: 3.5.10
 Package: liblog4j-java
diff -urN ../tmp-orig/jakarta-log4j-1.1.3/debian/rules ./debian/rules
--- ../tmp-orig/jakarta-log4j-1.1.3/debian/rules	2005-04-28 09:25:25.879644838 +0200
+++ ./debian/rules	2005-04-28 09:21:07.951855822 +0200
@@ -11,9 +11,8 @@
 export VER=1.1.3
-#export JAVA_HOME=/usr/lib/jdk1.1
-export JAVA_HOME=/usr/lib/j2se/1.3/
-#export JAVA_HOME=/usr/lib/j2se/1.4
+JAVA_HOME_DIRS=/usr/lib/j2sdk1.5-sun /usr/lib/j2sdk1.4-sun /usr/lib/j2sdk1.4-ibm /usr/lib/j2sdk1.4-blackdown
+export JAVA_HOME ?= $(shell for j in $(JAVA_HOME_DIRS); do [ -d "$$j" ] && echo $$j && exit 0; done)
 export JSHARE=/usr/share/java
 export BUILDFILE=build/build.xml
@@ -26,7 +25,7 @@
 #export CLASSPATH=$(JAVA_HOME)/lib/tools.jar:$(ANT_JAR):$(PARSER_JAR)
 export CLASSPATH=$(JAVA_HOME)/lib/tools.jar:$(ANT_JAR):$(PARSER_JAR)
-export BUILD=/usr/bin/java -classpath $(CLASSPATH) \
+export BUILD=$(JAVA_HOME)/bin/java -classpath $(CLASSPATH) \
 	org.apache.tools.ant.Main -buildfile $(BUILDFILE)
 export JDEST=debian/liblog4j-java/usr/share/java

Reply to: