diff options
author | Muflone | 2019-01-19 16:02:17 +0100 |
---|---|---|
committer | Muflone | 2019-01-19 16:02:17 +0100 |
commit | 9f752084197ca9f5fcef2aa1e95e151def38caea (patch) | |
tree | 9f834b012701356eff2d819d01b5c338e7dcff03 /jre10.install | |
download | aur-9f752084197ca9f5fcef2aa1e95e151def38caea.tar.gz |
New package jre10 10.0.2-1
Diffstat (limited to 'jre10.install')
-rw-r--r-- | jre10.install | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/jre10.install b/jre10.install new file mode 100644 index 000000000000..0ba16896f612 --- /dev/null +++ b/jre10.install @@ -0,0 +1,74 @@ +VERSION='10' +THIS_JAVA='java-${VERSION}-jre/jre' +NAME='JRE' + +all_off="$(tput sgr0)" +bold="${all_off}$(tput bold)" +blue="${bold}$(tput setaf 4)" +yellow="${bold}$(tput setaf 3)" + +note() { + printf "${blue}::${yellow} archlinux-java:${bold} $1${all_off}\n" +} + +note2() { + printf "${blue}==>${yellow} NOTE:${bold} $1${all_off}\n" +} + +post_install() { + default=$(archlinux-java get) + case ${default} in + "") + archlinux-java set ${THIS_JAVA} + note "${NAME} ('${THIS_JAVA}') set as default Java environment." + ;; + ${THIS_JAVA}) + note "${NAME} ('${THIS_JAVA}') set as default Java environment." + ;; + *) + note "Default Java environment already set to '${default}'. + To use ${NAME} ('${THIS_JAVA}'), run: + # archlinux-java set ${THIS_JAVA} + For status, use: + $ archlinux-java status" + ;; + esac + + if [[ ! -f /etc/ssl/certs/java/cacerts ]]; then + update-ca-trust + fi + + note2 "Since Oracle Java 9, some Qt 5 applications (such as the reader apps Zeal and + GoldenDict) will crash due to the existance of the Java NPAPI plugin symlink + (/usr/lib/mozilla/plugins/libnpjp2-jre${VERSION}.so). + + See: + - https://github.com/zealdocs/zeal/issues/802 + - https://bbs.archlinux.org/viewtopic.php?id=231222" +} + +post_upgrade() { + post_install +} + +pre_remove() { + default=$(archlinux-java get) + if [[ ${default} = ${THIS_JAVA} ]]; then + archlinux-java unset + fi +} + +post_remove() { + default=$(archlinux-java get) # reassign + if [[ ${default} ]]; then + note "Default Java environment is '${default}'." + else + archlinux-java fix + default=$(archlinux-java get) # re-reassign + if [[ ${default} ]]; then + note "Default Java environment left as '${default}'." + else + note "Java environment unset." + fi + fi +} |