summaryrefslogtreecommitdiff
path: root/x11/openmotif/pkg/DEINSTALL
blob: b17255972ebc2501772579404aedd2823639a2b2 (plain)
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
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/sh
#
# $NetBSD: DEINSTALL,v 1.1 2001/09/08 20:03:45 jlam Exp $

PKGNAME=$1
STAGE=$2

CP="@CP@"
ECHO="@ECHO@"
GREP="@GREP@"
MV="@MV@"
RM="@RM@"
RMDIR="@RMDIR@"
TRUE="@TRUE@"

X11BASE=@X11BASE@
MOTIF_RULES=${PKG_PREFIX}/lib/X11/config/Motif.rules
MOTIF_TMPL=${PKG_PREFIX}/lib/X11/config/Motif.tmpl
X11_HOSTDEF=${PKG_PREFIX}/lib/X11/config/host.def

case ${STAGE} in
DEINSTALL)
	;;

POST-DEINSTALL)
	${ECHO} -n "Updating ${X11_HOSTDEF}..."
	${CP} -f ${X11_HOSTDEF} ${X11_HOSTDEF}.bak
	( ${GREP} -v OpenMotif ${X11_HOSTDEF}.bak || ${TRUE} ) \
		> ${X11_HOSTDEF}
	${ECHO} "done."

	${RM} -f ${MOTIF_RULES} ${MOTIF_TMPL}
	if [ ${PKG_PREFIX} = ${X11BASE} ]
	then
		${MV} -f ${MOTIF_RULES}.openmotif.bak ${MOTIF_RULES}
		${MV} -f ${MOTIF_TMPL}.openmotif.bak ${MOTIF_TMPL}
	fi
	
	${RMDIR} -p ${PKG_PREFIX}/lib/X11/config 2>/dev/null || ${TRUE}
	;;

*)
	${ECHO} "Unexpected argument: ${STAGE}"
	exit 1
	;;
esac
exit 0