Subject: sun-jdk/jre dependency
To: None <>
From: Chapman Flack <>
List: tech-pkg
Date: 04/28/2006 23:00:26

There are two packages for Sun's J2SE 1.5: sun-jre15 and sun-jdk15.

The jre (runtime environment only) is a 16 MB .bin file to download
from Sun.

The jdk (full developer's kit) is a 47 MB .bin file that /includes/
the jre.

(Each file requires a rather tiresome click-through manual download.)

Right now, the jdk15 Makefile contains DEPENDS+= jre15.  As a result
if you 'make' in jdk15, it first aborts and tells you to click-through
download the 47 MB jdk file.  Then you can retry the make, at which
point it verifies the distfile, then aborts and tells you to click-
through download the jre, 16 more MB of stuff that's already contained
in the first file you downloaded. After doing that you retry the make
a second time, it extracts and installs the jre archive, extracts the
jdk archive, deletes the duplicated jre files, and installs the rest.

This is pretty inefficient in space, bandwidth, and hassle. It is an
obvious fit with the way pkgsrc works, but I wonder if there could be
some way to override the usual DEPENDS handling to do something

The /simplest/ approach might be to set up the jre Makefile so that it
will accept EITHER the jre or jdk .bin archive, whichever it happens to
find in distfiles, and if it finds the jdk archive, it just installs the
jre parts. The jdk Makefile would remain as it is. You only need to
download one file and retry the make once, and you have both packages
successfully installed.

Another approach might be to try to override the depend-checking,
install, and packaging actions in the jdk Makefile.  Then instead
of actually doing a submake of jre15, it would just extract the
whole jdk archive and install the files, then use the package tools
twice to register installation of both the jdk and jre packages,
and the package target could make both tgzs.

I'm still not necessarily good at estimating the difficulty of
doing either thing with the hairy beast that is pkgsrc; can anybody
think of what in either approach would be particularly hard or easy?