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

Re: packaging java resources with javahelper

On 2011-08-22 02:34, Wookey wrote:
> I've been packaging a couple of java applications, using javahelper.
> This has all gone very well except that I have a problem getting
> non-class-file resources into the jar files. Both apps are GUI apps.
> terraintool has an 'images' directory and tunnelx has a 'symbols'
> directory (fiull of svg and html files).
> Both expect to find these resources inside their jar files. They could
> perhaps be modified to look in the real filesystem of the machine, but
> I don't know how to do that, nor whether it is a good idea (to what
> degree should we resist the java 'everything goes in a jar' convention?
> What I expected to find was some way of declaratively listing extra
> files to put in the jar, equivalent to the package.install files for
> normal debhelper packaging. I did not find such a thing, so wonder how
> this is supposed to be done.


jh_build has been designed to handle the case where you just get a bunch
of source files and no build system.  I guess we have not seen an Java
application using data files and having no build system before.
  Anyhow, feel free to file a bug against javatools (or javahelper) for

> I did find the fastjar command which is how I am currently getting the
> files into place:
> override_dh_install:
>         dh_install
> 	fastjar -uf debian/terraintool/usr/share/terraintool/terraintool.jar -C src mccombe/terrain/images
> This works (although it adds a second 'META-INF/MANIFEST.MF' dir which is odd and
> unhelpful).

you can use the regular "jar", which may work better.  I know fastjar
and jar sometimes produce "slightly different results".  Alternatively
zip can also get the job done.

> So, am I missing some functionality, or should some other approach be taken? If not
> can/should we add some kind of jar.files list of resources to copy in by a
> jh_jarfiles command?
> Also, whilst I'm here, how should I deal with some html documnetation? javadocs
> produces html docs and (if there is no package.doc-base file) creates a
> package.doc-base.javadoc file containing:
> ------------
> Document: terraintool
> Title: API JavaDoc for terraintool
> Author:
> Abstract: This the API JavaDoc for terraintool
> Section: Programming/Java
> Format: HTML
> Index: /usr/share/doc/terraintool/api
> Files: /usr/share/doc/terraintool/api/*.html
> ---------------
> doc-base files can only have one entry of each format so I can't add a 
> stanza for the helpdocs:
> Format: HTML
> Index: /usr/share/doc/terraintool/Readme.html
> Files: /usr/share/doc/terraintool/Readme.html
> what is the correct way of adding two different docs of the same typew via doc-base?
> And if I add my own doc-base file what do I do about the fact that stops javahelper
> making the javadoc API doc-base file automatically?

I think this has not been an issue so far, because you can have more
than one doc-base file (debian/$pkg.doc-base.$something).  That being
said; jh_installjavadoc could grow some better support here.

> (not subscribed - please keep me CC:ed)
> Wookey


Reply to: