# ChangeLog for mail-filter/spamassassin-fuzzyocr
# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/mail-filter/spamassassin-fuzzyocr/ChangeLog,v 1.4 2007/02/08 23:41:47 chutzpah Exp $
+# $Header: /var/cvsroot/gentoo-x86/mail-filter/spamassassin-fuzzyocr/ChangeLog,v 1.5 2007/03/12 19:01:12 tomk Exp $
+
+*spamassassin-fuzzyocr-3.5.1 (11 Mar 2007)
+
+ 11 Mar 2007; Tom Knight <tomk@gentoo.org> +files/disablegocr.patch,
+ +files/disableocrad.patch, +files/enabletesseract.patch,
+ +files/fuzzyocr.logrotate, +spamassassin-fuzzyocr-3.5.1.ebuild:
+ Version bump to 3.5.1, thanks to everyone who helped out. Fixes bug #158445
08 Feb 2007; Patrick McLean <chutzpah@gentoo.org> metadata.xml:
Add myself as co-maintainer.
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-
+AUX disablegocr.patch 574 RMD160 78e1fb95a5758f7b4c0a9c9d40f4d4d9e1a04dbb SHA1 c6ffbdaaa1e794e3e94118501704978d1876b743 SHA256 71914e653efba7688f2edeb396c5ff99d98e42d3541190095041d17549f5812b
+MD5 65f6cb9656c80bf86c2a53d74d1b77b9 files/disablegocr.patch 574
+RMD160 78e1fb95a5758f7b4c0a9c9d40f4d4d9e1a04dbb files/disablegocr.patch 574
+SHA256 71914e653efba7688f2edeb396c5ff99d98e42d3541190095041d17549f5812b files/disablegocr.patch 574
+AUX disableocrad.patch 1315 RMD160 4e699fca395227a679f72723b49f159678486aad SHA1 11ba0072cf941ed29008a009699a63b0711c14d0 SHA256 a03caec630e9ed4ae435b2123c01ff848fe3a451e3a756f1bab2b0061a0ebe03
+MD5 e79daa6edbbe4df521a8c68e66d1215e files/disableocrad.patch 1315
+RMD160 4e699fca395227a679f72723b49f159678486aad files/disableocrad.patch 1315
+SHA256 a03caec630e9ed4ae435b2123c01ff848fe3a451e3a756f1bab2b0061a0ebe03 files/disableocrad.patch 1315
+AUX enabletesseract.patch 806 RMD160 908a62fe0c683058f71ae50087cbb9999a9f8341 SHA1 1cbe450861a7d60273346538c48499668eb1ad7b SHA256 df0a9914f66c203f38af42d63f75890264d54b40e3ed09f1044844d34ad1f382
+MD5 dc8b4b48bfbaa228e689cfc1bf822116 files/enabletesseract.patch 806
+RMD160 908a62fe0c683058f71ae50087cbb9999a9f8341 files/enabletesseract.patch 806
+SHA256 df0a9914f66c203f38af42d63f75890264d54b40e3ed09f1044844d34ad1f382 files/enabletesseract.patch 806
+AUX fuzzyocr.logrotate 194 RMD160 1f0f601dd3874f5d0bc36249c6947cbf22960f10 SHA1 958099139c6c884ed7b72dd67edd84affe7e64b2 SHA256 ce41aa3314237d725c6173d809de2e0862c8547f26516b5dda26df684cb72fc3
+MD5 3e1403a4bdc931391ced5e11772aff66 files/fuzzyocr.logrotate 194
+RMD160 1f0f601dd3874f5d0bc36249c6947cbf22960f10 files/fuzzyocr.logrotate 194
+SHA256 ce41aa3314237d725c6173d809de2e0862c8547f26516b5dda26df684cb72fc3 files/fuzzyocr.logrotate 194
DIST fuzzyocr-2.3b.tar.gz 76411 RMD160 36b77add4645b462a7eb52540aba1212d55cd3f0 SHA1 e897ed9bcdfe313af78c6d89d09726dd5fb96ae5 SHA256 10db14b33a42249de40e347a8ad26cff150c2a6f6580246bce8689d8f1dc0a82
-EBUILD spamassassin-fuzzyocr-2.3b.ebuild 1970 RMD160 57d57e5fe8e1dab896a2d15cf7d041ca382ace72 SHA1 927442d8508a5747cd7b9caf44af76a8fbe8cd07 SHA256 7f5421ce3511b4515dd599c1e81cf30a607db1beedb6f93c3dcba9f66be3b626
-MD5 682f557ce65e623de04adeb0fb28ed55 spamassassin-fuzzyocr-2.3b.ebuild 1970
-RMD160 57d57e5fe8e1dab896a2d15cf7d041ca382ace72 spamassassin-fuzzyocr-2.3b.ebuild 1970
-SHA256 7f5421ce3511b4515dd599c1e81cf30a607db1beedb6f93c3dcba9f66be3b626 spamassassin-fuzzyocr-2.3b.ebuild 1970
-MISC ChangeLog 733 RMD160 c3df31f6136963ed39fa882588d7f9c2f9db0289 SHA1 a981d8a8d4fbdbec1e0516bddc76fa463dfa56f2 SHA256 ec417003754e983ead9353a6d2985475e5ff2c9f69082bac9018709d8523cf3a
-MD5 8661fae69db35f5c8bd29cb4e9ef4d1a ChangeLog 733
-RMD160 c3df31f6136963ed39fa882588d7f9c2f9db0289 ChangeLog 733
-SHA256 ec417003754e983ead9353a6d2985475e5ff2c9f69082bac9018709d8523cf3a ChangeLog 733
+DIST fuzzyocr-3.5.1-devel.tar.gz 124418 RMD160 109f3ab8a6ecda5f2e0d737233faf54122f6d036 SHA1 52cb3b786d07b88b0c5c6bb8ab3c73a67321281e SHA256 75cf2c40824a0d151c495c687f33d76f09ccc01082407ba8bb7eeee7e7b16059
+EBUILD spamassassin-fuzzyocr-2.3b.ebuild 1966 RMD160 300275c60b78bf4dafc21d98ceeb15c57f0921c8 SHA1 351b0bb57c5a58bb778ee9740cd7c8b8492dd8fe SHA256 34b257ba1c60ab0271a6bc5640ad4e38152f85468f775276f72b764d3a954d06
+MD5 2b1d55fc34fc0080437fd2ef69487e94 spamassassin-fuzzyocr-2.3b.ebuild 1966
+RMD160 300275c60b78bf4dafc21d98ceeb15c57f0921c8 spamassassin-fuzzyocr-2.3b.ebuild 1966
+SHA256 34b257ba1c60ab0271a6bc5640ad4e38152f85468f775276f72b764d3a954d06 spamassassin-fuzzyocr-2.3b.ebuild 1966
+EBUILD spamassassin-fuzzyocr-3.5.1.ebuild 5315 RMD160 5af60c505c22d6c490d71b54b2cc82f0e7f425e5 SHA1 57fadd5814fb0ace9588c674dccecc6f8e8102de SHA256 1a5b87d023845d15fe07207ed0687a9772b1968e5e173d5b02f35234b98b62ec
+MD5 01dabdf7f9fedde81f74922a0f83c8e3 spamassassin-fuzzyocr-3.5.1.ebuild 5315
+RMD160 5af60c505c22d6c490d71b54b2cc82f0e7f425e5 spamassassin-fuzzyocr-3.5.1.ebuild 5315
+SHA256 1a5b87d023845d15fe07207ed0687a9772b1968e5e173d5b02f35234b98b62ec spamassassin-fuzzyocr-3.5.1.ebuild 5315
+MISC ChangeLog 1047 RMD160 9fe7aaf0ba880266a749f4f12cdb80b1ef24b65e SHA1 59034af3e11a6ea08a7db27843686cb8d7650546 SHA256 4868da6d71e213e0f8933cb34b6f390f1703f1c057e2204ff24294aeecc1d5ca
+MD5 5edbadfcaa2ba1acaae283a7a56728f6 ChangeLog 1047
+RMD160 9fe7aaf0ba880266a749f4f12cdb80b1ef24b65e ChangeLog 1047
+SHA256 4868da6d71e213e0f8933cb34b6f390f1703f1c057e2204ff24294aeecc1d5ca ChangeLog 1047
MISC metadata.xml 724 RMD160 ca8bdf48e7e3f1fe34a9df8cf1df070a977d3480 SHA1 b6778bbc7c0d77b4556306d0c1c85b7b91106b22 SHA256 39e916df5be09516aed189bc9a8fcc3f16623699f33c35d364e9a49c71f4c31a
MD5 46baf638cb6673317723526fbd95c442 metadata.xml 724
RMD160 ca8bdf48e7e3f1fe34a9df8cf1df070a977d3480 metadata.xml 724
MD5 ef2b51883c013055c460f71ab2cda785 files/digest-spamassassin-fuzzyocr-2.3b 238
RMD160 ff580dd45e0096b3b945863e42c37c2dc62f4a20 files/digest-spamassassin-fuzzyocr-2.3b 238
SHA256 8f570404c99302a9e5db522fd3262907566e2ef0ab6ede71ed582dfa52ec1252 files/digest-spamassassin-fuzzyocr-2.3b 238
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v2.0.2 (GNU/Linux)
-
-iD8DBQFFy7VTWt/XSf2CZdkRAmLBAJ9wd8WL4PphcP6clLdsvAAAUobMpQCeM1dE
-1zkzVDwyy2hCxD1GrZlVFQ4=
-=A/zP
------END PGP SIGNATURE-----
+MD5 ad103c14f446452ac1f8779370778a9f files/digest-spamassassin-fuzzyocr-3.5.1 262
+RMD160 b4df515c8e22068383dbe6625ddb10cd79ca3351 files/digest-spamassassin-fuzzyocr-3.5.1 262
+SHA256 6b5b30d92173d88f0e20796b8f562f1bbd29c83cab2af93be047174ab96a2a47 files/digest-spamassassin-fuzzyocr-3.5.1 262
--- /dev/null
+MD5 14e04c4768f57a39a4953a837766f772 fuzzyocr-3.5.1-devel.tar.gz 124418
+RMD160 109f3ab8a6ecda5f2e0d737233faf54122f6d036 fuzzyocr-3.5.1-devel.tar.gz 124418
+SHA256 75cf2c40824a0d151c495c687f33d76f09ccc01082407ba8bb7eeee7e7b16059 fuzzyocr-3.5.1-devel.tar.gz 124418
--- /dev/null
+--- FuzzyOcr.scansets.orig 2006-12-26 16:08:25.000000000 -0800
++++ FuzzyOcr.scansets 2006-12-26 16:12:09.000000000 -0800
+@@ -33,16 +33,16 @@
+ }
+
+ # Standard Gocr Scanset
+-scanset gocr {
+- command = $gocr
+- args = -i $input
+-}
++#scanset gocr {
++# command = $gocr
++# args = -i $input
++#}
+
+ # Tweaked Gocr Scanset
+-scanset gocr-180 {
+- command = $gocr
+- args = -l 180 -d 2 -i $input
+-}
++#scanset gocr-180 {
++# command = $gocr
++# args = -l 180 -d 2 -i $input
++#}
+
+ # An example Scanset how to use tesseract (disabled by default)
+ #scanset tesseract {
--- /dev/null
+--- FuzzyOcr.scansets.orig 2006-12-26 23:45:35.000000000 +0100
++++ FuzzyOcr.scansets 2006-12-26 23:45:55.000000000 +0100
+@@ -7,30 +7,30 @@
+
+
+ # Standard Ocrad Scanset
+-scanset ocrad {
+- command = $ocrad
+- args = -s5 $input
+-}
++#scanset ocrad {
++# command = $ocrad
++# args = -s5 $input
++#}
+
+ # Inverted Ocrad scanset
+-scanset ocrad-invert {
+- command = $ocrad
+- args = -s5 -i $input
+-}
++#scanset ocrad-invert {
++# command = $ocrad
++# args = -s5 -i $input
++#}
+
+ # Inverted Ocrad scanset with decolorization
+-scanset ocrad-decolorize-invert {
+- preprocessors = ppmtopgm, pamthreshold, pamtopnm
+- command = $ocrad
+- args = -s5 -i $input
+-}
++#scanset ocrad-decolorize-invert {
++# preprocessors = ppmtopgm, pamthreshold, pamtopnm
++# command = $ocrad
++# args = -s5 -i $input
++#}
+
+ # Ocrad scanset with decolorization
+-scanset ocrad-decolorize {
+- preprocessors = ppmtopgm, pamthreshold, pamtopnm
+- command = $ocrad
+- args = -s5 $input
+-}
++#scanset ocrad-decolorize {
++# preprocessors = ppmtopgm, pamthreshold, pamtopnm
++# command = $ocrad
++# args = -s5 $input
++#}
+
+ # Standard Gocr Scanset
+ scanset gocr {
+@@ -59,4 +59,4 @@
+ # preprocessors = normalize, invert, normalize
+ # command = $gocr
+ # args = -i $input
+-#}
+\ No newline at end of file
++#}
--- /dev/null
+--- FuzzyOcr.scansets.orig 2006-12-26 23:45:35.000000000 +0100
++++ FuzzyOcr.scansets 2006-12-27 00:09:48.000000000 +0100
+@@ -45,12 +45,12 @@
+ }
+
+ # An example Scanset how to use tesseract (disabled by default)
+-#scanset tesseract {
+-# preprocessors = maketiff
+-# command = $tesseract
+-# args = $input $output
+-# force_output_in = $output.txt
+-#}
++scanset tesseract {
++ preprocessors = maketiff
++ command = $tesseract
++ args = $input $output
++ force_output_in = $output.txt
++}
+
+ # Another example, this basically does the same as the inverted Ocrad Scanset
+ # Only listed here to serve as example, ocrad-invert does this already
+@@ -59,4 +59,4 @@
+ # preprocessors = normalize, invert, normalize
+ # command = $gocr
+ # args = -i $input
+-#}
+\ No newline at end of file
++#}
--- /dev/null
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header:
+
+/var/log/FuzzyOcr.log {
+ sharedscripts
+ missingok
+ postrotate
+ endscript
+}
-# Copyright 1999-2006 Gentoo Foundation
+# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/mail-filter/spamassassin-fuzzyocr/spamassassin-fuzzyocr-2.3b.ebuild,v 1.3 2006/12/12 13:04:47 gustavoz Exp $
+# $Header: /var/cvsroot/gentoo-x86/mail-filter/spamassassin-fuzzyocr/spamassassin-fuzzyocr-2.3b.ebuild,v 1.4 2007/03/12 19:01:12 tomk Exp $
inherit perl-module
--- /dev/null
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/mail-filter/spamassassin-fuzzyocr/spamassassin-fuzzyocr-3.5.1.ebuild,v 1.1 2007/03/12 19:01:12 tomk Exp $
+
+inherit perl-module eutils
+
+MY_P="${P#spamassassin-}"
+
+DESCRIPTION="SpamAssassin plugin for performing Optical Character Recognition (OCR) on attached images"
+HOMEPAGE="http://fuzzyocr.own-hero.net/"
+SRC_URI="http://users.own-hero.net/~decoder/fuzzyocr/${MY_P}-devel.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~sparc ~x86"
+IUSE="dbm gocr ocrad tesseract mysql logrotate amavis"
+
+DEPEND="dev-lang/perl
+ >=mail-filter/spamassassin-3.1.4"
+
+RDEPEND="${DEPEND}
+ gocr? ( >=app-text/gocr-0.43 )
+ ocrad? ( >=app-text/ocrad-0.14 )
+ tesseract? ( app-text/tesseract )
+ mysql? ( dev-perl/DBD-mysql dev-perl/DBI )
+ logrotate? ( app-admin/logrotate )
+ dbm? ( perl-core/DB_File dev-perl/MLDBM-Sync perl-core/Storable )
+ media-libs/netpbm
+ media-libs/giflib
+ dev-perl/String-Approx
+ perl-core/Time-HiRes
+ media-gfx/gifsicle"
+# postgres? ( dev-perl/DBD-Pg )
+
+S="${WORKDIR}/${MY_P/fuzzyocr/FuzzyOcr}"
+
+pkg_setup() {
+ if ! use gocr && ! use ocrad && ! use tesseract ; then
+ eerror
+ eerror You did not specify an OCR engine. FuzzyOcr requires at least one
+ eerror OCR engine USE flag to be enabled. It is possible to enable all.
+ eerror
+ eerror The 3 OCR engines are: gocr ocrad tesseract
+ eerror Enable them in /etc/make.conf or /etc/portage/package.use
+ eerror
+ die "Configure failed"
+ fi
+
+ # create fuzzyocr group for logging and hashing
+ if use dbm || use logrotate ; then
+ use amavis || enewgroup fuzzyocr
+ fi
+}
+
+src_unpack() {
+ unpack ${A}
+ cd ${S}
+
+ # If no ocrad USE flag, remove it from Fuzzyocr.scansets / jni
+ use ocrad || epatch "${FILESDIR}"/disableocrad.patch
+
+ # If tesseract USE flag is set, enable it in Fuzzyocr.scansets /jni
+ use tesseract && epatch "${FILESDIR}"/enabletesseract.patch
+
+ # If gocr USE flag is unset, enable disable gocr in Fuzzyocr.scansets /jni
+ use gocr || epatch "${FILESDIR}"/disablegocr.patch
+
+ # Apply PgSQL patchset if USE postgres /juan
+ #use postgres && epatch "${FILESDIR}"/postgresql.patch
+}
+
+src_install() {
+ # called to get ${VENDOR_LIB}
+ perlinfo
+
+ local plugin_dir=${VENDOR_LIB}/Mail/SpamAssassin/Plugin
+
+ insinto ${plugin_dir}
+ doins FuzzyOcr.pm
+
+ # Replace location of .pm file in config
+ sed -ie "s:FuzzyOcr.pm:${plugin_dir}/FuzzyOcr.pm:" FuzzyOcr.cf
+
+ # Enable logfile if logrotate
+ if use logrotate ; then
+ sed -ie "s:^#focr_verbose 3:focr_verbose 3:" FuzzyOcr.cf
+ sed -ie "s:^#focr_logfile /tmp/FuzzyOcr.log:focr_logfile /var/log/FuzzyOcr.log:" FuzzyOcr.cf
+
+ # Create the logfile with correct permissions /jni
+ if [ ! -e /var/log/FuzzyOcr.log ]; then
+ insinto /var/log
+ newins /dev/null FuzzyOcr.log
+ if use amavis ; then
+ fperms 600 /var/log/FuzzyOcr.log
+ fowners amavis:amavis /var/log/FuzzyOcr.log
+ else
+ fperms 660 /var/log/FuzzyOcr.log
+ fowners root:fuzzyocr /var/log/FuzzyOcr.log
+ fi
+ fi
+
+ diropts ""
+ dodir /etc/logrotate.d
+ insopts -m0644
+ insinto /etc/logrotate.d
+ newins ${FILESDIR}/fuzzyocr.logrotate FuzzyOcr
+ fi
+
+ # Create needed dir for dbs and change FuzzyOcr.cf /jni
+ if use dbm ; then
+ dodir /var/lib/FuzzyOcr
+ keepdir /var/lib/FuzzyOcr
+ if use amavis ; then
+ fowners amavis:amavis /var/lib/FuzzyOcr
+ fperms 700 /var/lib/FuzzyOcr
+ else
+ fowners root:fuzzyocr /var/lib/FuzzyOcr
+ fperms 770 /var/lib/FuzzyOcr
+ fi
+
+ sed -ie "s:^#focr_digest_db /etc/mail/spamassassin/FuzzyOcr.hashdb:#focr_digest_db /var/lib/FuzzyOcr/FuzzyOcr.hashdb:" FuzzyOcr.cf
+ sed -ie "s:^#focr_db_hash /etc/mail/spamassassin/FuzzyOcr.db:#focr_db_hash /var/lib/FuzzyOcr/FuzzyOcr.db:" FuzzyOcr.cf
+ sed -ie "s:^#focr_db_safe /etc/mail/spamassassin/FuzzyOcr.safe.db:#focr_db_safe /var/lib/FuzzyOcr/FuzzyOcr.safe.db:" FuzzyOcr.cf
+
+ if ! use amavis ; then
+ insinto /var/lib/FuzzyOcr/
+
+ local hash_files="FuzzyOcr.hashdb FuzzyOcr.db FuzzyOcr.safe.db"
+
+ for file in ${hash_files}; do
+ if [ ! -e /var/lib/FuzzyOcr/${file} ]; then
+ newins /dev/null ${file}
+ fperms 660 /var/lib/FuzzyOcr/${file}
+ fowners root:fuzzyocr /var/lib/FuzzyOcr/${file}
+ fi
+ done
+ fi
+ fi
+
+ insinto /etc/mail/spamassassin/
+
+ doins FuzzyOcr.cf
+ doins FuzzyOcr.words
+ doins FuzzyOcr.scansets
+ doins FuzzyOcr.preps
+ insinto ${VENDOR_LIB}/FuzzyOcr
+ doins FuzzyOcr/*
+
+ docinto samples
+ dodoc samples/*
+}
+
+
+pkg_postinst() {
+ einfo "You need to restart spamassassin (as root) before this plugin will work:"
+ einfo "/etc/init.d/spamd restart"
+ echo
+ if use dbm || use logrotate ; then
+ local files=""
+
+ if use dbm ; then
+ files="/var/lib/FuzzyOcr"
+ fi
+
+ if use logrotate ; then
+ if [ -z ${files} ] ; then
+ files="/var/log/FuzzyOcr.log"
+ else
+ files="${files} /var/log/FuzzyOcr.log"
+ fi
+ fi
+
+ if use amavis ; then
+ einfo "All permissions are set for the user amavis!"
+ else
+ einfo "Permissions have been set for the fuzzyocr group, to enable"
+ einfo "logging or hashing add any required users to this group"
+ fi
+
+ echo
+ ewarn "If you run spamassassin as another user, please make sure to"
+ ewarn "change permissions on" ${files/ / and }
+ echo
+ fi
+}