#!/bin/sh # # $NetBSD: DEINSTALL,v 1.1 2001/10/31 21:18:51 zuntum Exp $ PKGNAME=$1 STAGE=$2 CMP="@CMP@" CP="@CP@" ECHO="@ECHO@" GREP="@GREP@" MV="@MV@" RM="@RM@" RMDIR="@RMDIR@" TRUE="@TRUE@" X11BASE=@X11BASE@ X11_HOSTDEF=${X11BASE}/lib/X11/config/host.def HOSTDEF=${PKG_PREFIX}/lib/X11/config/host.def X11_X11_RULES=${X11BASE}/lib/X11/config/X11.rules X11_RULES=${PKG_PREFIX}/lib/X11/config/X11.rules X11_DIST_RULES=${PKG_PREFIX}/lib/X11/config/X11.dist.rules case ${STAGE} in DEINSTALL) ;; POST-DEINSTALL) ${ECHO} -n "Updating ${HOSTDEF}..." ${CP} -f ${HOSTDEF} ${HOSTDEF}.bak ( ${GREP} -v buildlinkX11 ${HOSTDEF}.bak || ${TRUE} ) > ${HOSTDEF} ${RM} -f ${HOSTDEF}.bak if [ ${PKG_PREFIX} != ${X11BASE} ] && \ ${CMP} -s ${X11_HOSTDEF} ${HOSTDEF} then ${RM} -f ${HOSTDEF} fi ${ECHO} "done." ${RM} -f ${X11_RULES} ${X11_DIST_RULES} if [ ${PKG_PREFIX} = ${X11BASE} ] then ${MV} -f ${X11_X11_RULES}.buildlink.bak ${X11_X11_RULES} fi ${RMDIR} -p ${PKG_PREFIX}/lib/X11/config 2>/dev/null || ${TRUE} ;; *) ${ECHO} "Unexpected argument: ${STAGE}" exit 1 ;; esac exit 0