Index: python24/Makefile
===================================================================
RCS file: /home/pcvs/ports/lang/python24/Makefile,v
retrieving revision 1.171
diff -u -r1.171 Makefile
--- python24/Makefile	19 Jul 2010 21:59:26 -0000	1.171
+++ python24/Makefile	11 Sep 2011 11:40:26 -0000
@@ -99,7 +99,8 @@
 CFLAGS+=	-DPYTHON_DEFAULT_RECURSION_LIMIT=900
 .endif
 
-.if !exists(/usr/bin/ypcat) # the world with NO_NIS
+# See http://bugs.freebsd.org/115940
+.if !exists(/usr/bin/ypcat) || defined(WITHOUT_NIS) # the world with NO_NIS
 PLIST_SUB+=	NO_NIS="@comment "
 .else
 PLIST_SUB+=	NO_NIS=""
@@ -194,6 +195,10 @@
 	${INSTALL_SCRIPT} ${WRKDIR}/pydoc2.4 ${WRKDIR}/idle2.4 \
 		${WRKDIR}/smtpd2.4.py ${PREFIX}/bin
 
+# Tidy up if nis_failed.so is installed
+	[ ! -f ${PYTHON_LIBDIR}/lib-dynload/nis_failed.so ] \
+		|| ${RM} -f ${PYTHON_LIBDIR}/lib-dynload/nis_failed.so
+
 .if ${PYTHON_VERSION} == ${PYTHON_DEFAULT_VERSION} || !exists(${LOCALBASE}/bin/python)
 	for f in ${BIN_SCRIPTS}; do \
 		TARGET=`${ECHO_CMD} $$f | ${SED} -E ${BINLINKS_SUB}`; \
Index: python25/Makefile
===================================================================
RCS file: /home/pcvs/ports/lang/python25/Makefile,v
retrieving revision 1.162
diff -u -r1.162 Makefile
--- python25/Makefile	30 May 2011 12:08:39 -0000	1.162
+++ python25/Makefile	11 Sep 2011 11:40:26 -0000
@@ -98,7 +98,8 @@
 CFLAGS+=	-DPYTHON_DEFAULT_RECURSION_LIMIT=900
 .endif
 
-.if !exists(/usr/bin/ypcat) # the world with NO_NIS
+# See http://bugs.freebsd.org/115940
+.if !exists(/usr/bin/ypcat) || defined(WITHOUT_NIS) # the world with NO_NIS
 PLIST_SUB+=	NO_NIS="@comment "
 .else
 PLIST_SUB+=	NO_NIS=""
@@ -205,6 +206,10 @@
 	${INSTALL_MAN} ${PYTHON_WRKSRC}/Misc/python.man \
 		${MANPREFIX}/man/man1/${PYTHON_VERSION}.1
 
+# Tidy up if nis_failed.so is installed
+	[ ! -f ${PYTHON_LIBDIR}/lib-dynload/nis_failed.so ] \
+		|| ${RM} -f ${PYTHON_LIBDIR}/lib-dynload/nis_failed.so
+
 .if ${PYTHON_VERSION} == ${PYTHON_DEFAULT_VERSION} || !exists(${LOCALBASE}/bin/python)
 	for f in ${BIN_SCRIPTS}; do \
 		TARGET=`${ECHO_CMD} $$f | ${SED} -E ${BINLINKS_SUB}`; \
Index: python26/Makefile
===================================================================
RCS file: /home/pcvs/ports/lang/python26/Makefile,v
retrieving revision 1.173
diff -u -r1.173 Makefile
--- python26/Makefile	19 Aug 2011 13:09:30 -0000	1.173
+++ python26/Makefile	11 Sep 2011 11:40:26 -0000
@@ -131,7 +131,8 @@
 CFLAGS+=	-DPYTHON_DEFAULT_RECURSION_LIMIT=900
 .endif
 
-.if !exists(/usr/bin/ypcat) # the world with NO_NIS
+# See http://bugs.freebsd.org/115940
+.if !exists(/usr/bin/ypcat) || defined(WITHOUT_NIS) # the world with NO_NIS
 PLIST_SUB+=	NO_NIS="@comment "
 .else
 PLIST_SUB+=	NO_NIS=""
@@ -251,6 +252,10 @@
 	${INSTALL_MAN} ${PYTHON_WRKSRC}/Misc/python.man \
 		${MANPREFIX}/man/man1/${PYTHON_VERSION}.1
 
+# Tidy up if nis_failed.so is installed
+	[ ! -f ${PYTHON_LIBDIR}/lib-dynload/nis_failed.so ] \
+		|| ${RM} -f ${PYTHON_LIBDIR}/lib-dynload/nis_failed.so
+
 .if ${PYTHON_VERSION} == ${PYTHON_DEFAULT_VERSION} || !exists(${LOCALBASE}/bin/python)
 	for f in ${BIN_FILES}; do \
 		TARGET=`${ECHO_CMD} $$f | ${SED} -E ${BINLINKS_SUB}`; \
