diff options
author | agc <agc@pkgsrc.org> | 1999-10-27 09:18:29 +0000 |
---|---|---|
committer | agc <agc@pkgsrc.org> | 1999-10-27 09:18:29 +0000 |
commit | 7ee76df831fe32d7d95286f0950cb623e0f6b20f (patch) | |
tree | 859f04f3676635f94b927f72e7a4a088ac0eb241 /net/nocol | |
parent | e6e10f2aa18efc0563d49e8427b92f83577de170 (diff) | |
download | pkgsrc-7ee76df831fe32d7d95286f0950cb623e0f6b20f.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) |