summaryrefslogtreecommitdiff
path: root/x11/openmotif/INSTALL
blob: 5025bc6a5369df34d0b5a404f4356d9eecafaf42 (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
# $NetBSD: INSTALL,v 1.6 2004/03/12 02:03:25 reed Exp $

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
POST-INSTALL)
	if [ ${PKG_PREFIX} = ${X11BASE} ]
	then
		${MV} -f ${MOTIF_RULES} ${MOTIF_RULES}.openmotif.bak 2>/dev/null
		${MV} -f ${MOTIF_TMPL} ${MOTIF_TMPL}.openmotif.bak 2>/dev/null
	fi
	${LN} -sf OpenMotif.rules ${MOTIF_RULES}
	${LN} -sf OpenMotif.tmpl ${MOTIF_TMPL}

	if [ ${PKG_PREFIX} = ${X11BASE} -o -f ${HOSTDEF} ]
	then
		${ECHO} -n "Updating ${HOSTDEF} for OpenMotif ..."
		${CP} -f ${HOSTDEF} ${HOSTDEF}.bak
	else
		${ECHO} -n "Creating ${HOSTDEF} for OpenMotif ..."
		if [ -f ${X11_HOSTDEF} ]
		then
			${CP} -f ${X11_HOSTDEF} ${HOSTDEF}.bak
		else
			${CP} -f /dev/null ${HOSTDEF}.bak
		fi
	fi
	( ${GREP} -v OpenMotif ${HOSTDEF}.bak;				\
	  ${ECHO} '#include <OpenMotif.def>';				\
	) > ${HOSTDEF}
	${RM} -f ${HOSTDEF}.bak
	${ECHO} "done."
	;;
esac