Index: python27/Makefile
===================================================================
RCS file: /home/pcvs/ports/lang/python27/Makefile,v
retrieving revision 1.176
diff -u -r1.176 Makefile
--- python27/Makefile	19 Aug 2011 13:09:30 -0000	1.176
+++ python27/Makefile	11 Sep 2011 11:40:26 -0000
@@ -136,7 +136,8 @@
 CFLAGS+=	-DPYTHON_DEFAULT_RECURSION_LIMIT=900
 .endif
 
-.if !exists(/usr/bin/ypcat) # the world with NO_NIS
+# See http://bugs.freebsd.org/115940
+.if !exists(/usr/bin/ypcat) || defined(WITHOUT_NIS) # the world with NO_NIS
 PLIST_SUB+=	NO_NIS="@comment "
 .else
 PLIST_SUB+=	NO_NIS=""
@@ -256,6 +257,10 @@
 	${INSTALL_MAN} ${PYTHON_WRKSRC}/Misc/python.man \
 		${MANPREFIX}/man/man1/${PYTHON_VERSION}.1
 
+# Tidy up if nis_failed.so is installed
+	[ ! -f ${PYTHON_LIBDIR}/lib-dynload/nis_failed.so ] \
+		|| ${RM} -f ${PYTHON_LIBDIR}/lib-dynload/nis_failed.so
+
 .if ${PYTHON_VERSION} == ${PYTHON_DEFAULT_VERSION} || !exists(${LOCALBASE}/bin/python)
 	for f in ${BIN_FILES}; do \
 		TARGET=`${ECHO_CMD} $$f | ${SED} -E ${BINLINKS_SUB}`; \
Index: python31/Makefile
===================================================================
RCS file: /home/pcvs/ports/lang/python31/Makefile,v
retrieving revision 1.171
diff -u -r1.171 Makefile
--- python31/Makefile	19 Aug 2011 13:09:30 -0000	1.171
+++ python31/Makefile	11 Sep 2011 11:40:26 -0000
@@ -96,7 +96,8 @@
 CFLAGS+=	-DPYTHON_DEFAULT_RECURSION_LIMIT=900
 .endif
 
-.if !exists(/usr/bin/ypcat) # the world with NO_NIS
+# See http://bugs.freebsd.org/115940
+.if !exists(/usr/bin/ypcat) || defined(WITHOUT_NIS) # the world with NO_NIS
 PLIST_SUB+=	NO_NIS="@comment "
 .else
 PLIST_SUB+=	NO_NIS=""
@@ -205,6 +206,10 @@
 	${INSTALL_MAN} ${PYTHON_WRKSRC}/Misc/python.man \
 		${MANPREFIX}/man/man1/${PYTHON_VERSION}.1
 
+# Tidy up if nis_failed.so is installed
+	[ ! -f ${PYTHON_LIBDIR}/lib-dynload/nis_failed.so ] \
+		|| ${RM} -f ${PYTHON_LIBDIR}/lib-dynload/nis_failed.so
+
 .if ${PYTHON_VERSION} == ${PYTHON_DEFAULT_VERSION} || !exists(${LOCALBASE}/bin/python)
 	for f in ${BIN_FILES}; do \
 		TARGET=`${ECHO_CMD} $$f | ${SED} -E ${BINLINKS_SUB}`; \
Index: python32/Makefile
===================================================================
RCS file: /home/pcvs/ports/lang/python32/Makefile,v
retrieving revision 1.176
diff -u -r1.176 Makefile
--- python32/Makefile	5 Sep 2011 01:28:56 -0000	1.176
+++ python32/Makefile	11 Sep 2011 11:40:26 -0000
@@ -100,7 +100,8 @@
 CFLAGS+=	-DPYTHON_DEFAULT_RECURSION_LIMIT=900
 .endif
 
-.if !exists(/usr/bin/ypcat) # the world with NO_NIS
+# See http://bugs.freebsd.org/115940
+.if !exists(/usr/bin/ypcat) || defined(WITHOUT_NIS) # the world with NO_NIS
 PLIST_SUB+=	NO_NIS="@comment "
 .else
 PLIST_SUB+=	NO_NIS=""
@@ -198,6 +199,10 @@
 	${INSTALL_MAN} ${PYTHON_WRKSRC}/Misc/python.man \
 		${MANPREFIX}/man/man1/${PYTHON_VERSION}.1
 
+# Tidy up if nis_failed.so is installed
+	[ ! -f ${PYTHON_LIBDIR}/lib-dynload/nis_failed.so ] \
+		|| ${RM} -f ${PYTHON_LIBDIR}/lib-dynload/nis_failed.so
+
 .if ${PYTHON_VERSION} == ${PYTHON_DEFAULT_VERSION} || !exists(${LOCALBASE}/bin/python)
 	for f in ${BIN_FILES}; do \
 		TARGET=`${ECHO_CMD} $$f | ${SED} -E ${BINLINKS_SUB}`; \
