? lang/Makefile.patch
Index: lang/python24/Makefile
===================================================================
RCS file: /home/pcvs/ports/lang/python24/Makefile,v
retrieving revision 1.171
diff -u -r1.171 Makefile
--- lang/python24/Makefile	19 Jul 2010 21:59:26 -0000	1.171
+++ lang/python24/Makefile	17 Sep 2011 19:22:58 -0000
@@ -99,8 +99,10 @@
 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 "
+WITHOUT_NIS?=	detected
 .else
 PLIST_SUB+=	NO_NIS=""
 .endif
@@ -134,6 +136,13 @@
 	${ECHO} "fpectl fpectlmodule.c" >> ${WRKSRC}/Modules/Setup.dist
 .endif
 
+post-patch:
+.if defined(WITHOUT_NIS)
+	${REINPLACE_CMD} -e \
+	    's/disabled_module_list =[^]]*/&, "nis"/' \
+		${PATCH_WRKSRC}/setup.py
+.endif
+
 post-configure:
 	@# prepare a subdir for shared build
 .for subdir in Modules Parser Python Objects
Index: lang/python25/Makefile
===================================================================
RCS file: /home/pcvs/ports/lang/python25/Makefile,v
retrieving revision 1.162
diff -u -r1.162 Makefile
--- lang/python25/Makefile	30 May 2011 12:08:39 -0000	1.162
+++ lang/python25/Makefile	17 Sep 2011 19:22:58 -0000
@@ -98,8 +98,10 @@
 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 "
+WITHOUT_NIS?=	detected
 .else
 PLIST_SUB+=	NO_NIS=""
 .endif
@@ -146,6 +148,13 @@
 	${ECHO} "fpectl fpectlmodule.c" >> ${WRKSRC}/Modules/Setup.dist
 .endif
 
+post-patch:
+.if defined(WITHOUT_NIS)
+	${REINPLACE_CMD} -e \
+	    's/disabled_module_list =[^]]*/&, "nis"/' \
+		${PATCH_WRKSRC}/setup.py
+.endif
+
 post-configure:
 	${TAR} -C ${WRKSRC} -cf - . | ${TAR} -C ${SHARED_WRKSRC} -xf -
 	${LN} -sf ${PYTHON_WRKSRC}/Lib ${WRKSRC}/Lib
Index: lang/python26/Makefile
===================================================================
RCS file: /home/pcvs/ports/lang/python26/Makefile,v
retrieving revision 1.173
diff -u -r1.173 Makefile
--- lang/python26/Makefile	19 Aug 2011 13:09:30 -0000	1.173
+++ lang/python26/Makefile	17 Sep 2011 19:22:58 -0000
@@ -131,8 +131,10 @@
 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 "
+WITHOUT_NIS?=	detected
 .else
 PLIST_SUB+=	NO_NIS=""
 .endif
@@ -188,6 +190,11 @@
 	@cd ${WRKSRC} && ${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-setup.py
 .endif
 .endif
+.if defined(WITHOUT_NIS)
+	${REINPLACE_CMD} -e \
+	    's/disabled_module_list =[^]]*/&, "nis"/' \
+		${PATCH_WRKSRC}/setup.py
+.endif
 
 post-configure:
 	${TAR} -C ${WRKSRC} -cf - . | ${TAR} -C ${SHARED_WRKSRC} -xf -
Index: lang/python27/Makefile
===================================================================
RCS file: /home/pcvs/ports/lang/python27/Makefile,v
retrieving revision 1.176
diff -u -r1.176 Makefile
--- lang/python27/Makefile	19 Aug 2011 13:09:30 -0000	1.176
+++ lang/python27/Makefile	17 Sep 2011 19:22:58 -0000
@@ -136,8 +136,10 @@
 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 "
+WITHOUT_NIS?=	detected
 .else
 PLIST_SUB+=	NO_NIS=""
 .endif
@@ -193,6 +195,11 @@
 	@cd ${WRKSRC} && ${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-setup.py
 .endif
 .endif
+.if defined(WITHOUT_NIS)
+	${REINPLACE_CMD} -e \
+	    's/disabled_module_list =[^]]*/&, "nis"/' \
+		${PATCH_WRKSRC}/setup.py
+.endif
 
 post-configure:
 	${TAR} -C ${WRKSRC} -cf - . | ${TAR} -C ${SHARED_WRKSRC} -xf -
Index: lang/python31/Makefile
===================================================================
RCS file: /home/pcvs/ports/lang/python31/Makefile,v
retrieving revision 1.171
diff -u -r1.171 Makefile
--- lang/python31/Makefile	19 Aug 2011 13:09:30 -0000	1.171
+++ lang/python31/Makefile	17 Sep 2011 19:22:58 -0000
@@ -96,8 +96,10 @@
 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 "
+WITHOUT_NIS?=	detected
 .else
 PLIST_SUB+=	NO_NIS=""
 .endif
@@ -143,6 +145,13 @@
 	${ECHO} "fpectl fpectlmodule.c" >> ${WRKSRC}/Modules/Setup.dist
 .endif
 
+post-patch:
+.if defined(WITHOUT_NIS)
+	${REINPLACE_CMD} -e \
+	    's/disabled_module_list =[^]]*/&, "nis"/' \
+		${PATCH_WRKSRC}/setup.py
+.endif
+
 post-configure:
 	${TAR} -C ${WRKSRC} -cf - . | ${TAR} -C ${SHARED_WRKSRC} -xf -
 	${LN} -sf ${PYTHON_WRKSRC}/Lib ${WRKSRC}/Lib
Index: lang/python32/Makefile
===================================================================
RCS file: /home/pcvs/ports/lang/python32/Makefile,v
retrieving revision 1.176
diff -u -r1.176 Makefile
--- lang/python32/Makefile	5 Sep 2011 01:28:56 -0000	1.176
+++ lang/python32/Makefile	17 Sep 2011 19:22:58 -0000
@@ -100,8 +100,10 @@
 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 "
+WITHOUT_NIS?=	detected
 .else
 PLIST_SUB+=	NO_NIS=""
 .endif
@@ -147,6 +149,13 @@
 	${ECHO} "fpectl fpectlmodule.c" >> ${WRKSRC}/Modules/Setup.dist
 .endif
 
+post-patch:
+.if defined(WITHOUT_NIS)
+	${REINPLACE_CMD} -e \
+	    's/disabled_module_list =[^]]*/&, "nis"/' \
+		${PATCH_WRKSRC}/setup.py
+.endif
+
 post-configure:
 	${TAR} -C ${WRKSRC} -cf - . | ${TAR} -C ${SHARED_WRKSRC} -xf -
 	${LN} -sf ${PYTHON_WRKSRC}/Lib ${WRKSRC}/Lib
