summarylogtreecommitdiffstats
path: root/jdk7.install
diff options
context:
space:
mode:
authorDet2015-07-19 14:29:10 +0300
committerDet2015-07-19 14:29:10 +0300
commitcc36b9e595b2c519c2ac9b11eb33e6eb52da374a (patch)
tree146b52ffee96779f557332becab82e678fb6715f /jdk7.install
parenta53c95167e2ea09298062006f0d3e00ff2b56aa7 (diff)
downloadaur-cc36b9e595b2c519c2ac9b11eb33e6eb52da374a.tar.gz
7u79-3: Merge with jre7/jdk + use CPU (7u79) release
7u79-3: - Merge changes with jre7/jdk - Mention end of public updates: http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html - Use proper versioning (7u79, instead of 7.80) - Use CPU (7u79) release
Diffstat (limited to 'jdk7.install')
-rw-r--r--jdk7.install71
1 files changed, 71 insertions, 0 deletions
diff --git a/jdk7.install b/jdk7.install
new file mode 100644
index 00000000000..36738ef3357
--- /dev/null
+++ b/jdk7.install
@@ -0,0 +1,71 @@
+THIS_JAVA='java-7-jdk'
+NAME='JDK'
+
+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"
+}
+
+update_desktop() {
+ update-desktop-database -q
+ update-mime-database /usr/share/mime >/dev/null
+ xdg-icon-resource forceupdate &>/dev/null
+}
+
+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
+
+ update_desktop
+}
+
+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
+
+ update_desktop
+}