PKGBUILDs/extra/java7-openjdk/jre7-openjdk.install

56 lines
1.2 KiB
Plaintext
Raw Normal View History

2014-10-12 20:27:25 +00:00
THIS_JRE='java-7-openjdk/jre'
fix_default() {
if [ ! -x /usr/bin/java ]; then
/usr/bin/archlinux-java unset
echo ""
else
/usr/bin/archlinux-java get
fi
}
2014-08-17 15:10:45 +00:00
2013-03-22 00:52:43 +00:00
post_install() {
2014-10-12 20:27:25 +00:00
default=$(fix_default)
case ${default} in
"")
/usr/bin/archlinux-java set ${THIS_JRE}
;;
${THIS_JRE} | ${THIS_JRE/\/jre})
# Nothing
;;
*)
echo "Default Java environment is already set to '${default}'"
echo "See 'archlinux-java help' to change it"
;;
esac
2013-03-22 00:52:43 +00:00
xdg-icon-resource forceupdate --theme hicolor 2> /dev/null
2014-10-12 20:27:25 +00:00
echo "when you use a non-reparenting window manager,"
echo "set _JAVA_AWT_WM_NONREPARENTING=1 in /etc/profile.d/jre.sh"
2014-08-17 15:10:45 +00:00
2013-03-22 00:52:43 +00:00
# update-desktop-database -q
}
post_upgrade() {
2014-10-12 20:27:25 +00:00
if [ -z $(fix_default) ]; then
/usr/bin/archlinux-java set ${THIS_JRE}
fi
2013-03-22 00:52:43 +00:00
xdg-icon-resource forceupdate --theme hicolor 2> /dev/null
2014-08-17 15:10:45 +00:00
2013-03-22 00:52:43 +00:00
# update-desktop-database -q
2014-10-12 20:27:25 +00:00
}
2013-03-22 00:52:43 +00:00
2014-10-12 20:27:25 +00:00
pre_remove() {
if [ "x$(fix_default)" = "x${THIS_JRE/\/jre}" ]; then
/usr/bin/archlinux-java unset
echo "No Java environment is set as default anymore"
2014-08-17 15:10:45 +00:00
fi
}
2013-03-22 00:52:43 +00:00
post_remove() {
xdg-icon-resource forceupdate --theme hicolor 2> /dev/null
2014-08-17 15:10:45 +00:00
2013-03-22 00:52:43 +00:00
# update-desktop-database -q
}