aboutsummaryrefslogtreecommitdiffstats
path: root/mail/spamprobe/files
diff options
context:
space:
mode:
authormi <mi@FreeBSD.org>2002-10-09 07:48:39 +0800
committermi <mi@FreeBSD.org>2002-10-09 07:48:39 +0800
commitceb61ada23922a2eee9c87d62220498ef4d88e1f (patch)
treeb13f2c9b818750ab753f60783efe48657c115cda /mail/spamprobe/files
parent44b8a55a9844df35ead32064f9a7028d3c92449c (diff)
downloadfreebsd-ports-gnome-ceb61ada23922a2eee9c87d62220498ef4d88e1f.tar.gz
freebsd-ports-gnome-ceb61ada23922a2eee9c87d62220498ef4d88e1f.tar.zst
freebsd-ports-gnome-ceb61ada23922a2eee9c87d62220498ef4d88e1f.zip
Update to 0.7c. Respect C(XX)FLAGS. The new version uses md5 checksums
to identify messages -- force it to use our -lmd instead of letting it install the N+1st implementation. Use the tiny piece of sprint(3) to convert the 16-byte digest into the printable 32-char string (the wisdom of storing such a string instead of the raw digest discussed with the author already). Don't copy the manpage from FILESDIR -- compress and/or install it directly from FILESDIR. Approved by: maintainer timeout
Diffstat (limited to 'mail/spamprobe/files')
-rw-r--r--mail/spamprobe/files/Makefile7
-rw-r--r--mail/spamprobe/files/Makefile.export0_64
-rw-r--r--mail/spamprobe/files/patch-md576
3 files changed, 83 insertions, 4 deletions
diff --git a/mail/spamprobe/files/Makefile b/mail/spamprobe/files/Makefile
index 17359d61f663..315e8ca48952 100644
--- a/mail/spamprobe/files/Makefile
+++ b/mail/spamprobe/files/Makefile
@@ -1,11 +1,14 @@
# $FreeBSD$
#
+
+.PATH: ${FILESDIR}
+
PREFIX?= /usr/local
BINDIR= ${PREFIX}/bin
MANDIR= ${PREFIX}/man/man
PROG_CXX= spamprobe
-CXXFLAGS= -Wall -DUSE_DB -I${PREFIX}/include/db3
-LDFLAGS= -L${PREFIX}/lib -ldb3
+CXXFLAGS+= -Wall -DUSE_DB -I${PREFIX}/include/db3
+LDFLAGS= -L${PREFIX}/lib -ldb3 -lmd
SRCS= File.cc FrequencyDB.cc FrequencyDBImpl_bdb.cc \
FrequencyDBImpl_cache.cc FrequencyDBImpl_dbm.cc LockFile.cc \
Message.cc MessageFactory.cc MimeHeader.cc MimeLineReader.cc \
diff --git a/mail/spamprobe/files/Makefile.export0_6 b/mail/spamprobe/files/Makefile.export0_6
index 3e65e3a48633..bbd5cfd126d4 100644
--- a/mail/spamprobe/files/Makefile.export0_6
+++ b/mail/spamprobe/files/Makefile.export0_6
@@ -1,10 +1,10 @@
-# $FreeBSD: /tmp/pcvs/ports/mail/spamprobe/files/Attic/Makefile.export0_6,v 1.1 2002-09-16 19:36:22 mdodd Exp $
+# $FreeBSD: /tmp/pcvs/ports/mail/spamprobe/files/Attic/Makefile.export0_6,v 1.2 2002-10-08 23:48:39 mi Exp $
#
PREFIX?= /usr/local
BINDIR= ${PREFIX}/bin
NOMAN=
PROG_CXX= spamprobe-export_0.6
-CXXFLAGS= -Wall -DUSE_DBM
+CXXFLAGS+= -Wall -DUSE_DBM
SRCS= File.cc export0_6.cc
.include <bsd.prog.mk>
diff --git a/mail/spamprobe/files/patch-md5 b/mail/spamprobe/files/patch-md5
new file mode 100644
index 000000000000..8ae1e7847c8b
--- /dev/null
+++ b/mail/spamprobe/files/patch-md5
@@ -0,0 +1,76 @@
+--- MimeMessageReader.h Thu Sep 19 12:15:38 2002
++++ MimeMessageReader.h Wed Sep 25 09:19:55 2002
+@@ -34,4 +34,7 @@
+ #include "MimeHeader.h"
++#include <sys/types.h>
++#include <md5.h>
++#define MD5_DIGEST_LENGTH 16
+
+-class md5_state_s;
++typedef unsigned char md5_digest_t[MD5_DIGEST_LENGTH*2 + 1];
+
+@@ -64,3 +65,3 @@
+
+- const string &getMD5Digest();
++ const md5_digest_t &getMD5Digest();
+
+@@ -105,4 +106,4 @@
+ vector<MimeHeader> m_headers;
+- string m_md5digest;
+- NewPtr<md5_state_s> m_md5state;
++ md5_digest_t m_md5digest;
++ NewPtr<MD5_CTX> m_md5state;
+ };
+--- MimeMessageReader.cc Thu Sep 19 12:15:38 2002
++++ MimeMessageReader.cc Wed Sep 25 22:56:17 2002
+@@ -30,4 +30,5 @@
+
+-#include <cstdio>
+-#include "md5.h"
++#include <sys/types.h>
++#include <md5.h>
++#define MD5_DIGEST_LENGTH 16
+ #include "util.h"
+@@ -93,4 +92,4 @@
+
+- m_md5state.set(new md5_state_s);
+- md5_init(m_md5state.get());
++ m_md5state.set(new MD5_CTX);
++ MD5Init(m_md5state.get());
+
+@@ -140,3 +139,3 @@
+ }
+- md5_append(m_md5state.get(), (md5_byte_t *)value.data(), value.length());
++ MD5Update(m_md5state.get(), (const unsigned char *)value.data(), value.length());
+ }
+@@ -228,3 +227,3 @@
+
+-const string &MimeMessageReader::getMD5Digest()
++const md5_digest_t &MimeMessageReader::getMD5Digest()
+ {
+@@ -236,11 +235,10 @@
+
+- m_md5digest.erase();
+-
+- md5_byte_t raw_digest[32];
+- char hexcode[8];
+- md5_finish(m_md5state.get(), raw_digest);
+- for (int i = 0; i < 16; ++i) {
+- sprintf(hexcode, "%02x", (unsigned)raw_digest[i]);
+- m_md5digest += hexcode;
++ MD5Final(m_md5digest + MD5_DIGEST_LENGTH + 1, m_md5state.get());
++ for (int i = 0; i < MD5_DIGEST_LENGTH; i++) {
++ char hexdigits[] = "0123456789abcdef";
++ m_md5digest[i*2] = hexdigits[m_md5digest[i + MD5_DIGEST_LENGTH + 1] >> 4];
++ m_md5digest[i*2 + 1] =
++ hexdigits[m_md5digest[i + MD5_DIGEST_LENGTH + 1] & 0x0f];
+ }
++ m_md5digest[MD5_DIGEST_LENGTH*2 + 1] = '\0';
+ m_md5state.clear();
+--- MessageFactory.cc Tue Sep 17 17:39:36 2002
++++ MessageFactory.cc Tue Oct 8 18:59:07 2002
+@@ -127,3 +127,3 @@
+
+- msg.setDigest(reader.getMD5Digest());
++ msg.setDigest((char *)reader.getMD5Digest());
+