ports/135065: [PATCH] mail/p5-FuzzyOcr-devel update to 3.6.0

ismail yenigul ismail.yenigul at endersys.com.tr
Fri May 29 20:50:02 UTC 2009


>Number:         135065
>Category:       ports
>Synopsis:       [PATCH] mail/p5-FuzzyOcr-devel update to 3.6.0
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri May 29 20:50:01 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     ismail yenigul
>Release:        FreeBSD 6.3-RELEASE-p9
>Organization:
Endersys Ltd 
>Environment:
FreeBSD freebsd.enderunix.org 6.3-RELEASE-p9 FreeBSD 6.3-RELEASE-p9 #6: Mon Feb  2 15:07:20 EET 2009     root at freebsd.enderunix.org:/usr/src/sys/amd64/compile/freebsd.amd64  amd64
>Description:
Update to FuzzyOcr-devel to 3.6.0
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff -ruN p5-FuzzyOcr-devel.orig/Makefile p5-FuzzyOcr-devel/Makefile
--- p5-FuzzyOcr-devel.orig/Makefile	2009-03-14 01:27:17.000000000 +0200
+++ p5-FuzzyOcr-devel/Makefile	2009-05-29 23:37:17.000000000 +0300
@@ -6,14 +6,13 @@
 #
 
 PORTNAME=	FuzzyOcr
-DISTVERSION=	3.4.2
-PORTREVISION=	2
+DISTVERSION=	3.6.0
+PORTREVISION=	1
 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 at FreeBSD.org
 COMMENT=	Plugin for SpamAssassin which scans image attachments for spam
@@ -21,24 +20,23 @@
 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 +44,49 @@
 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 -ruN p5-FuzzyOcr-devel.orig/distinfo p5-FuzzyOcr-devel/distinfo
--- p5-FuzzyOcr-devel.orig/distinfo	2006-11-28 00:49:55.000000000 +0200
+++ p5-FuzzyOcr-devel/distinfo	2009-05-29 18:36:18.000000000 +0300
@@ -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 -ruN p5-FuzzyOcr-devel.orig/files/patch-FuzzyOcr.cf p5-FuzzyOcr-devel/files/patch-FuzzyOcr.cf
--- p5-FuzzyOcr-devel.orig/files/patch-FuzzyOcr.cf	1970-01-01 02:00:00.000000000 +0200
+++ p5-FuzzyOcr-devel/files/patch-FuzzyOcr.cf	2009-05-29 23:24:18.000000000 +0300
@@ -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 -ruN p5-FuzzyOcr-devel.orig/files/patch-FuzzyOcr.preps p5-FuzzyOcr-devel/files/patch-FuzzyOcr.preps
--- p5-FuzzyOcr-devel.orig/files/patch-FuzzyOcr.preps	1970-01-01 02:00:00.000000000 +0200
+++ p5-FuzzyOcr-devel/files/patch-FuzzyOcr.preps	2009-05-29 23:24:57.000000000 +0300
@@ -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 -ruN p5-FuzzyOcr-devel.orig/files/patch-FuzzyOcr.scansets p5-FuzzyOcr-devel/files/patch-FuzzyOcr.scansets
--- p5-FuzzyOcr-devel.orig/files/patch-FuzzyOcr.scansets	1970-01-01 02:00:00.000000000 +0200
+++ p5-FuzzyOcr-devel/files/patch-FuzzyOcr.scansets	2009-05-29 23:25:18.000000000 +0300
@@ -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 -ruN p5-FuzzyOcr-devel.orig/files/pkg-message.in p5-FuzzyOcr-devel/files/pkg-message.in
--- p5-FuzzyOcr-devel.orig/files/pkg-message.in	2006-11-06 02:26:03.000000000 +0200
+++ p5-FuzzyOcr-devel/files/pkg-message.in	2009-05-29 23:28:03.000000000 +0300
@@ -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 -ruN p5-FuzzyOcr-devel.orig/pkg-descr p5-FuzzyOcr-devel/pkg-descr
--- p5-FuzzyOcr-devel.orig/pkg-descr	2006-11-06 02:26:03.000000000 +0200
+++ p5-FuzzyOcr-devel/pkg-descr	2009-05-29 23:33:32.000000000 +0300
@@ -9,4 +9,4 @@
 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/


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list