summarylogtreecommitdiffstats
path: root/liberica-jre-8-full.install
diff options
context:
space:
mode:
authorYang Jeong Hun2020-11-07 00:44:50 +0900
committerYang Jeong Hun2020-11-07 00:44:50 +0900
commit04c18d0dbe512786388b0e0083df5040d0ccfba4 (patch)
treeb1471828b440cca95cc260e811e5bc20ab79e9cd /liberica-jre-8-full.install
downloadaur-04c18d0dbe512786388b0e0083df5040d0ccfba4.tar.gz
Initial commit
* Thanks to @jonathon make base liberica openjdk install script. Signed-off-by: Yang Jeong Hun <onyxclover9931@gmail.com>
Diffstat (limited to 'liberica-jre-8-full.install')
-rw-r--r--liberica-jre-8-full.install50
1 files changed, 50 insertions, 0 deletions
diff --git a/liberica-jre-8-full.install b/liberica-jre-8-full.install
new file mode 100644
index 00000000000..e49d4f0cbf8
--- /dev/null
+++ b/liberica-jre-8-full.install
@@ -0,0 +1,50 @@
+THIS_JDK='liberica-jre-8-full'
+
+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
+ "" | ${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
+ /usr/bin/update-ca-trust
+ fi
+}
+
+post_upgrade() {
+ 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
+ /usr/bin/update-ca-trust
+ fi
+}
+
+pre_remove() {
+ if [ "x$(fix_default)" = "x${THIS_JDK}" ]; then
+ /usr/bin/archlinux-java unset
+ if [ -x /usr/lib/jvm/${THIS_JDK}/jre/bin/java ]; then
+ /usr/bin/archlinux-java set ${THIS_JDK}/jre
+ fi
+ fi
+}