diff --git a/srcpkgs/oracle-jdk/INSTALL b/srcpkgs/oracle-jdk/INSTALL index e3760668358..1fc1002e62d 100644 --- a/srcpkgs/oracle-jdk/INSTALL +++ b/srcpkgs/oracle-jdk/INSTALL @@ -6,28 +6,36 @@ BUILD_DIR="./var/tmp/${PKGNAME}.build" -case "${ACTION}" in -post) - . usr/share/java/oracle-jdk-vars.sh - +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 || exit 1 - tar xf ${BUILD_DIR}/jdk.tar.gz || exit 1 - rm -rf /usr/java/$PKGNAME 2> /dev/null - mv jdk$ORACLE_JDK_LONG_VERSION /usr/share/java/$PKGNAME || exit 1 + 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/share/java/$PKGNAME ]; then + rm -rf usr/share/java/$PKGNAME + fi + mv jdk$ORACLE_JDK_LONG_VERSION usr/share/java/$PKGNAME || return 1 +} + +case "${ACTION}" in +post) + . usr/share/java/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.html + /usr/share/licenses/oracle-jdk/LICENSE before using it. - Please re-login to update PATH and JAVA_HOME or re-source diff --git a/srcpkgs/oracle-jdk/files/oracle-jdk.sh.in b/srcpkgs/oracle-jdk/files/oracle-jdk.sh.in index 666b779fbeb..b19cc1ef5da 100644 --- a/srcpkgs/oracle-jdk/files/oracle-jdk.sh.in +++ b/srcpkgs/oracle-jdk/files/oracle-jdk.sh.in @@ -1,2 +1,2 @@ export JAVA_HOME=${JAVA_HOME=/usr/share/java/oracle-jdk} -export PATH="$PATH:/usr/share/java/oracle-jdk" +export PATH="$PATH:/usr/share/java/oracle-jdk/bin" diff --git a/srcpkgs/oracle-jdk/template b/srcpkgs/oracle-jdk/template index d1ca11235f4..e7ddd31c707 100644 --- a/srcpkgs/oracle-jdk/template +++ b/srcpkgs/oracle-jdk/template @@ -2,7 +2,7 @@ pkgname=oracle-jdk version=8u5 _longVersion=1.8.0_05 -revision=1 +revision=2 short_desc="Java Development Kit (JDK)" maintainer="Enno Boland " homepage="http://www.oracle.com/technetwork/java/javase/downloads/index.html" @@ -12,8 +12,9 @@ nonfree=yes only_for_archs="i686 x86_64 armv6l armv7l" depends="hicolor-icon-theme desktop-file-utils xdg-utils shared-mime-info wget" hostmakedepends="wget" -provides="java-runtime-${version}_1" -replaces="java-runtime>=0" +provides="java-runtime-${version}_1 oracle-jre-${version}_${revision}" +conflicts="oracle-jre>=0" +replaces="java-runtime>=0 oracle-jre>=0" case "${XBPS_TARGET_MACHINE}" in x86_64) @@ -61,11 +62,14 @@ do_build() { do_install() { vmkdir "usr/share/licenses/${pkgname}" + vmkdir "usr/share/java/$pkgname/jre" vinstall oracle-jdk-vars.sh 644 "usr/share/java" vinstall LICENSE 644 "usr/share/licenses/${pkgname}" vinstall java-policy-settings.desktop 644 usr/share/applications + ln -sr $DESTDIR/usr/share/java/$pkgname/jre $DESTDIR/usr/share/java/oracle-jre + for i in 16 20 22 24 32 40 48 64 72 96 128 256 512; do vinstall $FILESDIR/oracle-jdk-${i}x${i}.png 644 usr/share/icons/hicolor/${i}x${i}/apps oracle-java.png done