With the attached patch, zookeeper can build libzk* and python-zk,
without java stuff, such as the zookeeper service.

It may help use use the platform without jdk >=6 act as a zookeeper client.

To make all the platforms have the same behavior, I use the gcj for platform
even have openjdk-{6,7}.
Maybe you are willing to change this. I think it will also be ok.

It can be built successfully with gcj 4.8.2-2 while failed with gcj
4.6 from Ubuntu precise.
There are some warning when build with gcj 4.8.2-2.
You can get them from the attached buildlog.

-- 
YunQiang Su
diff --git a/debian/control b/debian/control
index 56c9b24..fb53d88 100644
--- a/debian/control
+++ b/debian/control
@@ -8,30 +8,32 @@ Vcs-Browser: 
http://anonscm.debian.org/gitweb/?p=pkg-java/zookeeper.git
 Vcs-Git: git://anonscm.debian.org/pkg-java/zookeeper.git
 Standards-Version: 3.9.4
 Build-Depends:
- ant (>= 1.6.0),
- ant-optional,
  autoconf,
  automake,
- debhelper (>= 9~),
- default-jdk (>= 1:1.6),
- default-jdk-doc,
- help2man,
  javacc,
+ ant (>= 1.6.0),
+ gcj-jdk,
  javahelper (>= 0.28),
- junit4,
+ debhelper (>= 9~),
+ help2man,
  libboost-dev,
  libcppunit-dev,
- libjline-java,
  liblog4cxx10-dev,
+ libtool,
+ libxml2-dev,
+ procps,
+ python-all-dev (>= 2.6.6-3~)
+Build-Depends-Indep:
+ ant-optional,
+ default-jdk (>= 1:1.6),
+ default-jdk-doc,
+ junit4,
+ libjline-java,
  liblog4j1.2-java (>> 1.2.15-8),
  libmockito-java,
  libnetty-java,
  libslf4j-java,
- libtool,
  libxerces2-java,
- libxml2-dev,
- procps,
- python-all-dev (>= 2.6.6-3~)
 X-Python-Version: >= 2.6
 
 Package: libzookeeper-java
diff --git a/debian/rules b/debian/rules
index 702351e..bca3b48 100755
--- a/debian/rules
+++ b/debian/rules
@@ -9,25 +9,28 @@ DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture 
-qDEB_HOST_MULTIARCH)
 %:
        dh $@ --with javahelper --with python2
 
-override_dh_auto_build:
+build: build-arch build-indep
+
+build-indep:
        # TODO exclude the fatjar contrib from upstream tarball and include the 
rest contrib
        mkdir -p build/test/classes
-       javacc 
-OUTPUT_DIRECTORY=src/java/main/org/apache/jute/compiler/generated 
src/java/main/org/apache/jute/compiler/generated/rcc.jj
        # the upstream build file includes .java files in the jars. Let's 
create the jars ourselves.
        # see: https://issues.apache.org/jira/browse/ZOOKEEPER-537
        ant -Dversion=$(DEB_UPSTREAM_VERSION) -DlastRevision=-1 javadoc 
javadoc-dev jar
 
-       # Compile C library
-       cd src/c && autoreconf -i
-       cd src/c && ./configure --prefix=/usr 
--libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH)
-       $(MAKE) -C src/c
-
        # Compile contribs - zooinspector
        cd src/contrib && \
                ant -Dversion=$(DEB_UPSTREAM_VERSION) \
                        -propertyfile ../../debian/ant.properties \
                        -Dcontribfilesetincludes="zooinspector/build.xml"
 
+build-arch:
+       # Compile C library
+       JAVA_HOME=/usr/lib/jvm/java-gcj javacc 
-OUTPUT_DIRECTORY=src/java/main/org/apache/jute/compiler/generated 
src/java/main/org/apache/jute/compiler/generated/rcc.jj
+       JAVA_HOME=/usr/lib/jvm/java-gcj ant compile_jute
+       cd src/c && autoreconf -i
+       cd src/c && ./configure --prefix=/usr 
--libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH)
+       $(MAKE) -C src/c
        # Build Python Bindings
        cd src/contrib/zkpython && \
          for pv in $(PYVERS); do \
@@ -88,7 +91,9 @@ override_dh_clean:
              --exclude=src/docs \
              --exclude=src/c \
              --exclude=src/reciped
+ifneq (1,$(JDK_USABLE))
        jh_clean
+endif
        # Clean generated install files
        for install in libzookeeper-mt2 libzookeeper-st2 \
                                   libzookeeper-st-dev libzookeeper-mt-dev; do \

Attachment: zookeeper-gcj.log.xz
Description: application/xz

Reply via email to