58 lines
1.2 KiB
Text
58 lines
1.2 KiB
Text
#!/bin/sh
|
|
#
|
|
# $NetBSD: INSTALL,v 1.1 2001/10/31 21:18:52 zuntum Exp $
|
|
|
|
PKGNAME=$1
|
|
STAGE=$2
|
|
|
|
CP="@CP@"
|
|
ECHO="@ECHO@"
|
|
GREP="@GREP@"
|
|
LN="@LN@"
|
|
MV="@MV@"
|
|
RM="@RM@"
|
|
|
|
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
|
|
PRE-INSTALL)
|
|
;;
|
|
|
|
POST-INSTALL)
|
|
${RM} -f ${X11_DIST_RULES}
|
|
if [ ${PKG_PREFIX} = ${X11BASE} ]
|
|
then
|
|
${MV} -f ${X11_X11_RULES} ${X11_X11_RULES}.buildlink.bak
|
|
${LN} -sf ${X11_X11_RULES}.buildlink.bak ${X11_DIST_RULES}
|
|
else
|
|
${LN} -sf ${X11_X11_RULES} ${X11_DIST_RULES}
|
|
fi
|
|
${LN} -sf buildlinkX11.rules ${X11_RULES}
|
|
|
|
if [ ${PKG_PREFIX} = ${X11BASE} -o -f ${HOSTDEF} ]
|
|
then
|
|
${ECHO} -n "Updating ${HOSTDEF}..."
|
|
${CP} -f ${HOSTDEF} ${HOSTDEF}.bak
|
|
else
|
|
${ECHO} -n "Creating ${HOSTDEF}..."
|
|
${CP} -f ${X11_HOSTDEF} ${HOSTDEF}.bak
|
|
fi
|
|
( ${GREP} -v buildlinkX11 ${HOSTDEF}.bak; \
|
|
${ECHO} '#include <buildlinkX11.def>'; \
|
|
) > ${HOSTDEF}
|
|
${RM} -f ${HOSTDEF}.bak
|
|
${ECHO} "done."
|
|
;;
|
|
|
|
*)
|
|
${ECHO} "Unexpected argument: ${STAGE}"
|
|
exit 1
|
|
;;
|
|
esac
|
|
exit 0
|