Initial thoughts on module packaging

Dalibor Topic Dalibor.Topic at Sun.COM
Thu May 21 17:55:04 PDT 2009


Mark Reinhold wrote:
> Dalibor -- To start, I suggest you work on the simple case of pure
> Java modules.  We'll tackle native libraries, resource files, and
> configuration files later on.

First cut committed. It creates debian binary packages from jigsaw 
modules. Tested with the classic greeting routine:

$ jpkg -L /tmp/pkg -v -m javac_compiled_modules -d . deb org.astro com.greetings
Creating binary Debian package for org.astro
Creating binary Debian package for com.greetings

$ sudo dpkg -i  org.astro_1.2_all.deb  com.greetings_0.1_all.deb 
Selecting previously deselected package org.astro.
(Reading database ... 271672 files and directories currently installed.)
Unpacking org.astro (from org.astro_1.2_all.deb) ...
Selecting previously deselected package com.greetings.
Unpacking com.greetings (from com.greetings_0.1_all.deb) ...
Setting up org.astro (1.2) ...

Setting up com.greetings (0.1) ...

$ java -ea -L /tmp/pkg/ -m com.greetings
Hello, world!

The call interface is 

jpkg [-v] [-L <library>] [-m <module_dir>] [-d <output_dir>] deb <module_name>*

  -v           : verbose output
  -L           : library the modules are installed to
  -m           : directory with modules to package
  -d           : destination directory to put the package in

You can ask jpkg to create modules for multiple packages, as in
the example above. In order to create packages one needs to have 
jmod, jpkg, which, fakeroot and dpkg-deb on $PATH.

The generated packages contain a generated postinst script, 
that calls jmod to reconfigure the library after a package is 
installed, and generated preinst script, that creates
the library, in case that it doesn't exist yet, as well as 
as postrm script, that takes care of removing the generated
config file.

Not handled yet are native files, resources and configuration 
files. Hints, ideas & patches are welcome. 

I've tried to push the patch into the repo, but I keep getting
the issue at 
http://mail.openjdk.java.net/pipermail/jdk7-gk/2008-April/000000.html
with the jigsaw/jigsaw/jdk repository. So instead the
webrev can be found here:

http://cr.openjdk.java.net/~robilad/jpkg/webrev.00/

cheers,
dalibor topic
-- 
*******************************************************************
Dalibor Topic                   Tel: (+49 40) 23 646 738
Java F/OSS Ambassador           AIM: robiladonaim
Sun Microsystems GmbH           Mobile: (+49 177) 2664 192
Nagelsweg 55                    http://openjdk.java.net
D-20097 Hamburg                 mailto:Dalibor.Topic at sun.com
Sitz der Gesellschaft: Sonnenallee 1, D-85551 Kirchheim-Heimstetten
Amtsgericht München: HRB 161028
Geschäftsführer: Thomas Schröder, Wolfgang Engels, Wolf Frenkel
Vorsitzender des Aufsichtsrates: Martin Häring





More information about the jigsaw-dev mailing list