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

Re: Javahelper automatic depends



On 2013-10-07 19:37, Wookey wrote:
> I just packaged caveconverter (a fairly small simple command-line java
> package), which uses ant as a build system.
> (currently in new:
> http://ftp-master.debian.org/new/caveconverter_0~20130921-2.html )
> 

Hi,

> This all worked fine, except that using
> Depends: ${java:Depends}, ${misc:Depends}
> does not get the right Depends line. 
> I can't recall where I got those magic vars from now. (probbaly
> jh_makepkg)
> 

Sounds like something jh_makepkg would add.

> The build-depends line is:
> Build-Depends-Indep: debhelper (>> 7), javahelper (>= 0.32), ant,
> default-jdk, libcobertura-java, junit
> 
> Which results in a Depends line:
> Depends: default-jre | java5-runtime | java6-runtime | java7-runtime,
> jarwrapper (>=0.5), junit, libcobertura-java
> 
> Which is too much. 
> 
> * junit and libcobertura-java are only used for running build tests.

Are they listed in the "Classpath" (or is it "Class-Path"?) in the
manifest of the resulting jar file (as installed in the .deb)?  If so,
thats your problem.  Note that jh_depends does not really have a way of
handling "optional" depends.
  You might still be able to use it to generate the JVM dependency with
"-X your-file.jar" (to have it ignore your JAR file).

> * default-jre should be default-jre-headless
> * Do I still want those | javaN-runtime options? Are there -headless
> versions?


If memory serves, you want:
  jh_depends --jvm headless

The java5-runtime is possibly a bit redundant, but it shouldn't hurt, so
mah...

> * Should I use java-wrappers instead of jarwrapper? 
> 

They work in different ways, so basically it is your call.  The former
requires you to write a shell wrapper to run your jar file (but helps
you find a suitable Java implementation).  On the other hand, jarwrapper
installs a binfmt-misc (or so) rule for making the kernel recognise the
jar file as an executable so that a "./my.jar" will DTRT(tm).

jarwrapper is quite possibly simplier to use from a maintainer PoV but
it is also a bit less configurable as I recall.  If you need to pass
options, cd to dirs or set ENV, you probably want java-wrappers rather
than jarwrappers.

> The basic question is is ${java:Depends} useful here. I'd like to have
> a magic var that just does the right thing and will update my
> jre*|java* deps automaticllay on future changes, but if it puts too
> much in then I have a problem? Can I modify it? Or should I just be
> setting Depends manually and if so where is best practice recorded?
> 

Assuming the extra depends is caused by Class-Path issues, you should
trivially be able to solve that by fixing the Class-Path to not include
"for tests only"-dependencies.

> I get the impression that
> www.debian.org/doc/packaging-manuals/java-policy/ is rather out of
> date. Is there somewhere else this stuff is written down?
> 

The Java Policy could possibly use an update or two.  I believe someone
signed up for that during the Java BoF at DebConf13, but I forgot who.

> My best guess currently is that the depends line should be:
> default-jdk-headless | java-runtime6 | java-runtime7, java-wrapper, ${misc:Depends}
> 

s/runtime\d/&-headless/g  (also, see jh_depends --jvm headless)

> Advice welcome.
> 
> Wookey
> 


~Niels



Reply to: