oracle-jre: add alternatives.

This commit is contained in:
Enno Boland 2015-11-13 22:37:04 +01:00
parent 9c00175dd4
commit f6faf6bfb6
4 changed files with 31 additions and 16 deletions

View File

@ -0,0 +1,9 @@
[Desktop Entry]
Exec=/usr/lib/jvm/oracle-jre/bin/policytool
Icon=oracle-java.png
Name=Java Policy Settings
Path=
StartupNotify=true
Terminal=false
Type=Application
Categories=Settings;Java;

View File

@ -0,0 +1 @@
export JAVA_HOME=${JAVA_HOME=/usr/lib/jvm/oracle-jre}

View File

@ -1,2 +0,0 @@
export JAVA_HOME=${JAVA_HOME=/usr/lib/jvm/jre%LONG_VERSION%}
export PATH="$PATH:/usr/lib/jvm/jre%LONG_VERSION%/bin"

View File

@ -2,7 +2,7 @@
pkgname=oracle-jre
version=8u66
_longVersion=1.8.0_66
revision=1
revision=2
_build=17
short_desc="Java Runtime Environment (JRE)"
@ -30,6 +30,24 @@ i686)
;;
esac
alternatives="
java:/usr/bin/java:/usr/lib/jvm/oracle-jre/bin/java
java:/usr/bin/javaws:/usr/lib/jvm/oracle-jre/bin/javaws
java:/usr/bin/jcontrol:/usr/lib/jvm/oracle-jre/bin/jcontrol
java:/usr/bin/jjs:/usr/lib/jvm/oracle-jre/bin/jjs
java:/usr/bin/keytool:/usr/lib/jvm/oracle-jre/bin/keytool
java:/usr/bin/orbd:/usr/lib/jvm/oracle-jre/bin/orbd
java:/usr/bin/pack200:/usr/lib/jvm/oracle-jre/bin/pack200
java:/usr/bin/policytool:/usr/lib/jvm/oracle-jre/bin/policytool
java:/usr/bin/rmid:/usr/lib/jvm/oracle-jre/bin/rmid
java:/usr/bin/rmiregistry:/usr/lib/jvm/oracle-jre/bin/rmiregistry
java:/usr/bin/servertool:/usr/lib/jvm/oracle-jre/bin/servertool
java:/usr/bin/tnameserv:/usr/lib/jvm/oracle-jre/bin/tnameserv
java:/usr/bin/unpack200:/usr/lib/jvm/oracle-jre/bin/unpack200
java-plugin:/usr/lib/mozilla/plugins/libnpjp2.so:/usr/lib/jvm/oracle-jre/lib/$_arch/libnpjp2.so
"
distfiles="http://download.oracle.com/otn-pub/java/jdk/${version}-b${_build}/${_filename}"
wrksrc="jre$_longVersion"
@ -50,17 +68,11 @@ do_extract() {
}
do_build() {
sed \
-e "s|%LONG_VERSION%|${_longVersion}|" \
${FILESDIR}/oracle-jre.sh.in > 11_oracle-jre.sh
sed \
-e "s|%LONG_VERSION%|${_longVersion}|" \
-e "s|%ORACLE_JRE_URL%|${distfiles}|" \
-e "s|%ORACLE_JRE_CHECKSUM%|${checksum}|" \
${FILESDIR}/oracle-jre-vars.sh.in > oracle-jre-vars.sh
sed \
-e "s|^Exec=|Exec=/usr/lib/jvm/jre${_longVersion}/bin/policytool|" \
${FILESDIR}/java-policy-settings.desktop.in > java-policy-settings.desktop
}
do_install() {
@ -68,17 +80,12 @@ do_install() {
vinstall oracle-jre-vars.sh 644 "usr/lib/jvm/"
vinstall LICENSE 644 "usr/share/licenses/${pkgname}"
vinstall java-policy-settings.desktop 644 usr/share/applications
vinstall $FILESDIR/java-policy-settings.desktop 644 usr/share/applications
ln -s jre${_longVersion} ${DESTDIR}/usr/lib/jvm/oracle-jre
for i in 16 20 22 24 32 40 48 64 72 96 128 256 512; do
vinstall $FILESDIR/oracle-jre-${i}x${i}.png 644 usr/share/icons/hicolor/${i}x${i}/apps oracle-java.png
done
vmkdir "usr/lib/mozilla/plugins"
ln -srf ${DESTDIR}/usr/lib/jvm/jre${_longVersion}/lib/${_arch}/libnpjp2.so \
${DESTDIR}/usr/lib/mozilla/plugins
vmkdir "etc/profile.d"
vinstall 11_oracle-jre.sh 644 "etc/profile.d"
vinstall $FILESDIR/oracle-jre.sh 644 "etc/profile.d" 10_oracle-jre.sh
}