extra/java7-openjdk to 7.u65_2.5.2-3

This commit is contained in:
Kevin Mihelich 2014-10-12 20:27:25 +00:00
parent a6d93c150f
commit f51ba9758b
4 changed files with 103 additions and 74 deletions

View file

@ -23,7 +23,7 @@ _JDK_UPDATE_VERSION=65
_bootstrap=0 # 0/1 for quick build or full bootstrap
pkgver=${_java_ver}.u${_JDK_UPDATE_VERSION}_${_icedtea_ver}
pkgrel=2
pkgrel=3
arch=('i686' 'x86_64')
url='http://icedtea.classpath.org'
license=('custom')
@ -128,7 +128,7 @@ check() {
package_jre7-openjdk-headless() {
pkgdesc='OpenJDK Java 7 headless runtime environment'
depends=('java-common' 'libjpeg-turbo' 'lcms2' 'nss' 'ca-certificates-java')
depends=('java-runtime-common' 'libjpeg-turbo' 'lcms2' 'nss' 'ca-certificates-java')
optdepends=('libcups: needed for Java Mauve support - libmawt.so'
'fontconfig: needed for Java Mauve support - libmawt.so'
'java-rhino: for some JavaScript support')
@ -257,7 +257,7 @@ package_jre7-openjdk() {
package_jdk7-openjdk() {
pkgdesc='OpenJDK Java 7 development kit'
depends=("jre7-openjdk=${pkgver}-${pkgrel}")
depends=('java-environment-common' "jre7-openjdk=${pkgver}-${pkgrel}")
provides=('java-environment=7' 'java-environment-openjdk=7')
replaces=('openjdk6' 'jdk7-openjdk-wm')
install=jdk7-openjdk.install

View file

@ -1,38 +1,50 @@
this_java='java-7-openjdk'
THIS_JDK='java-7-openjdk'
fix_default() {
if [ ! -x /usr/bin/java ]; then
/usr/bin/archlinux-java unset
echo ""
else
/usr/bin/archlinux-java get
fi
}
post_install() {
default=$(/usr/bin/archlinux-java get)
if [ -z "${default}" ]; then
/usr/bin/archlinux-java set ${this_java}
elif [ "${default/\/jre}" = "${this_java/\/jre}" ]; then
/usr/bin/archlinux-java fix
else
echo "Default Java environment is already set to '${default}'"
echo "To set '${this_java}' as default, consider using:"
echo " archlinux-java set '${this_java}'"
fi
default=$(fix_default)
case ${default} in
"" | ${THIS_JDK}/jre)
/usr/bin/archlinux-java set ${THIS_JDK}
;;
${THIS_JDK})
# Nothing
;;
*)
echo "Default Java environment is already set to '${default}'"
echo "See 'archlinux-java help' to change it"
;;
esac
if [ ! -f /etc/ssl/certs/java/cacerts ]; then
JAVA_HOME=/usr/lib/jvm/${this_java} /usr/bin/init-jks-keystore
/usr/bin/init-jks-keystore
fi
}
post_upgrade() {
default=$(/usr/bin/archlinux-java get)
if [ -z "${default}" ]; then
/usr/bin/archlinux-java set ${this_java}
elif [ "${default/\/jre}" = "${this_java/\/jre}" ]; then
/usr/bin/archlinux-java fix
default=$(fix_default)
if [ -z "${default}" -o "x${default}" = "x${THIS_JDK}/jre" ]; then
/usr/bin/archlinux-java set ${THIS_JDK}
fi
if [ ! -f /etc/ssl/certs/java/cacerts ]; then
JAVA_HOME=/usr/lib/jvm/${this_java} /usr/bin/init-jks-keystore
/usr/bin/init-jks-keystore
fi
}
pre_remove() {
default=$(/usr/bin/archlinux-java get)
if [ "${default/\/jre}" = "${this_java/\/jre}" ]; then
/usr/bin/archlinux-java set ${this_java}/jre
if [ "x$(fix_default)" = "x${THIS_JDK}" ]; then
sudo /usr/bin/archlinux-java unset
if [ -x /usr/lib/jvm/${THIS_JDK}/jre/bin/java ]; then
sudo /usr/bin/archlinux-java set ${THIS_JDK}/jre
fi
fi
}

View file

@ -1,41 +1,48 @@
this_java='java-7-openjdk/jre'
THIS_JRE='java-7-openjdk/jre'
fix_default() {
if [ ! -x /usr/bin/java ]; then
/usr/bin/archlinux-java unset
echo ""
else
/usr/bin/archlinux-java get
fi
}
post_install() {
default=$(/usr/bin/archlinux-java get)
if [ -z "${default}" ]; then
/usr/bin/archlinux-java set ${this_java}
elif [ "${default/\/jre}" = "${this_java/\/jre}" ]; then
/usr/bin/archlinux-java fix
else
echo "Default Java environment is already set to '${default}'"
echo "To set '${this_java}' as default, consider using:"
echo " archlinux-java set '${this_java}'"
fi
default=$(fix_default)
case ${default} in
"")
/usr/bin/archlinux-java set ${THIS_JRE}
;;
${THIS_JRE} | ${THIS_JRE/\/jre})
# Nothing
;;
*)
echo "Default Java environment is already set to '${default}'"
echo "See 'archlinux-java help' to change it"
;;
esac
if [ ! -f /etc/ssl/certs/java/cacerts ]; then
# Overwrite JAVA_HOME because if it still points at java-7-openjdk AND user just removed jdk,
# Then /usr/bin/java will in the end, refer to /usr/lib/jvm/java-7-openjdk/java which doesn't exist
JAVA_HOME=/usr/lib/jvm/${this_java} /usr/bin/init-jks-keystore
/usr/bin/init-jks-keystore
fi
}
post_upgrade() {
default=$(/usr/bin/archlinux-java get)
if [ -z "${default}" ]; then
/usr/bin/archlinux-java set ${this_java}
elif [ "${default/\/jre}" = "${this_java/\/jre}" ]; then
/usr/bin/archlinux-java fix
if [ -z $(fix_default) ]; then
/usr/bin/archlinux-java set ${THIS_JRE}
fi
if [ ! -f /etc/ssl/certs/java/cacerts ]; then
JAVA_HOME=/usr/lib/jvm/${this_java} /usr/bin/init-jks-keystore
/usr/bin/init-jks-keystore
fi
}
pre_remove() {
default=$(/usr/bin/archlinux-java get)
if [ "x${default/\/jre}" = "x${this_java/\/jre}" ]; then
default=$(fix_default)
if [ "x${default/\/jre}" = "x${THIS_JRE/\/jre}" ]; then
/usr/bin/archlinux-java unset
echo 'No Java environment is set anymore'
echo "No Java environment is set as default anymore"
fi
}

