summarylogtreecommitdiffstats
path: root/bin32-jdk6.install
diff options
context:
space:
mode:
authorDet2015-06-14 04:13:27 +0300
committerDet2015-06-14 04:14:15 +0300
commit8713652ded67113dd41ad33fe148c1cd0ddf66bf (patch)
tree6aa3cf2e681c0c6d047e7316af6f83d1a99f6908 /bin32-jdk6.install
downloadaur-8713652ded67113dd41ad33fe148c1cd0ddf66bf.tar.gz
Initial import: 6u45-3
Diffstat (limited to 'bin32-jdk6.install')
-rw-r--r--bin32-jdk6.install71
1 files changed, 71 insertions, 0 deletions
diff --git a/bin32-jdk6.install b/bin32-jdk6.install
new file mode 100644
index 00000000000..3d623c376b9
--- /dev/null
+++ b/bin32-jdk6.install
@@ -0,0 +1,71 @@
+THIS_JAVA='java32-6-jdk'
+NAME='32-bit JDK 6'
+
+all_off="$(tput sgr0)"
+bold="${all_off}$(tput bold)"
+blue="${bold}$(tput setaf 4)"
+yellow="${bold}$(tput setaf 3)"
+
+note() {
+ printf "${blue}::${yellow} archlinux-java32:${bold} $1${all_off}\n"
+}
+
+update_desktop() {
+ update-desktop-database -q
+ update-mime-database /usr/share/mime >/dev/null
+ xdg-icon-resource forceupdate &>/dev/null
+}
+
+post_install() {
+ default=$(archlinux-java32 get)
+ case ${default} in
+ "")
+ archlinux-java32 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-java32 set ${THIS_JAVA}
+ For status, use:
+ $ archlinux-java32 status"
+ ;;
+ esac
+
+ if [[ ! -f /etc/ssl/certs/java/cacerts ]]; then
+ update-ca-trust
+ fi
+
+ update_desktop
+}
+
+post_upgrade() {
+ post_install
+}
+
+pre_remove() {
+ default=$(archlinux-java32 get)
+ if [[ ${default} = ${THIS_JAVA} ]]; then
+ archlinux-java32 unset
+ fi
+}
+
+post_remove() {
+ default=$(archlinux-java32 get) # reassign
+ if [[ ${default} ]]; then
+ note "Default Java environment is '${default}'."
+ else
+ archlinux-java32 fix
+ default=$(archlinux-java32 get) # re-reassign
+ if [[ ${default} ]]; then
+ note "Default Java environment left as '${default}'."
+ else
+ note "Java environment unset."
+ fi
+ fi
+
+ update_desktop
+}