måndag, juli 16, 2007

Build Ubuntu / Debian SUN Java Package .deb

I needed to run SUN Java VM, so I decided to build .deb package.
Simplifying deployments.

Note: Ubuntu / Debian build tools are tailored towards JRE release 5,
Java release 6.x may find you if you run Debian 4.0 "Etch" unstable [http://packages.debian.org/unstable/source/sun-java6]
Or Ubuntu
[ http://packages.ubuntu.com/feisty/source/sun-java6 ]


Install build tools
$apt-get install fakeroot java-package

Download Java

http://java.sun.com/javase/downloads/index_jdk5.jsp

Select
Java Runtime Environment (JRE) Update 12
>> Download

Accept License Agreement (This package does NOT comply to debian policy)

Download appropiate file
Linux Platform
Linux (self-extracting file)

Run fakeroot (as normal user)

$fakeroot make-jpkg jre1_5_0_12-linux-i586.bin
..
Creating temporary directory: /tmp/make-jpkg.OKdPx17517
Loading plugins: blackdown-j2re.sh blackdown-j2sdk.sh common.sh ibm-j2re.sh ibm-j2sdk.sh j2re.sh j2sdk-doc.sh j2sdk.sh j2se.sh sun-j2re.sh sun-j2sdk-doc.sh sun-j2sdk.sh

Detected Debian build architecture: i386
Detected Debian GNU type: i486-linux-gnu

Detected product:
Java(TM) Runtime Environment (JRE)
Standard Edition, Version 1.5.0+update12
Sun Microsystems(TM), Inc.
Is this correct [Y/n]:
...
If you do not agree to the displayed license terms, the
package will not be built.

Press [Return] to continue:
Sun Microsystems, Inc. Binary Code License Agreement
for the JAVA 2 PLATFORM STANDARD EDITION RUNTIME ENVIRONMENT
5.0
...
Do you agree to the above license terms? [yes or no]
...
The Debian package has been created in the current directory. You can
install the package as root (e.g. dpkg -i sun-j2re1.5_1.5.0+update12_i386.deb
...

Done,
now can I deploy sun-j2re1.5_1.5.0+update12_i386.deb with ease.
On systems with same build.
If I want to deploy SUN Java VM to Debian Sarge I need to rebuild SUN Java *.deb in a Sarge host before deployment.