From 4a4892cbdbb1dc980f51f1b05281e74ba0002924 Mon Sep 17 00:00:00 2001 From: Wesley Shields Date: Sun, 17 Apr 2011 13:34:01 +0000 Subject: Add option for NAMAZU2, off by default so no PORTREVISION bump. PR: portts/156296 Submitted by: TAKATSU Tomonari --- mail/mailman/Makefile | 13 ++++++++-- .../files/extra-patch-Mailman-Cgi-private.py | 30 ++++++++++++++++++++++ mail/mailman/files/pkg-message.in | 8 ++++++ 3 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 mail/mailman/files/extra-patch-Mailman-Cgi-private.py diff --git a/mail/mailman/Makefile b/mail/mailman/Makefile index fc53bfb1d3fb..4297247cfcda 100644 --- a/mail/mailman/Makefile +++ b/mail/mailman/Makefile @@ -7,7 +7,6 @@ PORTNAME= mailman DISTVERSION= 2.1.14 -PORTREVISION= 1 CATEGORIES?= mail MASTER_SITES= ${MASTER_SITE_GNU} \ SF/${PORTNAME}/Mailman%202.1%20%28stable%29/${PORTVERSION} @@ -24,7 +23,8 @@ OPTIONS= SENDMAIL "for use with sendmail" off \ POSTFIX "for use with postfix" off \ COURIER "for use with courier" off \ CHINESE "support for Chinese mailing lists" off \ - HTDIG "htdig integration patches" off + HTDIG "htdig integration patches" off \ + NAMAZU2 "make private archives searchable with namazu2" off HAS_CONFIGURE= yes USE_PYTHON= yes @@ -124,6 +124,15 @@ PLIST_SUB+= SUB_HTDIG="" PLIST_SUB+= SUB_HTDIG="@comment " .endif +.if defined(WITH_NAMAZU2) +.if defined(PKGNAMEPREFIX) && ${PKGNAMEPREFIX} == "ja-" +RUN_DEPENDS+= mknmz:${PORTSDIR}/japanese/namazu2 +.else +RUN_DEPENDS+= mknmz:${PORTSDIR}/databases/namazu2 +.endif +EXTRA_PATCHES+= ${FILESDIR}/extra-patch-Mailman-Cgi-private.py +.endif + pre-fetch: @${ECHO} "" @${ECHO} "You may change the following build options:" diff --git a/mail/mailman/files/extra-patch-Mailman-Cgi-private.py b/mail/mailman/files/extra-patch-Mailman-Cgi-private.py new file mode 100644 index 000000000000..2f6632f2c9c7 --- /dev/null +++ b/mail/mailman/files/extra-patch-Mailman-Cgi-private.py @@ -0,0 +1,30 @@ +--- Mailman/Cgi/private.py.orig 2010-09-21 03:18:27.000000000 +0900 ++++ Mailman/Cgi/private.py 2011-04-08 22:28:09.000000000 +0900 +@@ -116,6 +116,7 @@ + + i18n.set_language(mlist.preferred_language) + doc.set_language(mlist.preferred_language) ++ is_cgi = 0 + + cgidata = cgi.FieldStorage() + username = cgidata.getvalue('username', '') +@@ -179,6 +180,10 @@ + elif true_filename.endswith('.gz'): + import gzip + f = gzip.open(true_filename, 'r') ++ elif true_filename.endswith('namazu.cgi'): ++ os.putenv('SCRIPT_NAME', 'namazu.cgi') ++ f = os.popen(true_filename, 'r') ++ is_cgi = 1 + else: + f = open(true_filename, 'r') + except IOError: +@@ -188,6 +193,7 @@ + print doc.Format() + syslog('error', 'Private archive file not found: %s', true_filename) + else: +- print 'Content-type: %s\n' % ctype ++ if not is_cgi: ++ print 'Content-type: %s\n' % ctype + sys.stdout.write(f.read()) + f.close() diff --git a/mail/mailman/files/pkg-message.in b/mail/mailman/files/pkg-message.in index 0b34fa0faba5..8c6f6452f90a 100644 --- a/mail/mailman/files/pkg-message.in +++ b/mail/mailman/files/pkg-message.in @@ -18,4 +18,12 @@ installed in %%MAILMANDIR%%/bin Note (3): As of version 2.1, Mailman's queue runner runs as a daemon and is started by a script in %%LOCALBASE%%/etc/rc.d + +In order to make private archives searchable with namazu2, you need copy +or link %%LOCALBASE%%/libexec/namazu.cgi to +MAILMANDIR%%/archives/private// and configure .namazurc +to refer to %%LOCALBASE%%/etc/namazu/namazu-sample. +See also +http://www.python.jp/pipermail/mailman-users-jp/2004-August/001008.html +written in Japanese. ---------------------------------------------------------------------------- -- cgit v1.2.3