summaryrefslogtreecommitdiff
path: root/pkgtools/xpkgwedge/INSTALL
blob: c2b82eac8c82b3ff958e872a9a68f8833796cb27 (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
47
48
49
50
51
52
53
54
55
56
# $NetBSD: INSTALL,v 1.9 2003/12/02 15:41:55 gavan Exp $

FONT_PROGS="@FONT_PROGS@"
X11BASE=@X11BASE@

X11_HOSTDEF=${X11BASE}/lib/X11/config/host.def
HOSTDEF=${PKG_PREFIX}/lib/X11/config/host.def
X11_SITEDEF=${X11BASE}/lib/X11/config/site.def
SITEDEF=${PKG_PREFIX}/lib/X11/config/site.def
X11_SV4LIB=${X11BASE}/lib/X11/config/sv4Lib.tmpl
SV4LIB=${PKG_PREFIX}/lib/X11/config/sv4Lib.tmpl

SV4LIB_SUBST_SED="-e s/^	/        /"
SITEDEF_SUBST_SED="-e s/\#endif.*VendorCF.*/\#include <host.def>\\
&/"

case ${STAGE} in
POST-INSTALL)
	${ECHO} -n "Symlinking font programs..."
	for prog in ${FONT_PROGS}; do
		if [ -f ${X11BASE}/bin/$prog -a				\
		     ${PKG_PREFIX} != ${X11BASE} ]; then
			${LN} -fs ${X11BASE}/bin/$prog			\
				${PKG_PREFIX}/bin/$prog
		fi
	done
	${ECHO} "done."
	;;

VIEW-INSTALL)
	if [ ${PKG_PREFIX} = ${X11BASE} -o -s ${HOSTDEF} ]; then
		${ECHO} -n "Updating ${HOSTDEF}..."
		${CP} -f ${HOSTDEF} ${HOSTDEF}.bak
	else
		${ECHO} -n "Creating ${HOSTDEF}..."
		if [ -f ${X11_HOSTDEF} ]; then
			${CP} -f ${X11_HOSTDEF} ${HOSTDEF}.bak
		else
			${CP} -f /dev/null ${HOSTDEF}.bak
		fi
	fi
	( ${ECHO} '#include <xpkgwedge.def>';				\
	  ${GREP} -v xpkgwedge ${HOSTDEF}.bak;				\
	) > ${HOSTDEF}
	${RM} -f ${HOSTDEF}.bak
	${ECHO} "done."
	case ${X11BASE} in
	*openwin)
		${ECHO} -n "Patching OpenWindows templates..."
		${SED} "${SITEDEF_SUBST_SED}" ${X11_SITEDEF} > ${SITEDEF}
		${SED} "${SV4LIB_SUBST_SED}" ${X11_SV4LIB} > ${SV4LIB}
		${ECHO} "done."
		;;
	esac
	;;
esac