aboutsummaryrefslogtreecommitdiffstats
path: root/mail/p5-FuzzyOcr-devel
diff options
context:
space:
mode:
authormiwi <miwi@FreeBSD.org>2009-05-31 02:46:09 +0800
committermiwi <miwi@FreeBSD.org>2009-05-31 02:46:09 +0800
commit10456dceeb9015652ce278fa1eb6ba51e73ef9ea (patch)
tree75aecf0a0c27f6565dd60e46201af2f2b939d7fa /mail/p5-FuzzyOcr-devel
parentf00da43a0fac324a91b613892dcf01055916c315 (diff)
downloadfreebsd-ports-gnome-10456dceeb9015652ce278fa1eb6ba51e73ef9ea.tar.gz
freebsd-ports-gnome-10456dceeb9015652ce278fa1eb6ba51e73ef9ea.tar.zst
freebsd-ports-gnome-10456dceeb9015652ce278fa1eb6ba51e73ef9ea.zip
- Update to 3.6.0
PR: 135065 Submitted by: ismail yenigul <ismail.yenigul@endersys.com.tr>
Diffstat (limited to 'mail/p5-FuzzyOcr-devel')
-rw-r--r--mail/p5-FuzzyOcr-devel/Makefile66
-rw-r--r--mail/p5-FuzzyOcr-devel/distinfo6
-rw-r--r--mail/p5-FuzzyOcr-devel/files/patch-FuzzyOcr.cf130
-rw-r--r--mail/p5-FuzzyOcr-devel/files/patch-FuzzyOcr.preps18
-rw-r--r--mail/p5-FuzzyOcr-devel/files/patch-FuzzyOcr.scansets19
-rw-r--r--mail/p5-FuzzyOcr-devel/files/pkg-message.in4
-rw-r--r--mail/p5-FuzzyOcr-devel/pkg-descr2
7 files changed, 211 insertions, 34 deletions
diff --git a/mail/p5-FuzzyOcr-devel/Makefile b/mail/p5-FuzzyOcr-devel/Makefile
index 3d5a66c268b4..dfce7286cb81 100644
--- a/mail/p5-FuzzyOcr-devel/Makefile
+++ b/mail/p5-FuzzyOcr-devel/Makefile
@@ -6,14 +6,12 @@
#
PORTNAME= FuzzyOcr
-DISTVERSION= 3.4.2
-PORTREVISION= 2
+DISTVERSION= 3.6.0
CATEGORIES= mail perl5
MASTER_SITES= http://users.own-hero.net/~decoder/${PORTNAME:L}/ \
http://mirror.inerd.com/FreeBSD/distfiles/${PORTNAME}/
PKGNAMEPREFIX= p5-
-PKGNAMESUFFIX= -devel
-DISTNAME= ${PORTNAME:L}-${DISTVERSION}${PKGNAMESUFFIX}
+DISTNAME= ${PORTNAME:L}-${DISTVERSION}
MAINTAINER= ports@FreeBSD.org
COMMENT= Plugin for SpamAssassin which scans image attachments for spam
@@ -21,24 +19,23 @@ COMMENT= Plugin for SpamAssassin which scans image attachments for spam
RUN_DEPENDS= giftopnm:${PORTSDIR}/graphics/netpbm \
gifsicle:${PORTSDIR}/graphics/gifsicle \
gocr:${PORTSDIR}/graphics/gocr \
+ ocrad:${PORTSDIR}/graphics/ocrad \
gif2ps:${PORTSDIR}/graphics/libungif \
spamassassin:${PORTSDIR}/mail/p5-Mail-SpamAssassin \
${SITE_PERL}/MLDBM.pm:${PORTSDIR}/databases/p5-MLDBM \
+ ${SITE_PERL}/${PERL_ARCH}/Time/HiRes.pm:${PORTSDIR}/devel/p5-Time-HiRes \
+ ${SITE_PERL}/MLDBM/Sync.pm:${PORTSDIR}/databases/p5-MLDBM-Sync \
${SITE_PERL}/${PERL_ARCH}/String/Approx.pm:${PORTSDIR}/devel/p5-String-Approx
-CONFLICTS= p5-FuzzyOcr-[0-9]*
-
-OPTIONS= OCRAD "Include optional ocrad scanning engine" off
-
USE_PERL5= yes
NO_BUILD= yes
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
-PORTDOCS= FAQ samples
-PORTDOCS_F= FAQ samples/README samples/animated-gif.eml \
- samples/corrupted-gif.eml samples/jpeg.eml samples/png.eml \
- samples/ocr-animated.eml
+PORTDOCS= samples
+PORTDOCS_F= samples/README samples/ocr-animated.eml \
+ samples/ocr-gif.eml samples/ocr-jpg.eml samples/ocr-multi.eml \
+ samples/ocr-obfuscated.eml samples/ocr-png.eml samples/ocr-wrongext.eml
SUB_FILES= pkg-message
@@ -46,36 +43,49 @@ SA_PLUGINDIR?= Mail/SpamAssassin/Plugin
SA_CONFIGDIR?= etc/mail/spamassassin
PLIST_FILES= %%SITE_PERL%%/${SA_PLUGINDIR}/FuzzyOcr.pm \
- %%EXAMPLESDIR%%/FuzzyOcr.cf %%EXAMPLESDIR%%/FuzzyOcr.words
-PLIST_DIRS= %%EXAMPLESDIR%%
+ %%SITE_PERL%%/${SA_PLUGINDIR}/FuzzyOcr/Config.pm \
+ %%SITE_PERL%%/${SA_PLUGINDIR}/FuzzyOcr/Deanimate.pm \
+ %%SITE_PERL%%/${SA_PLUGINDIR}/FuzzyOcr/Hashing.pm \
+ %%SITE_PERL%%/${SA_PLUGINDIR}/FuzzyOcr/Logging.pm \
+ %%SITE_PERL%%/${SA_PLUGINDIR}/FuzzyOcr/Misc.pm \
+ %%SITE_PERL%%/${SA_PLUGINDIR}/FuzzyOcr/Preprocessor.pm \
+ %%SITE_PERL%%/${SA_PLUGINDIR}/FuzzyOcr/Scanset.pm \
+ %%SITE_PERL%%/${SA_PLUGINDIR}/FuzzyOcr/Scoring.pm \
+ %%EXAMPLESDIR%%/FuzzyOcr.cf %%EXAMPLESDIR%%/FuzzyOcr.words %%EXAMPLESDIR%%/FuzzyOcr.scansets \
+ %%EXAMPLESDIR%%/FuzzyOcr.preps %%EXAMPLESDIR%%/FuzzyOcr.mysql
+PLIST_DIRS= %%EXAMPLESDIR%% %%SITE_PERL%%/${SA_PLUGINDIR}/FuzzyOcr
.include <bsd.port.pre.mk>
-.if defined(WITH_OCRAD)
-RUN_DEPENDS+= ocrad:${PORTSDIR}/graphics/ocrad
-.endif
+#.if defined(WITH_OCRAD)
+#RUN_DEPENDS+= ocrad:${PORTSDIR}/graphics/ocrad
+#.endif
pre-everything::
- @${ECHO_MSG} "+------------------------------------------------------------+"
- @${ECHO_MSG} "| |"
- @${ECHO_MSG} "| Warning: FuzzyOcr now requires SpamAssassin 3.1.4 or above |"
- @${ECHO_MSG} "| |"
- @${ECHO_MSG} "+------------------------------------------------------------+"
+ @${ECHO_MSG} "+---------------------------------------------------+"
+ @${ECHO_MSG} "| |"
+ @${ECHO_MSG} "| Warning: FuzzyOcr now requires SpamAssassin 3.2.X |"
+ @${ECHO_MSG} "| |"
+ @${ECHO_MSG} "+---------------------------------------------------+"
post-patch:
@${REINPLACE_CMD} -e 's,/usr/bin,${LOCALBASE}/bin,g' \
-e 's,/etc/mail,${LOCALBASE}/etc/mail,g' \
- ${WRKSRC}/FuzzyOcr.??
- @${REINPLACE_CMD} -e 's,package FuzzyOcr;,package Mail::SpamAssassin::Plugin::FuzzyOcr;,' \
+ ${WRKSRC}/FuzzyOcr.?? ${WRKSRC}/FuzzyOcr/Config.pm
+ @${REINPLACE_CMD} -e 's,FuzzyOcr::,Mail::SpamAssassin::Plugin::FuzzyOcr::,' \
+ ${WRKSRC}/FuzzyOcr.pm ${WRKSRC}/FuzzyOcr/*.pm
+ @${REINPLACE_CMD} -e 's,FuzzyOcr;,Mail::SpamAssassin::Plugin::FuzzyOcr;,' \
${WRKSRC}/FuzzyOcr.pm
- @${REINPLACE_CMD} -e 's,loadplugin FuzzyOcr FuzzyOcr\.pm,loadplugin Mail::SpamAssassin::Plugin::FuzzyOcr,' \
- ${WRKSRC}/FuzzyOcr.cf
do-install:
- @${MKDIR} ${EXAMPLESDIR}
+ @${MKDIR} ${EXAMPLESDIR} ${SITE_PERL}/${SA_PLUGINDIR}/FuzzyOcr
${INSTALL_DATA} ${WRKSRC}/FuzzyOcr.pm ${SITE_PERL}/${SA_PLUGINDIR}
+ ${INSTALL_DATA} ${WRKSRC}/FuzzyOcr/*.pm ${SITE_PERL}/${SA_PLUGINDIR}/FuzzyOcr
${INSTALL_DATA} ${WRKSRC}/FuzzyOcr.cf ${EXAMPLESDIR}
- ${INSTALL_DATA} ${WRKSRC}/FuzzyOcr.words.sample ${EXAMPLESDIR}/FuzzyOcr.words
+ ${INSTALL_DATA} ${WRKSRC}/FuzzyOcr.words ${EXAMPLESDIR}/FuzzyOcr.words
+ ${INSTALL_DATA} ${WRKSRC}/FuzzyOcr.scansets ${EXAMPLESDIR}/FuzzyOcr.scansets
+ ${INSTALL_DATA} ${WRKSRC}/FuzzyOcr.preps ${EXAMPLESDIR}/FuzzyOcr.preps
+ ${INSTALL_DATA} ${WRKSRC}/FuzzyOcr.mysql ${EXAMPLESDIR}/FuzzyOcr.mysql
post-install:
.if !defined(NOPORTDOCS)
diff --git a/mail/p5-FuzzyOcr-devel/distinfo b/mail/p5-FuzzyOcr-devel/distinfo
index 2623a2a4160c..fe0659c190ac 100644
--- a/mail/p5-FuzzyOcr-devel/distinfo
+++ b/mail/p5-FuzzyOcr-devel/distinfo
@@ -1,3 +1,3 @@
-MD5 (fuzzyocr-3.4.2-devel.tar.gz) = 2ad9c42ef44ba621190402f5060dde4f
-SHA256 (fuzzyocr-3.4.2-devel.tar.gz) = 0f50fabf5b149a08d6c4bc98aaa4682fdfdb7fc223e0eb4c45f784a2635a9a4b
-SIZE (fuzzyocr-3.4.2-devel.tar.gz) = 89505
+MD5 (fuzzyocr-3.6.0.tar.gz) = d434a339fb0bb5cc9120772325908df5
+SHA256 (fuzzyocr-3.6.0.tar.gz) = dd345c9500c3c3cdc33503863fe234bf3c2720c54b303e6cbc94dbe8aaf3a218
+SIZE (fuzzyocr-3.6.0.tar.gz) = 127103
diff --git a/mail/p5-FuzzyOcr-devel/files/patch-FuzzyOcr.cf b/mail/p5-FuzzyOcr-devel/files/patch-FuzzyOcr.cf
new file mode 100644
index 000000000000..f67bce570a0f
--- /dev/null
+++ b/mail/p5-FuzzyOcr-devel/files/patch-FuzzyOcr.cf
@@ -0,0 +1,130 @@
+--- FuzzyOcr.cf.orig 2009-05-29 23:10:39.000000000 +0300
++++ FuzzyOcr.cf 2009-05-29 23:21:13.000000000 +0300
+@@ -1,7 +1,7 @@
+ # Syntax:
+ # loadplugin <Plugin_Name> <Location>
+ # <Location> path where Plugin resides.
+-loadplugin FuzzyOcr FuzzyOcr.pm
++loadplugin Mail::SpamAssassin::Plugin::FuzzyOcr
+
+ body FUZZY_OCR eval:fuzzyocr_check()
+ body FUZZY_OCR_WRONG_CTYPE eval:dummy_check()
+@@ -50,8 +50,8 @@
+ ###
+
+ # Here we defined the words to scan for
+-# Default value: /etc/mail/spamassassin/FuzzyOcr.words
+-#focr_global_wordlist /etc/mail/spamassassin/FuzzyOcr.words
++# Default value: /usr/local/etc/mail/spamassassin/FuzzyOcr.words
++#focr_global_wordlist /usr/local/etc/mail/spamassassin/FuzzyOcr.words
+ #
+ # This is the path RELATIVE to the respective home directory
+ # for the personalized list. This list is merged with the global
+@@ -96,7 +96,7 @@
+
+ # Include additional scanner/preprocessor commands here:
+ #
+-focr_bin_helper pnmnorm, pnminvert, pamthreshold, ppmtopgm, pamtopnm
++focr_bin_helper pnmnorm, pnminvert, pamditherbw, ppmtopgm, pamtopnm
+ focr_bin_helper tesseract
+
+ # These helpers must be defined before enabling PDF scanning
+@@ -109,7 +109,7 @@
+ ###
+
+ # Search path for locating helper applications
+-#focr_path_bin /usr/local/netpbm/bin:/usr/local/bin:/usr/bin
++#focr_path_bin /usr/local/netpbm/bin:/usr/local/bin:/usr/local/bin
+
+ ###
+ ### Step 3:
+@@ -117,25 +117,25 @@
+ ### the search path algorithm. Please note that if the helper app is not
+ ### previously defined, it will generate an error:
+
+-#focr_bin_gifsicle /usr/bin/gifsicle
+-#focr_bin_giffix /usr/bin/giffix
+-#focr_bin_giftext /usr/bin/giftext
+-#focr_bin_gifinter /usr/bin/gifinter
+-#focr_bin_giftopnm /usr/bin/giftopnm
+-#focr_bin_jpegtopnm /usr/bin/jpegtopnm
+-#focr_bin_pngtopnm /usr/bin/pngtopnm
+-#focr_bin_bmptopnm /usr/bin/bmptopnm
+-#focr_bin_tifftopnm /usr/bin/tifftopnm
+-#focr_bin_ppmhist /usr/bin/ppmhist
+-#focr_bin_gocr /usr/bin/gocr
+-#focr_bin_ocrad /usr/bin/ocrad
+-
+-#focr_bin_pnmnorm /usr/bin/pnmnorm
+-#focr_bin_pnminvert /usr/bin/pnminvert
+-
+-#focr_bin_pdfinfo /usr/bin/pdfinfo
+-#focr_bin_pdftops /usr/bin/pdftops
+-#focr_bin_pstopnm /usr/bin/pstopnm
++#focr_bin_gifsicle /usr/local/bin/gifsicle
++#focr_bin_giffix /usr/local/bin/giffix
++#focr_bin_giftext /usr/local/bin/giftext
++#focr_bin_gifinter /usr/local/bin/gifinter
++#focr_bin_giftopnm /usr/local/bin/giftopnm
++#focr_bin_jpegtopnm /usr/local/bin/jpegtopnm
++#focr_bin_pngtopnm /usr/local/bin/pngtopnm
++#focr_bin_bmptopnm /usr/local/bin/bmptopnm
++#focr_bin_tifftopnm /usr/local/bin/tifftopnm
++#focr_bin_ppmhist /usr/local/bin/ppmhist
++#focr_bin_gocr /usr/local/bin/gocr
++#focr_bin_ocrad /usr/local/bin/ocrad
++
++#focr_bin_pnmnorm /usr/local/bin/pnmnorm
++#focr_bin_pnminvert /usr/local/bin/pnminvert
++
++#focr_bin_pdfinfo /usr/local/bin/pdfinfo
++#focr_bin_pdftops /usr/local/bin/pdftops
++#focr_bin_pstopnm /usr/local/bin/pstopnm
+
+ ###
+ ### Scansets
+@@ -143,8 +143,8 @@
+
+ # Paths to the files containing Scansets and Preprocessors definitions
+ #
+-#focr_preprocessor_file /etc/mail/spamassassin/FuzzyOcr.preps
+-#focr_scanset_file /etc/mail/spamassassin/FuzzyOcr.scansets
++#focr_preprocessor_file /usr/local/etc/mail/spamassassin/FuzzyOcr.preps
++#focr_scanset_file /usr/local/etc/mail/spamassassin/FuzzyOcr.scansets
+
+ # Setting this to 1 will cause FuzzyOcr to skip all other scansets,
+ # if a scanset has reached the amount of hits specified in
+@@ -313,18 +313,18 @@
+
+ # If the image hash database feature is enabled (Type 1 Hashing),
+ # specify the file to use as database
+-# Default value: /etc/mail/spamassassin/FuzzyOcr.hashdb
+-#focr_digest_db /etc/mail/spamassassin/FuzzyOcr.hashdb
++# Default value: /usr/local/etc/mail/spamassassin/FuzzyOcr.hashdb
++#focr_digest_db /usr/local/etc/mail/spamassassin/FuzzyOcr.hashdb
+
+ # If the image hash db feature is enabled (Type 2 Hashing),
+ # specify the file to use as the SPAM database
+-# Default value: /etc/mail/spamassassin/FuzzyOcr.db
+-#focr_db_hash /etc/mail/spamassassin/FuzzyOcr.db
++# Default value: /usr/local/etc/mail/spamassassin/FuzzyOcr.db
++#focr_db_hash /usr/local/etc/mail/spamassassin/FuzzyOcr.db
+
+ # If the image hash db feature is enabled (Type 2 Hashing),
+ # specify the file to use as the HAM database
+-# Default value: /etc/mail/spamassassin/FuzzyOcr.safe.db
+-#focr_db_safe /etc/mail/spamassassin/FuzzyOcr.safe.db
++# Default value: /usr/local/etc/mail/spamassassin/FuzzyOcr.safe.db
++#focr_db_safe /usr/local/etc/mail/spamassassin/FuzzyOcr.safe.db
+
+ # Auto-prune: Expire records from hasing databases after these many days
+ # Default value: 35
+@@ -352,7 +352,7 @@
+ # + score,
+ # + word-info
+ # Default value: 0
+-#focr_mysql_update_hash 1
++focr_mysql_update_hash 0
+
+ ###
+ ### Miscellaneous Options
diff --git a/mail/p5-FuzzyOcr-devel/files/patch-FuzzyOcr.preps b/mail/p5-FuzzyOcr-devel/files/patch-FuzzyOcr.preps
new file mode 100644
index 000000000000..85433b3c5066
--- /dev/null
+++ b/mail/p5-FuzzyOcr-devel/files/patch-FuzzyOcr.preps
@@ -0,0 +1,18 @@
+--- FuzzyOcr.preps.orig 2009-05-29 23:07:02.000000000 +0300
++++ FuzzyOcr.preps 2009-05-29 23:08:23.000000000 +0300
+@@ -21,10 +21,11 @@
+ command = pamtopnm
+ }
+
+-# Uses thresholding on the PAM file
+-preprocessor pamthreshold {
+- command = pamthreshold
+- args = -simple -threshold 0.5
++
++# Uses pamditherbw with thresholding on the PAM file
++preprocessor pamditherbw {
++ command = pamditherbw
++ args = -threshold
+ }
+
+ # converts PNM to TIFF (this is used for tesseract)
diff --git a/mail/p5-FuzzyOcr-devel/files/patch-FuzzyOcr.scansets b/mail/p5-FuzzyOcr-devel/files/patch-FuzzyOcr.scansets
new file mode 100644
index 000000000000..9be2204f4406
--- /dev/null
+++ b/mail/p5-FuzzyOcr-devel/files/patch-FuzzyOcr.scansets
@@ -0,0 +1,19 @@
+--- FuzzyOcr.scansets.orig 2009-05-29 23:09:04.000000000 +0300
++++ FuzzyOcr.scansets 2009-05-29 23:09:37.000000000 +0300
+@@ -20,14 +20,14 @@
+
+ # Inverted Ocrad scanset with decolorization
+ scanset ocrad-decolorize-invert {
+- preprocessors = ppmtopgm, pamthreshold, pamtopnm
++ preprocessors = ppmtopgm, pamditherbw, pamtopnm
+ command = $ocrad
+ args = -s5 -i $input
+ }
+
+ # Ocrad scanset with decolorization
+ scanset ocrad-decolorize {
+- preprocessors = ppmtopgm, pamthreshold, pamtopnm
++ preprocessors = ppmtopgm, pamditherbw, pamtopnm
+ command = $ocrad
+ args = -s5 $input
+ }
diff --git a/mail/p5-FuzzyOcr-devel/files/pkg-message.in b/mail/p5-FuzzyOcr-devel/files/pkg-message.in
index 11e9ed3223d2..745cbf7b4f45 100644
--- a/mail/p5-FuzzyOcr-devel/files/pkg-message.in
+++ b/mail/p5-FuzzyOcr-devel/files/pkg-message.in
@@ -1,5 +1,5 @@
------------------------------------------------------------------------
- To complete the install of FuzzyOcr, copy FuzzyOcr.cf and
- FuzzyOcr.words from %%EXAMPLESDIR%% into your
+ To complete the install of FuzzyOcr, copy FuzzyOcr.cf, FuzzyOcr.preps,
+FuzzyOcr.scansets 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
index a7069d137cbd..6ea436259182 100644
--- a/mail/p5-FuzzyOcr-devel/pkg-descr
+++ b/mail/p5-FuzzyOcr-devel/pkg-descr
@@ -9,4 +9,4 @@ 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
+WWW: http://fuzzyocr.own-hero.net/