PKGBUILDs/extra/java7-openjdk/jre7-openjdk-headless.install

42 lines
1.3 KiB
Text
Raw Normal View History

2014-08-17 15:10:45 +00:00
this_java='java-7-openjdk/jre'
2013-03-22 00:52:43 +00:00
post_install() {
2014-08-17 15:10:45 +00:00
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
2013-03-22 00:52:43 +00:00
if [ ! -f /etc/ssl/certs/java/cacerts ]; then
2014-08-17 15:10:45 +00:00
# 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/java-default-runtime /usr/bin/init-jks-keystore
2013-03-22 00:52:43 +00:00
fi
}
post_upgrade() {
2014-08-17 15:10:45 +00:00
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
fi
2013-03-22 00:52:43 +00:00
if [ ! -f /etc/ssl/certs/java/cacerts ]; then
2014-08-17 15:10:45 +00:00
JAVA_HOME=/usr/lib/jvm/java-default-runtime /usr/bin/init-jks-keystore
fi
}
pre_remove() {
default=$(/usr/bin/archlinux-java get)
if [ "x${default/\/jre}" = "x${this_java/\/jre}" ]; then
/usr/bin/archlinux-java unset
echo 'No Java environment is set anymore'
2013-03-22 00:52:43 +00:00
fi
}