Howto build jPackage Java nosrc RPMs

Setup your rpmbuild environment
The easiest way to do this is to use the rpmdev-setuptree script from the rpmdevtools package to create a build environment in your home directory.

$ rpmdev-setuptree

This will create a rpmbuild directory in your home directory and a default .rpmmacros file to let rpm and rpmbuild know to use it.

Download the nosrc RPM
The nosrc RPMs can be downloaded from one of the jPackage mirrors. You're looking for the most recent java-1.6.0-sun RPM. You do not want the java-1.6.0-sun-compat packages.

At the time of this article the most recent version of Java that has been packaged is 1.6.0 Update 11.
 * 1) Browse to http://mirrors.dotsrc.org/jpackage/1.7/generic/non-free/SRPMS/
 * 2) Look for the newest version in this directory.
 * 3) Download the java-1.6.0-sun-1.6.0.11-1jpp.nosrc.rpm

Install the nosrc RPM to your build directory
Its important to run the install as yourself and not as root.

$ rpm -ivh java-1.6.0-sun-1.6.0.11-1jpp.nosrc.rpm

rpm will use the %_topdir</tt> setting from your .rpmmacros</tt> file and install the contents of the file there.

Links

 * http://jpackage.org/
 * http://mirrors.dotsrc.org/jpackage/1.7/generic/non-free/SRPMS/
 * http://java.sun.com/

$ rpmbuild -bs --nodeps SPECS/java-1.6.0-sun.spec $ mock -r fedora-9-i386 --rebuild SRPMS/java-1.6.0-sun-1.6.0.11-1jpp.src.rpm
 * 1) NoSource:      0