aboutsummaryrefslogtreecommitdiffstats
path: root/java/diablo-jre13/pkg-deinstall
blob: e2aa807dc1cafbd3fd27fcac33b42f045871c611 (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
32
33
34
35
#!/bin/sh
# $FreeBSD: /tmp/pcvs/ports/java/diablo-jre13/Attic/pkg-deinstall,v 1.1 2003-08-25 16:53:03 glewis Exp $

# 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
MOZILLAPLUGINDIR=/usr/X11R6/lib/mozilla/plugins
if [ `echo "$1" | grep jdk` ]; then
    DIABLOPLUGINDIR=${PKG_PREFIX}/diablo-jdk1.3.1/jre/plugin/i386/ns600
else
    DIABLOPLUGINDIR=${PKG_PREFIX}/diablo-jre1.3.1/plugin/i386/ns600
fi
PLUGIN=libjavaplugin_oji.so

# Check if the package includes the plugin
if [ ! -e "${DIABLOPLUGINDIR}/${PLUGIN}" ]; then
    exit 0
fi

# See if the browser plugin is a link to the package plugin and remove it if so.
if [ -e "${MOZILLAPLUGINDIR}/${PLUGIN}" -a \
     -L "${MOZILLAPLUGINDIR}/${PLUGIN}" -a \
     x`ls -l "${MOZILLAPLUGINDIR}/${PLUGIN}" 2>/dev/null | awk '/->/{print $NF;exit 0}END{exit 1}'` = x"${DIABLOPLUGINDIR}/${PLUGIN}" ]; then
    rm -f "${MOZILLAPLUGINDIR}/${PLUGIN}" 
fi

exit 0