-
-
Save johnclaus/0b51976071c9dc1a94dc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
VERSION="7u67" | |
BUILD="betable1" | |
set -e -x | |
# Keep track of the original working directory. | |
OLDESTPWD="$PWD" | |
# Work in a temporary directory. | |
cd "$(mktemp -d)" | |
trap "rm -rf \"$PWD\"" EXIT INT QUIT TERM | |
# Download Oracle's JDK but really just copy it from the old working directory. | |
# <http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html> | |
JDK_TAR="jdk-$(echo "$VERSION" | cut -d"-" -f"1")-linux-x64.gz" | |
/bin/tar xvf "$OLDESTPWD/$JDK_TAR" | |
# Pull out the good parts. | |
DIRNAME="jdk1.7.0_$(echo "$VERSION" | awk -F"[u-]" '{print $2}')" | |
mkdir -p "rootfs/usr/share/man" | |
mv "$DIRNAME/bin" "rootfs/usr" | |
mv "$DIRNAME/include" "rootfs/usr" | |
mv "$DIRNAME/jre" "rootfs/usr" | |
mv "$DIRNAME/lib" "rootfs/usr" | |
mv "$DIRNAME/man/man1" "rootfs/usr/share/man" | |
# FPM that bitch. | |
fakeroot fpm -C "rootfs" \ | |
-d "ca-certificates" -d "libnss3-1d" -d "libstdc++6" -d "tzdata" \ | |
-m "Nate Brown <nate@betable.com>" \ | |
-n "oracle-jdk" -v "$VERSION-$BUILD" \ | |
-p "$OLDESTPWD/oracle-jdk_${VERSION}-${BUILD}_amd64.deb" \ | |
--provides "java2-runtime" --provides "java2-runtime-headless" \ | |
--provides "java5-runtime" --provides "java5-runtime-headless" \ | |
--provides "java6-runtime" --provides "java6-runtime-headless" \ | |
--provides "java7-runtime" --provides "java7-runtime-headless" \ | |
-s "dir" -t "deb" "usr" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment