2003-10-11 07:16:50 +02:00
|
|
|
#!/bin/sh
|
2005-11-23 22:16:56 +01:00
|
|
|
# $FreeBSD$
|
2003-10-11 07:16:50 +02:00
|
|
|
|
|
|
|
# System preference location
|
2005-09-04 16:31:32 +02:00
|
|
|
JRE_HOME=%%JRE_HOME%%
|
2003-10-11 07:16:50 +02:00
|
|
|
|
2005-09-04 16:31:32 +02:00
|
|
|
# Post-install actions
|
2003-10-11 07:16:50 +02:00
|
|
|
if [ "$2" = "POST-INSTALL" ]; then
|
2005-09-04 16:31:32 +02:00
|
|
|
# Set up system preferences
|
|
|
|
if [ ! -d "${JRE_HOME}/.systemPrefs" ] ; then
|
|
|
|
mkdir -m 755 "${JRE_HOME}/.systemPrefs"
|
2003-10-11 07:16:50 +02:00
|
|
|
fi
|
2005-09-04 16:31:32 +02:00
|
|
|
if [ ! -f "${JRE_HOME}/.systemPrefs/.system.lock" ] ; then
|
|
|
|
touch "${JRE_HOME}/.systemPrefs/.system.lock"
|
|
|
|
chmod 644 "${JRE_HOME}/.systemPrefs/.system.lock"
|
2003-10-11 07:16:50 +02:00
|
|
|
fi
|
2005-09-04 16:31:32 +02:00
|
|
|
if [ ! -f "${JRE_HOME}/.systemPrefs/.systemRootModFile" ] ; then
|
|
|
|
touch "${JRE_HOME}/.systemPrefs/.systemRootModFile"
|
|
|
|
chmod 644 "${JRE_HOME}/.systemPrefs/.systemRootModFile"
|
|
|
|
fi
|
2005-11-23 11:12:33 +01:00
|
|
|
|
|
|
|
# Install the plugin
|
2006-10-14 10:54:54 +02:00
|
|
|
BROWSERPLUGINDIR="%%LOCALBASE%%/lib/browser_plugins"
|
2005-11-23 11:12:33 +01:00
|
|
|
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
|
2003-10-11 07:16:50 +02:00
|
|
|
fi
|