On Tue, Aug 19, 2008 at 01:28:37AM +0100, peter green wrote:
> What JDK the package is built with is irrelevent. The problem is it
> doesn't work when RUN WITH gij.

generally speaking, the JDK the package is built with *is* relevant,
if only to avoid java.lang.UnsupportedClassVersionError: for instance
your fix considers the JRE from sun-java5-jre to be acceptable, when
it definitely is not if the package is compiled with a JDK6 (which is
what will happen with the Build-Depends line you left as is).

The solid fix is IMHO to ensure that you run the program with the JRE
associated to the JDK you used for building. Otherwise, you have to
resort to using poorly-scalable solutions, like you did in
/usr/bin/azureus by trying to hand-select what JREs are appropriate or
not.

Another, more proper solution, would be for example to "Build-Depends:
java5-sdk" and "Depends: java5-runtime", but unfortunately
java-gcj-compat provides java5-runtime, which takes us back to square
one.

> Indeed the dependencies on your package don't even seem to ensure that a  
> JRE is installed at all by default.

ah, thanks for spotting this: my mistake, that substvar wasn't defined
the right way. That's fixed in -3.1, which I've also uploaded to
DELAYED/7, and I've attached the debdiff to this email as well.

> In other words your patch (unlike mine) does not actually fix the
> problem.

when I started working on fixing this issue, your patch had not made
it to the BTS yet.

Cheers,

--Seb
diff -u azureus-3.1.1.0/debian/rules azureus-3.1.1.0/debian/rules
--- azureus-3.1.1.0/debian/rules
+++ azureus-3.1.1.0/debian/rules
@@ -1,8 +1,13 @@
 #!/usr/bin/make -f
 
+SUBSTVARS := debian/azureus.substvars
+
 build: dist/Azureus2.jar
 
 dist/Azureus2.jar:
+       dpkg -S `readlink -f $$(which java)` | perl -pe 
's|(.+):.+|jre:Depends=$$1|' > $(SUBSTVARS)
+       sed -i -e 's/-headless//' $(SUBSTVARS)
+
        mkdir -p build/libs
        ln -s \
                /usr/share/java/commons-cli.jar \
@@ -20,11 +25,10 @@
 
 clean:
        dh_clean
-       rm -rf build/libs
+       rm -rf build/libs $(SUBSTVARS)
        ant clean
 
 binary-indep: build
-       dh_clean -k
        dh_install -i
        dh_installchangelogs -i
        dh_installdocs -i
@@ -33,30 +37,13 @@
        dh_compress -i
        dh_desktop -i
        dh_fixperms -i
+       dh_lintian -i
        dh_installdeb -i
        dh_gencontrol -i
        dh_md5sums -i
        dh_builddeb -i
 
-include /usr/share/gcj/debian_defaults
-
-binary-arch: build
-       dh_clean -k 
-       dh_install -a
-       dh_installchangelogs -a
-       dh_installdocs -a
-ifneq (,$(filter $(DEB_HOST_ARCH), $(gcj_native_archs)))
-       dh_install -i
-       dh_nativejava -a
-endif
-       dh_compress -a
-       dh_fixperms -a
-       dh_strip -a
-       dh_installdeb -a
-       dh_shlibdeps -a
-       dh_gencontrol -a
-       dh_md5sums -a
-       dh_builddeb -a
+binary-arch:
 
 binary: binary-indep binary-arch
 
diff -u azureus-3.1.1.0/debian/control azureus-3.1.1.0/debian/control
--- azureus-3.1.1.0/debian/control
+++ azureus-3.1.1.0/debian/control
@@ -2,17 +2,16 @@
 Section: net
 Priority: optional
 Maintainer: Shaun Jackman <[EMAIL PROTECTED]>
-Build-Depends: default-jdk-builddep | java2-compiler, ant,
- libcommons-cli-java, liblog4j1.2-java, libswt-gtk-3.4-java,
- fastjar, junit, debhelper (>> 5)
+Build-Depends: openjdk-6-jdk | java2-jdk, ant, debhelper (>= 6.0.7~)
+Build-Depends-Indep: libcommons-cli-java, liblog4j1.2-java,
+ libswt-gtk-3.4-java, fastjar, junit
 Standards-Version: 3.8.0.1
 
 Package: azureus
 Architecture: all
-Depends: java-gcj-compat | java-virtual-machine,
- java-gcj-compat | java2-runtime, libcommons-cli-java,
- liblog4j1.2-java, libswt-gtk-3.4-java
-Suggests: vuze, azureus-gcj
+Depends: ${jre:Depends}, libcommons-cli-java, liblog4j1.2-java,
+ libswt-gtk-3.4-java
+Suggests: vuze
 Description: BitTorrent client
  BitTorrent is a peer-to-peer file distribution tool.
  .
@@ -21,13 +20,6 @@
  access to numerous pieces of information about your torrents. Azureus
  now features an embedded tracker easily set up and ready to use.
 
-Package: azureus-gcj
-Architecture: any
-Depends: azureus (>= ${source:Version}), azureus (<< ${source:Version}.1~),
- ${misc:Depends}, ${shlibs:Depends}
-Description: native binary of Azureus
- This package contains a native binary of Azureus built using GCJ.
-
 Package: vuze
 Architecture: all
 Depends: azureus, libswt-cairo-gtk-3.4-jni, libswt-gnome-gtk-3.4-jni,
diff -u azureus-3.1.1.0/debian/changelog azureus-3.1.1.0/debian/changelog
--- azureus-3.1.1.0/debian/changelog
+++ azureus-3.1.1.0/debian/changelog
@@ -1,3 +1,22 @@
+azureus (3.1.1.0-3.1) unstable; urgency=low
+
+  * Tentative NMU.
+  * Depends: on the JRE associated to the JDK used for building, and not
+    on the JDK itself, which is silly.
+
+ -- Sebastien Delafond <[EMAIL PROTECTED]>  Mon, 18 Aug 2008 17:53:35 -0700
+
+azureus (3.1.1.0-3.0) unstable; urgency=low
+
+  * Tentative NMU.
+  * Build with openjdk-6-jdk by default (but allows for user rebuilds
+    using any JDK), and remove azureus-gcj altogether (Closes: #495514).
+  * Add a lintian override to signify that java and ant are indeed needed
+    as Build-Depends-Indep even though we do not build any arch-dependent
+    binary packages.
+
+ -- Sebastien Delafond <[EMAIL PROTECTED]>  Mon, 18 Aug 2008 16:45:49 -0700
+
 azureus (3.1.1.0-3) unstable; urgency=medium
 
   * Remove the four non-latin characters in DateParserRegex.java.
only in patch2:
unchanged:
--- azureus-3.1.1.0.orig/debian/source.lintian-overrides
+++ azureus-3.1.1.0/debian/source.lintian-overrides
@@ -0,0 +1,2 @@
+# java and ant are required to run clean
+azureus source: build-depends-without-arch-dep

Attachment: signature.asc
Description: Digital signature

Reply via email to