View file

@ -1,35 +1,50 @@
this_java='java-7-openjdk/jre'
THIS_JRE='java-7-openjdk/jre'
post_install() {
xdg-icon-resource forceupdate --theme hicolor 2> /dev/null
echo "when you use a non-reparenting window manager"
echo "set _JAVA_AWT_WM_NONREPARENTING=1 in"
echo "/etc/profile.d/jre.sh"
# update-desktop-database -q
default=$(/usr/bin/archlinux-java get)
if [ -z "${default}" ]; then
/usr/bin/archlinux-java set ${this_java}
elif [ "${default/\/jre}" = "${this_java/\/jre}" ]; then
/usr/bin/archlinux-java fix
fix_default() {
if [ ! -x /usr/bin/java ]; then
/usr/bin/archlinux-java unset
echo ""
else
echo "Default Java environment is already set to '${default}'"
echo "To set '${this_java}' as default, consider using:"
echo " archlinux-java set '${this_java}'"
/usr/bin/archlinux-java get
fi
}
post_install() {
default=$(fix_default)
case ${default} in
"")
/usr/bin/archlinux-java set ${THIS_JRE}
;;
${THIS_JRE} | ${THIS_JRE/\/jre})
# Nothing
;;
*)
echo "Default Java environment is already set to '${default}'"
echo "See 'archlinux-java help' to change it"
;;
esac
xdg-icon-resource forceupdate --theme hicolor 2> /dev/null
echo "when you use a non-reparenting window manager,"
echo "set _JAVA_AWT_WM_NONREPARENTING=1 in /etc/profile.d/jre.sh"
# update-desktop-database -q
}
post_upgrade() {
if [ -z $(fix_default) ]; then
/usr/bin/archlinux-java set ${THIS_JRE}
fi
xdg-icon-resource forceupdate --theme hicolor 2> /dev/null
# update-desktop-database -q
}
default=$(/usr/bin/archlinux-java get)
if [ -z "${default}" ]; then
/usr/bin/archlinux-java set ${this_java}
elif [ "${default/\/jre}" = "${this_java/\/jre}" ]; then
/usr/bin/archlinux-java fix
pre_remove() {
if [ "x$(fix_default)" = "x${THIS_JRE/\/jre}" ]; then
/usr/bin/archlinux-java unset
echo "No Java environment is set as default anymore"
fi
}
@ -37,9 +52,4 @@ post_remove() {
xdg-icon-resource forceupdate --theme hicolor 2> /dev/null
# update-desktop-database -q
default=$(/usr/bin/archlinux-java get)
if [ "${default/\/jre}" = "${this_java/\/jre}" ]; then
/usr/bin/archlinux-java fix
fi
}