ports/109552: [PATCH] mail/py-spambayes
CHAO Shin
quakelee at cn.freebsd.org
Mon Feb 26 08:50:06 UTC 2007
>Number: 109552
>Category: ports
>Synopsis: [PATCH] mail/py-spambayes
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Mon Feb 26 08:50:05 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator: CHAO Shin
>Release:
>Organization:
The FreeBSD Simplified Chinese Project
>Environment:
FreeBSD 7.0-current i386
System: FreeBSD portyard.sysdept.sina.com.cn 7.0-CURRENT FreeBSD 7.0-CURRENT #0: Thu Feb 1 19:02:06 CST 2007 root at portyard.sysdept.sina.com.cn:/usr/obj/usr/src/sys/GX270 i386
>Description:
Enable the pop3 spamproxy daemon and add a start script.
>How-To-Repeat:
>Fix:
--- patch-py-spambayes.diff begins here ---
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/mail/py-spambayes/Makefile,v
retrieving revision 1.17
diff -u -p -r1.17 Makefile
--- Makefile 12 Jul 2006 22:04:36 -0000 1.17
+++ Makefile 26 Feb 2007 08:10:06 -0000
@@ -7,6 +7,7 @@
PORTNAME= spambayes
PORTVERSION= 1.0.4
+PORTREVISION= 1
CATEGORIES= mail python
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}
@@ -20,6 +21,13 @@ RUN_DEPENDS= ${PYTHON_SITELIBDIR}/_bsddb
USE_PYTHON= yes
USE_PYDISTUTILS= yes
+USE_RC_SUBR= pyspamd
+LOCALSTATDIR?= /var/db/spambayes
+DBDIR?= ${LOCALSTATDIR}/dbs
+CACHEDIR?= ${LOCALSTATDIR}/cache
+PLIST_SUB+= LOCALSTATDIR=${LOCALSTATDIR} \
+ DBDIR=${DBDIR} \
+ CACHEDIR=${CACHEDIR}
PORTDOCS= CHANGELOG.txt \
LICENSE.txt \
@@ -40,8 +48,19 @@ post-patch:
${XARGS} -n 10 -x \
${REINPLACE_CMD} -E \
-e 's|/usr/bin/env python|${PYTHONBASE}/bin/${PYTHON_VERSION}|'
- @${FIND} ${WRKSRC}/utilities ${WRKSRC}/contrib \
+ @${FIND} ${WRKSRC}/utilities ${WRKSRC}/contrib ${WRKSRC}/spambayes\
-type f -name *.bak | ${XARGS} ${RM}
+ @${REINPLACE_CMD} -e \
+ '/persistent_storage_file/s|hammie.db|${DBDIR}/hammie.db|' \
+ -e \
+ '/messageinfo_storage_file/s|spambayes.messageinfo.db|${DBDIR}/spambayes.messageinfo.db|' \
+ -e \
+ '/spam_cache/s|pop3proxy-spam-cache|${CACHEDIR}/pop3proxy-spam-cache|' \
+ -e \
+ '/ham_cache/s|pop3proxy-ham-cache|${CACHEDIR}/pop3proxy-ham-cache|' \
+ -e \
+ '/unknown_cache/s|pop3proxy-unknown-cache|${CACHEDIR}/pop3proxy-unknown-cache|' \
+ ${WRKSRC}/spambayes/Options.py
post-install:
.ifndef(NOPORTDOCS)
@@ -56,5 +75,7 @@ post-install:
@${MKDIR} ${DOCSDIR}/utilities
@${INSTALL_DATA} ${WRKSRC}/utilities/* ${DOCSDIR}/utilities
.endif
+ @${MKDIR} ${CACHEDIR}
+ @${MKDIR} ${DBDIR}
.include <bsd.port.mk>
Index: pkg-plist
===================================================================
RCS file: /home/ncvs/ports/mail/py-spambayes/pkg-plist,v
retrieving revision 1.5
diff -u -p -r1.5 pkg-plist
--- pkg-plist 13 Jun 2004 22:57:46 -0000 1.5
+++ pkg-plist 26 Feb 2007 07:25:31 -0000
@@ -160,4 +160,14 @@ bin/sb_xmlrpcserver.py
%%PYTHON_SITELIBDIR%%/spambayes/tokenizer.pyo
@dirrm %%PYTHON_SITELIBDIR%%/spambayes/resources
@dirrm %%PYTHON_SITELIBDIR%%/spambayes
- at unexec rmdir %%PYTHON_SITELIBDIR%% 2>/dev/null || true
+ at cwd /
+ at exec echo mkdir -p %%CACHEDIR%%
+ at exec echo mkdir -p %%DBDIR%%
+ at dirrmtry %%CACHEDIR%%/pop3proxy-spam-cache
+ at dirrmtry %%CACHEDIR%%/pop3proxy-ham-cache
+ at dirrmtry %%CACHEDIR%%/pop3proxy-unknown-cache
+ at dirrmtry %%CACHEDIR%%
+ at dirrmtry %%DBDIR%%
+ at dirrmtry %%LOCALSTATDIR%%
+ at cwd %%PREFIX%%
+ at dirrmtry %%PYTHON_SITELIBDIR%%
Index: files/pyspamd.in
===================================================================
RCS file: files/pyspamd.in
diff -N files/pyspamd.in
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ files/pyspamd.in 26 Feb 2007 08:11:40 -0000
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+# Start or stop pyspamd
+# $FreeBSD$
+
+# PROVIDE: pyspamd
+# REQUIRE: DAEMON
+# KEYWORD: shutdown
+#
+prefix=/usr/local
+
+# Define these pyspamd_* variables in one of these files:
+# /etc/rc.conf
+# /etc/rc.conf.local
+#
+# DO NOT CHANGE THESE DEFAULT VALUES HERE
+#
+
+. /etc/rc.subr
+
+name="pyspamd"
+rcvar=`set_rcvar`
+
+load_rc_config $name
+
+: ${pyspamd_enable="NO"}
+
+command="/usr/sbin/daemon"
+command_args=" -p /var/run/pyspamd.pid /usr/local/bin/python -OO /usr/local/bin/sb_server.py 2>&1 >/dev/null"
+pidfile="/var/run/pyspamd.pid"
+procname="/usr/local/bin/python"
+
+run_rc_command "$1"
--- patch-py-spambayes.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list