From 7ee76df831fe32d7d95286f0950cb623e0f6b20f Mon Sep 17 00:00:00 2001 From: agc Date: Wed, 27 Oct 1999 09:18:29 +0000 Subject: Look for the host program in /usr/bin, /usr/sbin and then $PATH, rather than hardcoding a directory which changed in NetBSD 1.4. Pointed out by Lex Wennmacher. --- net/nocol/Makefile | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'net/nocol') diff --git a/net/nocol/Makefile b/net/nocol/Makefile index 43b79092452..5cff6064dfd 100644 --- a/net/nocol/Makefile +++ b/net/nocol/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.3 1998/08/20 15:17:17 tsarna Exp $ +# $NetBSD: Makefile,v 1.4 1999/10/27 09:18:29 agc Exp $ # DISTNAME= nocol-4.2beta6 @@ -15,7 +15,18 @@ INSTALL_TARGET= install root post-patch: @(hostname=`/bin/hostname`; \ - fqdn=`/usr/sbin/host $$hostname | /usr/bin/awk '{ print $$1; exit }'`; \ + dir=""; \ + for d in /usr/bin /usr/sbin `${ECHO} $$PATH | tr ':' ' '`; do \ + if [ -x $$d/host ]; then \ + dir=$$d; \ + break; \ + fi \ + done; \ + if [ "X$$dir" = "X" ]; then \ + ${ECHO} "host program not found"; \ + exit 1; \ + fi; \ + fqdn=`$$dir/host $$hostname | ${AWK} '{ print $$1; exit }'`; \ ${SED} -e 's|@prefix@|${PREFIX}|g' -e "s|@FQDN@|$$fqdn|g" \ ${FILESDIR}/answers > ${WRKSRC}/answers) -- cgit v1.2.3