3e4ed01146
- Remove USE_XLIB/USE_X_PREFIX/USE_XPM in favor of USE_XORG - Remove X11BASE support in favor of LOCALBASE or PREFIX - Use USE_LDCONFIG instead of INSTALLS_SHLIB - Remove unneeded USE_GCC 3.4+ Thanks to all Helpers: Dmitry Marakasov, Chess Griffin, beech@, dinoex, rafan, gahr, ehaupt, nox, itetcu, flz, pav PR: 116263 Tested on: pointyhat Approved by: portmgr (pav)
57 lines
1.6 KiB
Bash
57 lines
1.6 KiB
Bash
#!/bin/sh
|
|
# $FreeBSD$
|
|
|
|
# System preference location
|
|
JRE_HOME=%%JRE_HOME%%
|
|
|
|
# Post-install actions
|
|
if [ "$2" = "POST-INSTALL" ]; then
|
|
# Set up system preferences
|
|
if [ ! -d "${JRE_HOME}/.systemPrefs" ] ; then
|
|
mkdir -m 755 "${JRE_HOME}/.systemPrefs"
|
|
fi
|
|
if [ ! -f "${JRE_HOME}/.systemPrefs/.system.lock" ] ; then
|
|
touch "${JRE_HOME}/.systemPrefs/.system.lock"
|
|
chmod 644 "${JRE_HOME}/.systemPrefs/.system.lock"
|
|
fi
|
|
if [ ! -f "${JRE_HOME}/.systemPrefs/.systemRootModFile" ] ; then
|
|
touch "${JRE_HOME}/.systemPrefs/.systemRootModFile"
|
|
chmod 644 "${JRE_HOME}/.systemPrefs/.systemRootModFile"
|
|
fi
|
|
|
|
# Install the plugin
|
|
BROWSERPLUGINDIR="%%LOCALBASE%%/lib/browser_plugins"
|
|
JAVAPLUGINDIR="${JRE_HOME}/plugin/%%ARCH%%/ns610"
|
|
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
|