From 4bcf9e8b0b626439ede920aaa23a4f87398eda46 Mon Sep 17 00:00:00 2001 From: Enno Boland Date: Tue, 2 Sep 2014 14:22:37 +0200 Subject: [PATCH] New package: oracle-jdk-arm-8u6_3. --- srcpkgs/oracle-jdk-arm/INSTALL | 50 +++++++++++++++ srcpkgs/oracle-jdk-arm/REMOVE | 6 ++ .../files/oracle-jdk-vars.sh.in | 1 + srcpkgs/oracle-jdk-arm/files/oracle-jdk.sh.in | 2 + srcpkgs/oracle-jdk-arm/template | 63 +++++++++++++++++++ 5 files changed, 122 insertions(+) create mode 100644 srcpkgs/oracle-jdk-arm/INSTALL create mode 100644 srcpkgs/oracle-jdk-arm/REMOVE create mode 100644 srcpkgs/oracle-jdk-arm/files/oracle-jdk-vars.sh.in create mode 100644 srcpkgs/oracle-jdk-arm/files/oracle-jdk.sh.in create mode 100644 srcpkgs/oracle-jdk-arm/template diff --git a/srcpkgs/oracle-jdk-arm/INSTALL b/srcpkgs/oracle-jdk-arm/INSTALL new file mode 100644 index 00000000000..5e9161d0eac --- /dev/null +++ b/srcpkgs/oracle-jdk-arm/INSTALL @@ -0,0 +1,50 @@ +# +# This script will install the actual plugin, advise the user to read the +# license for Chrome and to re-login to have environment variables set +# properly. +# + +BUILD_DIR="./var/tmp/${PKGNAME}.build" + +do_install() { + mkdir -p "$BUILD_DIR" + wget \ + --header "Cookie: oraclelicense=accept-securebackup-cookie" \ + --progress=bar:force \ + -c -O $BUILD_DIR/jdk.tar.gz \ + $ORACLE_JDK_URL + echo "$ORACLE_JDK_CHECKSUM $BUILD_DIR/jdk.tar.gz" | sha256sum -c || return 1 + tar xf ${BUILD_DIR}/jdk.tar.gz || return 1 + + if [ -d usr/lib/jvm/jdk$ORACLE_JDK_LONG_VERSION ]; then + rm -rf usr/lib/jvm/jdk$ORACLE_JDK_LONG_VERSION + fi + mv jdk$ORACLE_JDK_LONG_VERSION usr/lib/jvm/jdk$ORACLE_JDK_LONG_VERSION || return 1 +} + +case "${ACTION}" in +post) + . usr/lib/jvm/oracle-jdk-vars.sh + do_install + RESULT=$? + rm -r $BUILD_DIR + [ $RESULT -ne 0 ] && exit $RESULT + cat << _EOF +===================================================================== + +- The Oracle JDK package is licensed software. + + You MUST read and agree to the license stored in + /usr/share/licenses/oracle-jdk/LICENSE + before using it. + +- Please re-login to update PATH and JAVA_HOME or re-source + /etc/profile: + + $ source /etc/profile + +===================================================================== +_EOF + ;; +esac + diff --git a/srcpkgs/oracle-jdk-arm/REMOVE b/srcpkgs/oracle-jdk-arm/REMOVE new file mode 100644 index 00000000000..64e30ce9e85 --- /dev/null +++ b/srcpkgs/oracle-jdk-arm/REMOVE @@ -0,0 +1,6 @@ +case "$ACTION" in +pre) + . usr/lib/jvm/oracle-jdk-vars.sh + rm -r usr/lib/jvm/$PKGNAME + ;; +esac diff --git a/srcpkgs/oracle-jdk-arm/files/oracle-jdk-vars.sh.in b/srcpkgs/oracle-jdk-arm/files/oracle-jdk-vars.sh.in new file mode 100644 index 00000000000..500c88d6e74 --- /dev/null +++ b/srcpkgs/oracle-jdk-arm/files/oracle-jdk-vars.sh.in @@ -0,0 +1 @@ +export ORACLE_JDK_URL="%ORACLE_JDK_URL%" ORACLE_JDK_CHECKSUM="%ORACLE_JDK_CHECKSUM%" ORACLE_JDK_LONG_VERSION="%LONG_VERSION%" diff --git a/srcpkgs/oracle-jdk-arm/files/oracle-jdk.sh.in b/srcpkgs/oracle-jdk-arm/files/oracle-jdk.sh.in new file mode 100644 index 00000000000..4f6ef7b69d4 --- /dev/null +++ b/srcpkgs/oracle-jdk-arm/files/oracle-jdk.sh.in @@ -0,0 +1,2 @@ +export JAVA_HOME=${JAVA_HOME=/usr/jvm/jdk%LONG_VERSION%/oracle-jdk} +export PATH="$PATH:/usr/lib/jvm/jdk%LONG_VERSION%/bin" diff --git a/srcpkgs/oracle-jdk-arm/template b/srcpkgs/oracle-jdk-arm/template new file mode 100644 index 00000000000..ed4dfcb2d89 --- /dev/null +++ b/srcpkgs/oracle-jdk-arm/template @@ -0,0 +1,63 @@ +# Template file for 'oracle-jdk' +pkgname=oracle-jdk-arm +version=8u6 +_longVersion=1.8.0_06 +revision=3 +_build=23 + +short_desc="Java Development Kit (JDK)" +maintainer="Enno Boland " +homepage="http://www.oracle.com/technetwork/java/javase/downloads/index.html" +license="oracle" +lib32disabled=yes +nonfree=yes +only_for_archs="armv7l armv6l" +depends="hicolor-icon-theme desktop-file-utils xdg-utils shared-mime-info wget" +hostmakedepends="wget" +provides="java-environment-${version}_1 oracle-jdk-${version}_${revision}" +replaces="java-environment>=0" + +_arch=arm +_filename=jdk-${version}-linux-arm-vfp-hflt.tar.gz +checksum="348252453db819a4cda146753b54b86ebd32191e47ff9f9be671e88aaf919d7c" + +distfiles="http://download.oracle.com/otn-pub/java/jdk/${version}-b${_build}/${_filename}" +wrksrc="jdk$_longVersion" + +do_fetch() { + mkdir -p $wrksrc + cd $wrksrc + wget \ + --header "Cookie: oraclelicense=accept-securebackup-cookie" \ + --progress=bar:force \ + -c -O $_filename \ + $distfiles + echo "$checksum $_filename" | sha256sum -c || { sha256sum "$_filename"; return 1; } +} + +do_extract() { + tar xf $_filename -C .. +} + +do_build() { + sed \ + -e "s|%LONG_VERSION%|${_longVersion}|" \ + ${FILESDIR}/oracle-jdk.sh.in > 10_oracle-jdk.sh + sed \ + -e "s|%LONG_VERSION%|${_longVersion}|" \ + -e "s|%ORACLE_JDK_URL%|${distfiles}|" \ + -e "s|%ORACLE_JDK_CHECKSUM%|${checksum}|" \ + ${FILESDIR}/oracle-jdk-vars.sh.in > oracle-jdk-vars.sh +} + +do_install() { + vmkdir "usr/lib/jvm" + vinstall oracle-jdk-vars.sh 644 "usr/lib/jvm" + + vmkdir "usr/share/licenses/${pkgname}" + vlicense LICENSE + ln -s jdk${_longVersion} ${DESTDIR}/usr/lib/jvm/oracle-jdk + + vmkdir "etc/profile.d" + vinstall 10_oracle-jdk.sh 644 "etc/profile.d" +}