summarylogtreecommitdiffstats
path: root/jre12.install
diff options
context:
space:
mode:
authorSefa Eyeoglu2019-10-29 14:03:43 +0100
committerSefa Eyeoglu2019-10-29 14:03:43 +0100
commitf33227fd5a5acc04643792459c03a82fa8e1fc35 (patch)
tree6fcfb01ba8805ebd3a37b97d3c37628798a26cfd /jre12.install
parent598a6576ad05f1ce6c7daf5ca8fedf4660b9e38b (diff)
downloadaur-f33227fd5a5acc04643792459c03a82fa8e1fc35.tar.gz
Initial release
Diffstat (limited to 'jre12.install')
-rw-r--r--jre12.install51
1 files changed, 51 insertions, 0 deletions
diff --git a/jre12.install b/jre12.install
new file mode 100644
index 00000000000..4e577ce9fda
--- /dev/null
+++ b/jre12.install
@@ -0,0 +1,51 @@
+THIS_JRE='java-12-jdk'
+
+fix_default() {
+ if [ ! -x /usr/bin/java ]; then
+ /usr/bin/archlinux-java unset
+ echo ""
+ else
+ /usr/bin/archlinux-java get
+ fi
+}
+
+post_install() {
+ default=$(fix_default)
+ case ${default} in
+ "")
+ /usr/bin/archlinux-java set ${THIS_JRE}
+ ;;
+ ${THIS_JRE})
+ # Nothing
+ ;;
+ *)
+ echo "Default Java environment is already set to '${default}'"
+ echo "See 'archlinux-java help' to change it."
+ ;;
+ esac
+
+ echo "When you use a non-reparenting window manager,"
+ echo "set _JAVA_AWT_WM_NONREPARENTING=1 in /etc/profile.d/jre.sh"
+
+ if [ ! -f /etc/ssl/certs/java/cacerts ]; then
+ /usr/bin/update-ca-trust
+ fi
+}
+
+post_upgrade() {
+ if [ -z "$(fix_default)" ]; then
+ /usr/bin/archlinux-java set ${THIS_JRE}
+ fi
+
+ if [ ! -f /etc/ssl/certs/java/cacerts ]; then
+ /usr/bin/update-ca-trust
+ fi
+}
+
+pre_remove() {
+ default=$(fix_default)
+ if [ "x${default}" = "x${THIS_JRE}" ]; then
+ /usr/bin/archlinux-java unset
+ echo "No Java environment is set as default anymore"
+ fi
+}