summaryrefslogtreecommitdiff
path: root/java/jdk15/files/pkg-install.in
diff options
context:
space:
mode:
Diffstat (limited to 'java/jdk15/files/pkg-install.in')
-rw-r--r--java/jdk15/files/pkg-install.in36
1 files changed, 36 insertions, 0 deletions
diff --git a/java/jdk15/files/pkg-install.in b/java/jdk15/files/pkg-install.in
index 6b1b106336c9..0521efe53563 100644
--- a/java/jdk15/files/pkg-install.in
+++ b/java/jdk15/files/pkg-install.in
@@ -17,4 +17,40 @@ if [ "$2" = "POST-INSTALL" ]; then
touch "${JRE_HOME}/.systemPrefs/.systemRootModFile"
chmod 644 "${JRE_HOME}/.systemPrefs/.systemRootModFile"
fi
+
+ # Install the plugin
+ BROWSERPLUGINDIR="%%X11BASE%%/lib/browser_plugins"
+ JAVAPLUGINDIR="${JRE_HOME}/plugin/%%ARCH%%/ns7"
+ PLUGIN=libjavaplugin_oji.so
+
+ # Check if the browser plugin exists
+ if [ ! -e "${JAVAPLUGINDIR}/${PLUGIN}" ]; then
+ exit 0
+ fi
+
+ # Check if the plugin directory exists.
+ if [ ! -d "${BROWSERPLUGINDIR}" ]; then
+ exit 0
+ fi
+
+ # Check if the browser plugin currently exists
+ if [ ! -e "${BROWSERPLUGINDIR}/${PLUGIN}" ]; then
+ # Create symbolic link
+ ln -sf "${JAVAPLUGINDIR}/${PLUGIN}" \
+ "${BROWSERPLUGINDIR}/${PLUGIN}"
+ exit 0
+ fi
+
+ # If the browser plugin exists and is a symlink, but the link
+ # doesn't exist, then overwrite with our plugin.
+ if [ -L "${BROWSERPLUGINDIR}/${PLUGIN}" ]; then
+ # Check if the linked to file exists.
+ if [ ! -e `ls -l "${BROWSERPLUGINDIR}/${PLUGIN}" 2>/dev/null | awk '/->/{print $NF;exit 0}END{exit 1}'` ]; then
+ ln -sf "${JAVAPLUGINDIR}/${PLUGIN}" \
+ "${BROWSERPLUGINDIR}/${PLUGIN}"
+ exit 0
+ fi
+ fi
+
+ exit 0
fi