Newer linuxes might not have rpc/nis, let's test for it at
bootstrap.

ChromeOS / musl never do. Newer GLIBC might not as well.

Index: bootstrap
===================================================================
RCS file: /cvsroot/pkgsrc/bootstrap/bootstrap,v
retrieving revision 1.250
diff -u -r1.250 bootstrap
--- bootstrap	9 Sep 2018 10:01:26 -0000	1.250
+++ bootstrap	17 Oct 2018 10:12:53 -0000
@@ -166,6 +166,18 @@
 	rm -f ${wrkdir}/$$.c
 
 }
+
+# see if we have a NIS library.
+test_nis()
+{
+	cat >${wrkdir}/$$.c <<EOF
+#include <rpc/rpc.h>
+EOF
+	${CC} -E ${wrkdir}/$$.c 2>/dev/null
+	have_nis=$?
+
+}
+
 get_abi()
 {
 	abi_opsys=$@
@@ -511,6 +523,7 @@
 case "$opsys" in
 AIX)
 	root_group=system
+	need_test_nis=no
 	need_bsd_install=yes
 	need_awk=yes
 	need_sed=yes
@@ -521,6 +534,7 @@
 	;;
 Bitrig)
 	root_group=wheel
+	need_test_nis=no
 	need_bsd_install=no
 	need_awk=no
 	need_sed=no
@@ -537,6 +551,7 @@
 	}
 	root_user=Administrators
 	root_group=Administrators
+	need_test_nis=no
 	need_bsd_install=no
 	opsys=`uname -o`
 	need_awk=no
@@ -550,6 +565,7 @@
 
 Darwin)
 	root_group=wheel
+	need_test_nis=no
 	need_bsd_install=no
 	need_awk=no
 	need_sed=no
@@ -580,6 +596,7 @@
 	;;
 DragonFly)
 	root_group=wheel
+	need_test_nis=no
 	need_bsd_install=no
 	need_awk=no
 	need_sed=no
@@ -589,6 +606,7 @@
 	;;
 FreeBSD)
 	root_group=wheel
+	need_test_nis=no
 	need_bsd_install=no
 	need_awk=no
 	need_sed=no
@@ -598,6 +616,7 @@
 	;;
 FreeMiNT)
 	root_group=root
+	need_test_nis=no
 	need_bsd_install=no
 	need_awk=no
 	need_sed=no
@@ -606,6 +625,7 @@
 	;;
 GNUkFreeBSD)
 	root_group=root
+	need_test_nis=no
 	need_bsd_install=no
 	need_awk=yes
 	need_sed=no
@@ -615,6 +635,7 @@
 Haiku)
 	root_user=`id -un`
 	root_group=root
+	need_test_nis=no
 	need_bsd_install=no
 	need_awk=no
 	need_sed=no
@@ -633,6 +654,7 @@
 	;;
 HPUX)
 	root_group=sys
+	need_test_nis=no
 	need_bsd_install=yes
 	need_awk=yes
 	need_sed=yes
@@ -652,6 +674,7 @@
 	default_install_mode=0775
 	root_user=`id -un`
 	root_group=+Administrators
+	need_test_nis=no
 	case `uname -r` in
 	3.* | 5.*)
 		need_bsd_install=yes
@@ -686,6 +709,7 @@
 		overpath="/usr/bsd/bin:$overpath"
 	fi
 	root_group=sys
+	need_test_nis=no
 	need_bsd_install=yes
 	get_abi "IRIX"
 	opsys=IRIX
@@ -706,6 +730,7 @@
 	else
 		root_group=root
 	fi
+	need_test_nis=yes
 	need_bsd_install=no
 	# Debian/Ubuntu's awk is mawk, and mawk does not understand
 	# some regexp used in pkgsrc/mk.
@@ -728,6 +753,7 @@
 	;;
 Minix)
 	root_group=operator
+	need_test_nis=no
 	need_bsd_install=yes
 	need_awk=no
 	need_sed=no
@@ -739,6 +765,7 @@
 	root_group=wheel
 	need_pax=yes
 	need_mtree=no
+	need_test_nis=no
 	need_bsd_install=no
 	need_awk=no
 	need_sed=no
@@ -765,6 +792,7 @@
 	;;
 NetBSD)
 	root_group=wheel
+	need_test_nis=no
 	need_bsd_install=no
 	need_awk=no
 	need_sed=no
@@ -773,6 +801,7 @@
 	;;
 OpenBSD)
 	root_group=wheel
+	need_test_nis=no
 	need_bsd_install=no
 	need_awk=no
 	need_sed=no
@@ -783,6 +812,7 @@
 	;;
 OSF1)
 	root_group=system
+	need_test_nis=no
 	need_bsd_install=yes
 	need_awk=yes
 	need_sed=yes
@@ -792,6 +822,7 @@
 	;;
 QNX)
 	root_group=root
+	need_test_nis=no
 	need_bsd_install=yes
 	need_awk=yes
 	need_sed=yes
@@ -803,6 +834,7 @@
 SCO_SV)
 	root_group=root
 	need_awk=yes
+	need_test_nis=no
 	need_bsd_install=yes
 	need_sed=yes
 	set_opsys=no
@@ -813,6 +845,7 @@
 	;;
 SunOS)
 	root_group=root
+	need_test_nis=no
 	need_bsd_install=yes
 	use_bsdinstall=yes
 	if [ -x "/usr/gnu/bin/awk" ]; then
@@ -840,6 +873,7 @@
 	;;
 UnixWare)
 	root_group=sys
+	need_test_nis=no
 	need_bsd_install=no
 	BSTRAP_ENV="INSTALL=/usr/ucb/install $BSTRAP_ENV"
 	need_mkdir=yes
@@ -852,6 +886,7 @@
 *)
 	echo "This platform ($opsys) is untried - good luck, and thanks for using pkgsrc"
 	root_group=wheel
+	need_test_nis=no
 	need_bsd_install=yes
 	need_awk=yes
 	need_sed=yes
@@ -1113,6 +1148,15 @@
 mkdir_p $wrkdir/sbin $wrkdir/share/mk
 mkdir_p_early ${wrkdir}
 
+if [ $need_test_nis ]; then
+	test_nis
+	if [ $have_nis ]; then
+		echo "HAVE_NIS=		yes" >> ${TARGET_MKCONF}
+	else
+		echo "HAVE_NIS=		no" >> ${TARGET_MKCONF}
+	fi
+fi
+
 if [ "$need_bsd_install" = "yes" ]; then
 	BSTRAP_ENV="INSTALL='$prefix/bin/install-sh -c' $BSTRAP_ENV"
 	if [ "$use_bsdinstall" = "yes" ]; then
