aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mail/py-spambayes/Makefile17
-rw-r--r--mail/py-spambayes/files/extra-patch-python2611
2 files changed, 26 insertions, 2 deletions
diff --git a/mail/py-spambayes/Makefile b/mail/py-spambayes/Makefile
index 09e8a6d64c9b..d05ca7d943de 100644
--- a/mail/py-spambayes/Makefile
+++ b/mail/py-spambayes/Makefile
@@ -16,9 +16,11 @@ PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
MAINTAINER= ports@FreeBSD.org
COMMENT= A Bayesian anti-spam filter written in Python
-RUN_DEPENDS= ${PYTHON_SITELIBDIR}/_bsddb.so:${PORTSDIR}/databases/py25-bsddb
+# bypass infrastructure bug
+OPTIONSFILE= ${PORT_DBDIR}/py-${PORTNAME}/options
+
+OPTIONS= PYTHON26 "Build with Python 2.6 (with unofficial patch)" off
-USE_PYTHON= 2.5
USE_PYDISTUTILS= yes
USE_RC_SUBR= pyspamd
LOCALSTATDIR?= /var/db/spambayes
@@ -78,4 +80,15 @@ post-install:
@${MKDIR} ${CACHEDIR}
@${MKDIR} ${DBDIR}
+.include <bsd.port.options.mk>
+
+.if defined(WITH_PYTHON26)
+USE_PYTHON= 2.6
+RUN_DEPENDS+= ${PYTHON_SITELIBDIR}/_bsddb.so:${PORTSDIR}/databases/py-bsddb
+EXTRA_PATCHES+= ${FILESDIR}/extra-patch-python26
+.else
+USE_PYTHON= 2.5
+RUN_DEPENDS+= ${PYTHON_SITELIBDIR}/_bsddb.so:${PORTSDIR}/databases/py25-bsddb
+.endif
+
.include <bsd.port.mk>
diff --git a/mail/py-spambayes/files/extra-patch-python26 b/mail/py-spambayes/files/extra-patch-python26
new file mode 100644
index 000000000000..a2ab6a17175d
--- /dev/null
+++ b/mail/py-spambayes/files/extra-patch-python26
@@ -0,0 +1,11 @@
+--- spambayes/Dibbler.py~ 2009-07-10 21:43:59.000000000 +0200
++++ spambayes/Dibbler.py 2009-07-10 21:44:37.655326444 +0200
+@@ -218,7 +218,7 @@
+ # self.initiate_send() raises an exception, causing self.close()
+ # to be called. If we didn't check, we could end up in an infinite
+ # loop.
+- while (self.producer_fifo or self.ac_out_buffer) and not self._closed:
++ while (self.producer_fifo) and not self._closed:
+ self.initiate_send()
+
+ def close(self):