summaryrefslogtreecommitdiff
path: root/x11/lesstif/DEINSTALL
blob: 5b20beca0b2c18398911bc48aa7ed07af7bf9c03 (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
#!/bin/sh
#
# $NetBSD: DEINSTALL,v 1.2 2003/08/30 20:23:08 jlam Exp $

PKGNAME=$1
STAGE=$2

LOCALBASE="@LOCALBASE@"

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

LOCALBASE=@LOCALBASE@
X11BASE=@X11BASE@
X11_HOSTDEF=${X11BASE}/lib/X11/config/host.def
HOSTDEF=${PKG_PREFIX}/lib/X11/config/host.def

case ${STAGE} in
POST-DEINSTALL)
	${ECHO} -n "Updating ${HOSTDEF}..."
	${CP} -f ${HOSTDEF} ${HOSTDEF}.bak
	( ${GREP} -v LessTif ${HOSTDEF}.bak || ${TRUE} ) > ${HOSTDEF}
	${RM} -f ${HOSTDEF}.bak
	if [ ${PKG_PREFIX} != ${X11BASE} ] && \
		[ -f ${X11_HOSTDEF} ] && \
		${CMP} -s ${X11_HOSTDEF} ${HOSTDEF}
	then
		${RM} -f ${HOSTDEF}
	fi
	${ECHO} "done."

	if [ ${PKG_PREFIX} != ${LOCALBASE} ]
	then
		${RM} -f ${LOCALBASE}/share/aclocal/ac_find_motif.m4
		${RMDIR} -p ${PKG_PREFIX}/share/aclocal 2>/dev/null || ${TRUE}
	fi

	${RMDIR} -p ${PKG_PREFIX}/lib/X11/config 2>/dev/null || ${TRUE}
	;;
esac
exit 0