summaryrefslogtreecommitdiff
path: root/mail/ezmlm
diff options
context:
space:
mode:
authorschmonz <schmonz>2004-12-21 04:22:03 +0000
committerschmonz <schmonz>2004-12-21 04:22:03 +0000
commit79f854b89597a45115e942d86fb2eef31d6df845 (patch)
treed4d058b983b648cc51e29311734bd257d252c810 /mail/ezmlm
parent7d2c9a3498d59ca7aeb2e8dd8957033cd51849b5 (diff)
downloadpkgsrc-79f854b89597a45115e942d86fb2eef31d6df845.tar.gz
With the "althash" option, enable Iain Truskett's 2002-10-16 patch
to hash the on-disk subscriber database using an algorithm compatible with case-insensitive filesystems. Enabled by default on Darwin. Bump PKGREVISION.
Diffstat (limited to 'mail/ezmlm')
-rw-r--r--mail/ezmlm/Makefile6
-rw-r--r--mail/ezmlm/files/patch-althash78
-rw-r--r--mail/ezmlm/options.mk17
3 files changed, 100 insertions, 1 deletions
diff --git a/mail/ezmlm/Makefile b/mail/ezmlm/Makefile
index 453e5bf921e..50debc56150 100644
--- a/mail/ezmlm/Makefile
+++ b/mail/ezmlm/Makefile
@@ -1,9 +1,10 @@
-# $NetBSD: Makefile,v 1.12 2004/07/21 22:58:10 schmonz Exp $
+# $NetBSD: Makefile,v 1.13 2004/12/21 04:22:03 schmonz Exp $
#
.include "../../mail/ezmlm/Makefile.common"
DISTNAME= ${EZMLM_VERS}
+PKGREVISION= 1
MAINTAINER= schmonz@NetBSD.org
HOMEPAGE= http://cr.yp.to/ezmlm.html
@@ -23,6 +24,9 @@ NO_BIN_ON_FTP= ${RESTRICTED}
INSTALLATION_DIRS= bin man man/man1 man/man5 man/cat1 man/cat5
+.include "../../mk/bsd.prefs.mk"
+.include "options.mk"
+
.include "../../mk/compiler.mk"
.if !empty(CC_VERSION:Mgcc-*)
diff --git a/mail/ezmlm/files/patch-althash b/mail/ezmlm/files/patch-althash
new file mode 100644
index 00000000000..b0565418c1f
--- /dev/null
+++ b/mail/ezmlm/files/patch-althash
@@ -0,0 +1,78 @@
+Attached below are diffs. They convert the hashing to do:
+ '@'..'Z'
+
+It's not that great as a hashing algorithm since you end up with a
+non-prime number that's reasonably close to a power of 2 for your number
+of buckets, but hey.
+
+It's possible one other place (in constmap) needs to be changed. DJB's
+code scares me in its lack of constants and lack of subroutines to
+factor away similar bits of code.
+
+Test it and see if it works.
+
+
+cheers,
+--
+Iain.
+
+
+--- ezmlm-list.c.orig 1997-06-29 23:11:54.000000000 -0400
++++ ezmlm-list.c
+@@ -36,7 +36,7 @@ char **argv;
+ if (chdir(dir) == -1)
+ strerr_die4sys(111,FATAL,"unable to switch to ",dir,": ");
+
+- for (fn[12] = 64;fn[12] < 64 + 53;++fn[12]) {
++ for (fn[12] = 64;fn[12] < 64 + 27;++fn[12]) {
+ fd = open_read(fn);
+ if (fd == -1) {
+ if (errno != error_noent)
+--- ezmlm-send.c.orig 1997-06-29 23:11:54.000000000 -0400
++++ ezmlm-send.c
+@@ -288,7 +288,7 @@ char **argv;
+
+ qmail_from(&qq,line.s);
+
+- for (i = 0;i < 53;++i) {
++ for (i = 0;i < 27;++i) {
+ ch = 64 + i;
+ if (!stralloc_copys(&fnsub,"subscribers/")) die_nomem();
+ if (!stralloc_catb(&fnsub,&ch,1)) strerr_die2x(111,FATAL,"out of memory");
+--- ezmlm.5.orig 1997-06-29 23:11:54.000000000 -0400
++++ ezmlm.5
+@@ -30,10 +30,10 @@ allows automatic subscription if
+ .I dir\fB/public
+ exists.
+
+-The list is hashed into 53 files, named
++The list is hashed into 27 files, named
+ .B @
+ through
+-.B t
++.B Z
+ in ASCII.
+ A nonexistent file is treated as an empty file.
+
+--- issub.c.orig 1997-06-29 23:11:54.000000000 -0400
++++ issub.c
+@@ -35,7 +35,7 @@ char *userhost;
+ h = 5381;
+ for (j = 0;j < addr.len;++j)
+ h = (h + (h << 5)) ^ (uint32) (unsigned char) addr.s[j];
+- ch = 64 + (h % 53);
++ ch = 64 + (h % 27);
+
+ if (!stralloc_0(&addr)) return -2;
+
+--- subscribe.c.orig 1997-06-29 23:11:54.000000000 -0400
++++ subscribe.c
+@@ -45,7 +45,7 @@ int flagadd;
+ h = 5381;
+ for (j = 0;j < addr.len;++j)
+ h = (h + (h << 5)) ^ (uint32) (unsigned char) addr.s[j];
+- ch = 64 + (h % 53);
++ ch = 64 + (h % 27);
+
+ if (!stralloc_0(&addr)) return -2;
+
diff --git a/mail/ezmlm/options.mk b/mail/ezmlm/options.mk
new file mode 100644
index 00000000000..77df65526be
--- /dev/null
+++ b/mail/ezmlm/options.mk
@@ -0,0 +1,17 @@
+# $NetBSD: options.mk,v 1.1 2004/12/21 04:22:03 schmonz Exp $
+
+.if ${OPSYS} == "Darwin"
+PKG_DEFAULT_OPTIONS+= althash
+.endif
+
+PKG_OPTIONS_VAR= PKG_OPTIONS.ezmlm
+PKG_SUPPORTED_OPTIONS= althash
+.include "../../mk/bsd.options.mk"
+
+###
+### alternate subscriber hashing scheme for case-insensitive filesystems
+###
+.if !empty(PKG_OPTIONS:Malthash)
+post-patch:
+ @cd ${WRKSRC} && ${PATCH} ${PATCH_ARGS} < ${FILESDIR}/patch-althash
+.endif