aboutsummaryrefslogtreecommitdiff
path: root/java/jdk16/files/pkg-deinstall.in
blob: 85c89b9d0a51040a505fd6eaa419d95b76a3db1d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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