summaryrefslogtreecommitdiff
path: root/x11/openmotif/DEINSTALL
diff options
context:
space:
mode:
authorzuntum <zuntum@pkgsrc.org>2001-10-31 22:03:21 +0000
committerzuntum <zuntum@pkgsrc.org>2001-10-31 22:03:21 +0000
commitd3db18607dbb7d59aeab9f0f846bad1948e95a7e (patch)
tree8ff0c0747d9d6438c6411ba57bcffd7476fce523 /x11/openmotif/DEINSTALL
parent273821c4d377411699fe450ab9d48f7e5933d9b6 (diff)
downloadpkgsrc-d3db18607dbb7d59aeab9f0f846bad1948e95a7e.tar.gz
Move pkg/ files into package's toplevel directory
Diffstat (limited to 'x11/openmotif/DEINSTALL')
-rw-r--r--x11/openmotif/DEINSTALL55
1 files changed, 55 insertions, 0 deletions
diff --git a/x11/openmotif/DEINSTALL b/x11/openmotif/DEINSTALL
new file mode 100644
index 00000000000..f39010ade5c
--- /dev/null
+++ b/x11/openmotif/DEINSTALL
@@ -0,0 +1,55 @@
+#!/bin/sh
+#
+# $NetBSD: DEINSTALL,v 1.1 2001/10/31 22:11:16 zuntum Exp $
+
+PKGNAME=$1
+STAGE=$2
+
+CP="@CP@"
+CMP="@CMP@"
+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=${X11BASE}/lib/X11/config/host.def
+HOSTDEF=${PKG_PREFIX}/lib/X11/config/host.def
+
+case ${STAGE} in
+DEINSTALL)
+ ;;
+
+POST-DEINSTALL)
+ ${ECHO} -n "Updating ${HOSTDEF}..."
+ ${CP} -f ${HOSTDEF} ${HOSTDEF}.bak
+ ( ${GREP} -v OpenMotif ${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."
+
+ ${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