2014-06-22 07:51:26 +02:00
|
|
|
#
|
|
|
|
# This script will install the actual plugin, advise the user to read the
|
2015-02-20 00:18:35 +01:00
|
|
|
# license for Oracle JDK and to re-login to have environment variables set
|
2014-06-22 07:51:26 +02:00
|
|
|
# properly.
|
|
|
|
#
|
|
|
|
|
|
|
|
BUILD_DIR="./var/tmp/${PKGNAME}.build"
|
|
|
|
|
2014-06-22 09:01:35 +02:00
|
|
|
do_install() {
|
2014-06-22 07:51:26 +02:00
|
|
|
mkdir -p "$BUILD_DIR"
|
|
|
|
wget \
|
|
|
|
--header "Cookie: oraclelicense=accept-securebackup-cookie" \
|
|
|
|
--progress=bar:force \
|
|
|
|
-c -O $BUILD_DIR/jdk.tar.gz \
|
|
|
|
$ORACLE_JDK_URL
|
2014-06-22 09:01:35 +02:00
|
|
|
echo "$ORACLE_JDK_CHECKSUM $BUILD_DIR/jdk.tar.gz" | sha256sum -c || return 1
|
|
|
|
tar xf ${BUILD_DIR}/jdk.tar.gz || return 1
|
|
|
|
|
2014-09-01 23:31:20 +02:00
|
|
|
if [ -d usr/lib/jvm/jdk$ORACLE_JDK_LONG_VERSION ]; then
|
|
|
|
rm -rf usr/lib/jvm/jdk$ORACLE_JDK_LONG_VERSION
|
2014-06-22 09:01:35 +02:00
|
|
|
fi
|
2014-09-01 23:31:20 +02:00
|
|
|
mv jdk$ORACLE_JDK_LONG_VERSION usr/lib/jvm/jdk$ORACLE_JDK_LONG_VERSION || return 1
|
2014-06-22 09:01:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
case "${ACTION}" in
|
|
|
|
post)
|
2014-09-01 23:31:20 +02:00
|
|
|
. usr/lib/jvm/oracle-jdk-vars.sh
|
2014-06-22 09:01:35 +02:00
|
|
|
do_install
|
|
|
|
RESULT=$?
|
2014-06-22 07:51:26 +02:00
|
|
|
rm -r $BUILD_DIR
|
2014-06-22 09:01:35 +02:00
|
|
|
[ $RESULT -ne 0 ] && exit $RESULT
|
2014-09-15 17:39:34 +02:00
|
|
|
;;
|
2014-06-22 07:51:26 +02:00
|
|
|
esac
|
|
|
|
|