aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorshaun <shaun@FreeBSD.org>2006-11-06 08:26:03 +0800
committershaun <shaun@FreeBSD.org>2006-11-06 08:26:03 +0800
commitce950d0d53731e263fd18861b3cd9545323005f0 (patch)
tree4631113b197b33067ac6fc7382d955e1848588de /mail
parent36be32c1db339f4c9bdc031fc312e83ffc76d679 (diff)
downloadfreebsd-ports-graphics-ce950d0d53731e263fd18861b3cd9545323005f0.tar.gz
freebsd-ports-graphics-ce950d0d53731e263fd18861b3cd9545323005f0.tar.zst
freebsd-ports-graphics-ce950d0d53731e263fd18861b3cd9545323005f0.zip
FuzzyOcr is a SpamAssassin plugin which uses an Optical Character
Recognition (OCR) program to scan image attachments for spammy content. It works!
Diffstat (limited to 'mail')
-rw-r--r--mail/Makefile1
-rw-r--r--mail/p5-FuzzyOcr-devel/Makefile75
-rw-r--r--mail/p5-FuzzyOcr-devel/distinfo3
-rw-r--r--mail/p5-FuzzyOcr-devel/files/pkg-message.in5
-rw-r--r--mail/p5-FuzzyOcr-devel/pkg-descr12
-rw-r--r--mail/p5-FuzzyOcr/Makefile75
-rw-r--r--mail/p5-FuzzyOcr/distinfo3
-rw-r--r--mail/p5-FuzzyOcr/files/pkg-message.in5
-rw-r--r--mail/p5-FuzzyOcr/pkg-descr12
9 files changed, 191 insertions, 0 deletions
diff --git a/mail/Makefile b/mail/Makefile
index bb569dfa9e6..71a8d0d21a2 100644
--- a/mail/Makefile
+++ b/mail/Makefile
@@ -288,6 +288,7 @@
SUBDIR += p5-Email-Simple-Creator
SUBDIR += p5-Email-Valid
SUBDIR += p5-Email-Valid-Loose
+ SUBDIR += p5-FuzzyOcr
SUBDIR += p5-IMAP-Admin
SUBDIR += p5-IMAP-Client
SUBDIR += p5-IMAP-Sieve
diff --git a/mail/p5-FuzzyOcr-devel/Makefile b/mail/p5-FuzzyOcr-devel/Makefile
new file mode 100644
index 00000000000..73ceb3f9aca
--- /dev/null
+++ b/mail/p5-FuzzyOcr-devel/Makefile
@@ -0,0 +1,75 @@
+# New ports collection makefile for: FuzzyOcr
+# Date Created: 2006-11-03
+# Whom: Shaun Amott <shaun@FreeBSD.org>
+#
+# $FreeBSD$
+#
+
+PORTNAME= FuzzyOcr
+DISTVERSION= 2.3rc1
+CATEGORIES= mail perl5
+MASTER_SITES= http://users.own-hero.net/~decoder/${PORTNAME:L}/ \
+ http://mirror.inerd.com/FreeBSD/distfiles/${PORTNAME}/
+PKGNAMEPREFIX= p5-
+DISTNAME= ${PORTNAME:L}-${DISTVERSION}
+
+MAINTAINER= shaun@FreeBSD.org
+COMMENT= Plugin for SpamAssassin which scans image attachments for spam
+
+RUN_DEPENDS= giftopnm:${PORTSDIR}/graphics/netpbm \
+ import:${PORTSDIR}/graphics/ImageMagick \
+ gocr:${PORTSDIR}/graphics/gocr \
+ gif2ps:${PORTSDIR}/graphics/libungif \
+ spamassassin:${PORTSDIR}/mail/p5-Mail-SpamAssassin \
+ ${SITE_PERL}/${PERL_ARCH}/Digest/MD5.pm:${PORTSDIR}/security/p5-Digest-MD5 \
+ ${SITE_PERL}/${PERL_ARCH}/String/Approx.pm:${PORTSDIR}/devel/p5-String-Approx
+
+USE_PERL5= yes
+NO_BUILD= yes
+
+WRKSRC= ${WRKDIR}
+
+PORTDOCS= FAQ samples
+PORTDOCS_F= FAQ samples/README samples/animated-gif.eml \
+ samples/corrupted-gif.eml samples/jpeg.eml samples/png.eml
+
+SUB_FILES= pkg-message
+
+#-----------------------------------------------------------------------
+# The plugin is installed twice: once where it should go, and once where
+# it actually works from. This will hopefully be fixed at some point.
+#-----------------------------------------------------------------------
+
+SA_PLUGINDIR?= Mail/SpamAssassin/Plugin
+SA_CONFIGDIR?= etc/mail/spamassassin
+
+PLIST_FILES= ${SA_CONFIGDIR}/FuzzyOcr.pm \
+ %%SITE_PERL%%/${SA_PLUGINDIR}/FuzzyOcr.pm \
+ %%EXAMPLESDIR%%/FuzzyOcr.cf %%EXAMPLESDIR%%/FuzzyOcr.words
+PLIST_DIRS= %%EXAMPLESDIR%%
+
+post-patch:
+ @${REINPLACE_CMD} -e 's,/usr/bin,${LOCALBASE}/bin,g' \
+ -e 's,/bin/grep,/usr/bin/grep,g' \
+ -e 's,/etc/mail,${LOCALBASE}/etc/mail,g' \
+ ${WRKSRC}/FuzzyOcr.??
+ @${REINPLACE_CMD} -e 's,$$ENV{HOME},($$ENV{HOME} ? $$ENV{HOME} : "/nonexistent"),g' \
+ ${WRKSRC}/FuzzyOcr.pm
+
+do-install:
+ @${MKDIR} ${EXAMPLESDIR}
+ ${INSTALL_DATA} ${WRKSRC}/FuzzyOcr.pm ${SITE_PERL}/${SA_PLUGINDIR}
+ ${INSTALL_DATA} ${WRKSRC}/FuzzyOcr.pm ${PREFIX}/${SA_CONFIGDIR}
+ ${INSTALL_DATA} ${WRKSRC}/FuzzyOcr.cf ${EXAMPLESDIR}
+ ${INSTALL_DATA} ${WRKSRC}/FuzzyOcr.words.sample ${EXAMPLESDIR}/FuzzyOcr.words
+
+post-install:
+.if !defined(NOPORTDOCS)
+ @${MKDIR} ${DOCSDIR}/samples
+. for f in ${PORTDOCS_F}
+ ${INSTALL_DATA} ${WRKSRC}/${f} ${DOCSDIR}/${f}
+. endfor
+.endif
+ @${CAT} ${PKGMESSAGE}
+
+.include <bsd.port.mk>
diff --git a/mail/p5-FuzzyOcr-devel/distinfo b/mail/p5-FuzzyOcr-devel/distinfo
new file mode 100644
index 00000000000..a0ae182da04
--- /dev/null
+++ b/mail/p5-FuzzyOcr-devel/distinfo
@@ -0,0 +1,3 @@
+MD5 (fuzzyocr-2.3rc1.tar.gz) = 43879c3f30045b0067d21f9e44b90697
+SHA256 (fuzzyocr-2.3rc1.tar.gz) = bdd8c3524e6445ea79968497c84a9d5e58491ccab9e05aa0784179bec8c24131
+SIZE (fuzzyocr-2.3rc1.tar.gz) = 75295
diff --git a/mail/p5-FuzzyOcr-devel/files/pkg-message.in b/mail/p5-FuzzyOcr-devel/files/pkg-message.in
new file mode 100644
index 00000000000..11e9ed3223d
--- /dev/null
+++ b/mail/p5-FuzzyOcr-devel/files/pkg-message.in
@@ -0,0 +1,5 @@
+------------------------------------------------------------------------
+ To complete the install of FuzzyOcr, copy FuzzyOcr.cf and
+ FuzzyOcr.words from %%EXAMPLESDIR%% into your
+ SpamAssassin configuration directory.
+------------------------------------------------------------------------
diff --git a/mail/p5-FuzzyOcr-devel/pkg-descr b/mail/p5-FuzzyOcr-devel/pkg-descr
new file mode 100644
index 00000000000..a7069d137cb
--- /dev/null
+++ b/mail/p5-FuzzyOcr-devel/pkg-descr
@@ -0,0 +1,12 @@
+FuzzyOcr is a plugin for SpamAssassin which scans image attachments for
+spam keywords, using an Optical Character Recognition program.
+
+This plugin can be used to detect spam that puts all the real spam
+content in an attached image. The mail itself only random text and
+random html, without any URLs or identifiable information.
+
+It is also able to do approximate matches on words, so errors in
+recognition or attempts to obfuscate the text inside the image will not
+cause the detection to fail.
+
+WWW: http://wiki.apache.org/spamassassin/FuzzyOcrPlugin
diff --git a/mail/p5-FuzzyOcr/Makefile b/mail/p5-FuzzyOcr/Makefile
new file mode 100644
index 00000000000..73ceb3f9aca
--- /dev/null
+++ b/mail/p5-FuzzyOcr/Makefile
@@ -0,0 +1,75 @@
+# New ports collection makefile for: FuzzyOcr
+# Date Created: 2006-11-03
+# Whom: Shaun Amott <shaun@FreeBSD.org>
+#
+# $FreeBSD$
+#
+
+PORTNAME= FuzzyOcr
+DISTVERSION= 2.3rc1
+CATEGORIES= mail perl5
+MASTER_SITES= http://users.own-hero.net/~decoder/${PORTNAME:L}/ \
+ http://mirror.inerd.com/FreeBSD/distfiles/${PORTNAME}/
+PKGNAMEPREFIX= p5-
+DISTNAME= ${PORTNAME:L}-${DISTVERSION}
+
+MAINTAINER= shaun@FreeBSD.org
+COMMENT= Plugin for SpamAssassin which scans image attachments for spam
+
+RUN_DEPENDS= giftopnm:${PORTSDIR}/graphics/netpbm \
+ import:${PORTSDIR}/graphics/ImageMagick \
+ gocr:${PORTSDIR}/graphics/gocr \
+ gif2ps:${PORTSDIR}/graphics/libungif \
+ spamassassin:${PORTSDIR}/mail/p5-Mail-SpamAssassin \
+ ${SITE_PERL}/${PERL_ARCH}/Digest/MD5.pm:${PORTSDIR}/security/p5-Digest-MD5 \
+ ${SITE_PERL}/${PERL_ARCH}/String/Approx.pm:${PORTSDIR}/devel/p5-String-Approx
+
+USE_PERL5= yes
+NO_BUILD= yes
+
+WRKSRC= ${WRKDIR}
+
+PORTDOCS= FAQ samples
+PORTDOCS_F= FAQ samples/README samples/animated-gif.eml \
+ samples/corrupted-gif.eml samples/jpeg.eml samples/png.eml
+
+SUB_FILES= pkg-message
+
+#-----------------------------------------------------------------------
+# The plugin is installed twice: once where it should go, and once where
+# it actually works from. This will hopefully be fixed at some point.
+#-----------------------------------------------------------------------
+
+SA_PLUGINDIR?= Mail/SpamAssassin/Plugin
+SA_CONFIGDIR?= etc/mail/spamassassin
+
+PLIST_FILES= ${SA_CONFIGDIR}/FuzzyOcr.pm \
+ %%SITE_PERL%%/${SA_PLUGINDIR}/FuzzyOcr.pm \
+ %%EXAMPLESDIR%%/FuzzyOcr.cf %%EXAMPLESDIR%%/FuzzyOcr.words
+PLIST_DIRS= %%EXAMPLESDIR%%
+
+post-patch:
+ @${REINPLACE_CMD} -e 's,/usr/bin,${LOCALBASE}/bin,g' \
+ -e 's,/bin/grep,/usr/bin/grep,g' \
+ -e 's,/etc/mail,${LOCALBASE}/etc/mail,g' \
+ ${WRKSRC}/FuzzyOcr.??
+ @${REINPLACE_CMD} -e 's,$$ENV{HOME},($$ENV{HOME} ? $$ENV{HOME} : "/nonexistent"),g' \
+ ${WRKSRC}/FuzzyOcr.pm
+
+do-install:
+ @${MKDIR} ${EXAMPLESDIR}
+ ${INSTALL_DATA} ${WRKSRC}/FuzzyOcr.pm ${SITE_PERL}/${SA_PLUGINDIR}
+ ${INSTALL_DATA} ${WRKSRC}/FuzzyOcr.pm ${PREFIX}/${SA_CONFIGDIR}
+ ${INSTALL_DATA} ${WRKSRC}/FuzzyOcr.cf ${EXAMPLESDIR}
+ ${INSTALL_DATA} ${WRKSRC}/FuzzyOcr.words.sample ${EXAMPLESDIR}/FuzzyOcr.words
+
+post-install:
+.if !defined(NOPORTDOCS)
+ @${MKDIR} ${DOCSDIR}/samples
+. for f in ${PORTDOCS_F}
+ ${INSTALL_DATA} ${WRKSRC}/${f} ${DOCSDIR}/${f}
+. endfor
+.endif
+ @${CAT} ${PKGMESSAGE}
+
+.include <bsd.port.mk>
diff --git a/mail/p5-FuzzyOcr/distinfo b/mail/p5-FuzzyOcr/distinfo
new file mode 100644
index 00000000000..a0ae182da04
--- /dev/null
+++ b/mail/p5-FuzzyOcr/distinfo
@@ -0,0 +1,3 @@
+MD5 (fuzzyocr-2.3rc1.tar.gz) = 43879c3f30045b0067d21f9e44b90697
+SHA256 (fuzzyocr-2.3rc1.tar.gz) = bdd8c3524e6445ea79968497c84a9d5e58491ccab9e05aa0784179bec8c24131
+SIZE (fuzzyocr-2.3rc1.tar.gz) = 75295
diff --git a/mail/p5-FuzzyOcr/files/pkg-message.in b/mail/p5-FuzzyOcr/files/pkg-message.in
new file mode 100644
index 00000000000..11e9ed3223d
--- /dev/null
+++ b/mail/p5-FuzzyOcr/files/pkg-message.in
@@ -0,0 +1,5 @@
+------------------------------------------------------------------------
+ To complete the install of FuzzyOcr, copy FuzzyOcr.cf and
+ FuzzyOcr.words from %%EXAMPLESDIR%% into your
+ SpamAssassin configuration directory.
+------------------------------------------------------------------------
diff --git a/mail/p5-FuzzyOcr/pkg-descr b/mail/p5-FuzzyOcr/pkg-descr
new file mode 100644
index 00000000000..a7069d137cb
--- /dev/null
+++ b/mail/p5-FuzzyOcr/pkg-descr
@@ -0,0 +1,12 @@
+FuzzyOcr is a plugin for SpamAssassin which scans image attachments for
+spam keywords, using an Optical Character Recognition program.
+
+This plugin can be used to detect spam that puts all the real spam
+content in an attached image. The mail itself only random text and
+random html, without any URLs or identifiable information.
+
+It is also able to do approximate matches on words, so errors in
+recognition or attempts to obfuscate the text inside the image will not
+cause the detection to fail.
+
+WWW: http://wiki.apache.org/spamassassin/FuzzyOcrPlugin