next jpkg steps
Lillian Angel
langel at redhat.com
Thu Jun 25 07:17:57 PDT 2009
Dalibor Topic wrote:
> Lillian Angel wrote:
>
>> Dalibor Topic wrote:
>>
>>> Hi everyone,
>>>
>>> JavaOne was fun. The jpkg tool had a slice of keynote time [1], and
>>> the feedback was in general very positive. So, time to think about
>>> what we want it to do next. On my list of things jpkg needs next are
>>>
>>> * lots of fresh jtreg tests
>>> * rpm backend
>>> * svr4/ips backend
>>>
>>> >From the JavaOne feedback, developers are also interested in using
>>> jpkg for generating JNLP descriptors, OSGi bundles, Maven artifacts,
>>> multi-module JARs, and a whole bunch of other interesting things. That
>>> implies that we'll at some point probably need a simple way to create
>>> jpkg backends as plugins for the tool.
>>> Ideas, code and jtreg tests in particular ;) are welcome.
>>>
>>>
>> I would like to help with the rpm backend and the jtreg tests. Can you
>> send me more information on how to get started?
>>
>
> I've cleaned up a few tiny things, there is a bit more to do, but let's
> get you started - cleanups and refactoring of jpkg can progress alongside.
>
> To get the code:
>
> hg fclone http://hg.openjdk.java.net/jigsaw/jigsaw
>
> The code for jpkg is in jdk/src/share/classes/org/openjdk/jigsaw/cli/Packager.java
> It's based on the code for the jmod tool (right next to it in the
> directroy), and uses classes from org.openjdk.jigsaw (the actual
> jigsaw implementation), java.lang.module (the module interface).
> The Debian package creation is done via a class called Deb - and I've
> added a skeleton class for RPM generation now, so that when jpkg
> get called with the rpm keyword, it'll get run instead of the Deb class.
>
> It has basically two methods one needs to care about when adding a new
> package format:
>
> writeMetaData - which takes care of converting metadata from jigsaw's
> format to the package manager's (like translating dependencies)
>
> that basically boils down to:
>
> * translate module names to RPM names
> * translate module versions to RPM versions
> * translate module dependency names, versions and constraints to RPM dependency format
>
> buildPackage - which takes care of building the actual package
> using native packaging tools and adding post/pre install scripts,
> for example.
>
> * fakeroot & rpmbuild analogue of fakeroot & dpkg-deb
> * post/pre install scripts to install/configure a module using jmod into the library
>
> Feel free to factor the current deb packaging code out into sub-classes
> as you need them, I assume you may be able to reuse a bit of it in your own
> (or turn it into utility methods).
>
> Building:
>
> The code is based on an older version of JDK 7, so you'll have to work around
> the build not working without the ugly binary plugs (or poke mr to resync with
> current). Since the build actually builds debian packages in jdk/make/modules/Makefile,
> you'll want to change the all target to not build all-debs on Fedora, and instead
> go with RPM tools, based on a makefile variable, for example.
>
> Playing around:
>
> Once you've built the code, I'd suggest looking at the jtreg tests in
> jdk/test/org/openjdk/jigsaw and playing a bit with them to understand how jmod works.
> Going from there, we should discuss what's necessary to do for RPM on IRC, for
> example. I suspect the current code is due for a bit of refactoring ;)
Thanks for this. I am building it at the moment, and I will play around
for a while.
Cheers,
Lillian
More information about the jigsaw-dev
mailing list