summaryrefslogtreecommitdiff
path: root/java/jdk15/files/pkg-deinstall.in
diff options
context:
space:
mode:
authorGreg Lewis <glewis@FreeBSD.org>2005-11-23 10:12:33 +0000
committerGreg Lewis <glewis@FreeBSD.org>2005-11-23 10:12:33 +0000
commite141d58fe8ed5585771d9736f1a649554a6fc7ea (patch)
treec04b196e5e17df6dc0ff559d577c964a5f65b6fb /java/jdk15/files/pkg-deinstall.in
parent* Add SHA256. (diff)
. Make pkg-install install a symbolic link for the browser plugin if a
valid one doesn't currently exist. . Add a pkg-deinstall which removes the symbolic link if this port owns it. . Produce pkg-install and pkg-deinstall with SUB_FILES and SUB_LIST rather than manually using ${SED} ourselves. Approved by: maintainer timeout
Notes
Notes: svn path=/head/; revision=149158
Diffstat (limited to 'java/jdk15/files/pkg-deinstall.in')
-rw-r--r--java/jdk15/files/pkg-deinstall.in31
1 files changed, 31 insertions, 0 deletions
diff --git a/java/jdk15/files/pkg-deinstall.in b/java/jdk15/files/pkg-deinstall.in
new file mode 100644
index 000000000000..85c89b9d0a51
--- /dev/null
+++ b/java/jdk15/files/pkg-deinstall.in
@@ -0,0 +1,31 @@
+#!/bin/sh
+# $FreeBSD$
+
+# Set up a standard path
+PATH=/usr/bin:/bin
+
+# Don't do anything during post-deinstall
+if [ "$2" = "POST-DEINSTALL" ]; then
+ exit 0
+fi
+
+# Remove the plugin
+
+# Plugin location variables
+BROWSERPLUGINDIR="%%X11BASE%%/lib/browser_plugins"
+JAVAPLUGINDIR="%%JRE_HOME%%/plugin/%%ARCH%%/ns7"
+PLUGIN=libjavaplugin_oji.so
+
+# Check if the package includes the plugin
+if [ ! -e "${JAVAPLUGINDIR}/${PLUGIN}" ]; then
+ exit 0
+fi
+
+# See if the browser plugin is a link to the package plugin and remove it if so.
+if [ -e "${BROWSERPLUGINDIR}/${PLUGIN}" -a \
+ -L "${BROWSERPLUGINDIR}/${PLUGIN}" -a \
+ x`ls -l "${BROWSERPLUGINDIR}/${PLUGIN}" 2>/dev/null | awk '/->/{print $NF;exit 0}END{exit 1}'` = x"${JAVAPLUGINDIR}/${PLUGIN}" ]; then
+ rm -f "${BROWSERPLUGINDIR}/${PLUGIN}"
+fi
+
+exit 0