diff options
author | agc <agc> | 1999-10-27 09:18:29 +0000 |
---|---|---|
committer | agc <agc> | 1999-10-27 09:18:29 +0000 |
commit | d9e3f5555bf47a043e2ca0dacd085d62cf4f96e1 (patch) | |
tree | 859f04f3676635f94b927f72e7a4a088ac0eb241 /net/nocol | |
parent | 4e2332ed8e00598c2613d0f84a55b7d6ac865945 (diff) | |
download | pkgsrc-d9e3f5555bf47a043e2ca0dacd085d62cf4f96e1.tar.gz |
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.
Diffstat (limited to 'net/nocol')
-rw-r--r-- | net/nocol/Makefile | 15 |
1 files changed, 13 insertions, 2 deletions
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) |