Using a Vagrant box (chef/centos-7.0) as the build server:
$ yum install rpm-build
... get rpmrebuild rpm from sourceforge
$ rpm -Uvh rpmrebuild-2.11-1.noarch.rpm
... get oracle jdk rpm from oracle
$ rpmrebuild --define "_rpmfilename jdk8.rpm" --change-spec-preamble='sed -e "s/^Name:.*/Name: jdk8/"' --package jdk-8u20-linux-x64.rpm
Great script! Saved me hours of work. Thank you!