Using Sun Java inside an auto-build environment is difficult because the Debian packages require you to accept the licence prior to installation. This includes pbuilder and cowbuilder environments.
Once you have read and accepted the licence (and understood what freedoms it is not granting you), you can allow your clean pbuilder to install Sun Java by preseeding the debconf database with your agreement to the licence.
The steps given here are specific to use with a cowbuilder set up, but can be trivially adapted to other builders such as the classic pbuilder.
- (skip this if you already have a cowbuilder set up)
Create a build chroot:
- Enter into the build environment and add the keys to the
chroot /var/cache/pbuilder/base.cow debconf-set-selections
- Into that last command, you can paste the settings (below). Alternatively,
you can redirect stdin from a file to achieve the same thing.
cp /path/to/settings/file /var/cache/pbuilder/base.cow/tmp/java.debconf chroot /var/cache/pbuilder/base.cow debconf-set-selections < /tmp/java.debconf
The debconf settings you need for Sun Java 6 are as follows (adapt them as needed to suit Java 5):
# Do you agree with the DLJ license terms? sun-java6-bin shared/accepted-sun-dlj-v1-1 boolean true sun-java6-jdk shared/accepted-sun-dlj-v1-1 boolean true sun-java6-jre shared/accepted-sun-dlj-v1-1 boolean true
After I originally wrote about doing this, I noticed that Mike Renfro had also discussed this on his blog, including ways of using this with puppet for easier system administration of large numbers of machines.
Last edited: Friday September 12, 2008
Copyright © 1996-2010 Stuart Prescott