diff options
author | Bernard Cafarelli <voyageur@gentoo.org> | 2009-11-13 15:28:27 +0000 |
---|---|---|
committer | Bernard Cafarelli <voyageur@gentoo.org> | 2009-11-13 15:28:27 +0000 |
commit | 27a1065525731b1171fb69cdd853fe31a03e2db5 (patch) | |
tree | 9783348fcfc0200c7464f979aa773551f93d1d1e /mail-filter | |
parent | Force -j1 due to parallel build issues. (diff) | |
download | gentoo-2-27a1065525731b1171fb69cdd853fe31a03e2db5.tar.gz gentoo-2-27a1065525731b1171fb69cdd853fe31a03e2db5.tar.bz2 gentoo-2-27a1065525731b1171fb69cdd853fe31a03e2db5.zip |
Version bump (bug #285327) and add myself to maintainers, patches from bugs #174993, #273183 (both merged in #251687), default to ocrad ocr engine if none are specified (bugs #171376, #254751), RDEPEND on netpbm with jpeg,png,tiff (bug #244828). Also fixes bug #249668
(Portage version: 2.2_rc49/cvs/Linux x86_64)
Diffstat (limited to 'mail-filter')
5 files changed, 283 insertions, 2 deletions
diff --git a/mail-filter/spamassassin-fuzzyocr/ChangeLog b/mail-filter/spamassassin-fuzzyocr/ChangeLog index 1346aa7cbf2f..9b312bd1e529 100644 --- a/mail-filter/spamassassin-fuzzyocr/ChangeLog +++ b/mail-filter/spamassassin-fuzzyocr/ChangeLog @@ -1,6 +1,17 @@ # ChangeLog for mail-filter/spamassassin-fuzzyocr -# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/mail-filter/spamassassin-fuzzyocr/ChangeLog,v 1.17 2008/08/23 06:03:23 cardoe Exp $ +# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/mail-filter/spamassassin-fuzzyocr/ChangeLog,v 1.18 2009/11/13 15:28:25 voyageur Exp $ + +*spamassassin-fuzzyocr-3.6.0 (13 Nov 2009) + + 13 Nov 2009; Bernard Cafarelli <voyageur@gentoo.org> + +spamassassin-fuzzyocr-3.6.0.ebuild, + +files/spamassassin-fuzzyocr-3.6.0-fix_falsepositives.patch, + +files/spamassassin-fuzzyocr-3.6.0-fix_tmpdir.patch, metadata.xml: + Version bump (bug #285327) and add myself to maintainers, patches from + bugs #174993, #273183 (both merged in #251687), default to ocrad ocr + engine if none are specified (bugs #171376, #254751), RDEPEND on netpbm + with jpeg,png,tiff (bug #244828). Also fixes bug #249668 23 Aug 2008; Doug Goldstein <cardoe@gentoo.org> metadata.xml: add GLEP 56 USE flag desc from use.local.desc diff --git a/mail-filter/spamassassin-fuzzyocr/files/spamassassin-fuzzyocr-3.6.0-fix_falsepositives.patch b/mail-filter/spamassassin-fuzzyocr/files/spamassassin-fuzzyocr-3.6.0-fix_falsepositives.patch new file mode 100644 index 000000000000..b79d38a4e399 --- /dev/null +++ b/mail-filter/spamassassin-fuzzyocr/files/spamassassin-fuzzyocr-3.6.0-fix_falsepositives.patch @@ -0,0 +1,12 @@ +diff -u -r FuzzyOcr-3.5.1-orig/FuzzyOcr.pm FuzzyOcr-3.5.1/FuzzyOcr.pm +--- FuzzyOcr-3.5.1-orig/FuzzyOcr.pm 2007-01-07 04:05:08.000000000 -0800 ++++ FuzzyOcr-3.5.1/FuzzyOcr.pm 2007-04-17 14:21:25.000000000 -0700 +@@ -146,7 +146,7 @@ + ){ + $fname = join('',@{$p->{'headers'}->{'content-id'}}); + $fname =~ s/[<>]//g; +- $fname =~ tr/\@\$\%\&/_/s; ++ $fname =~ tr/\@\$\%\&\./_/s; + } + + my $filename = $fname; $filename =~ tr{a-zA-Z0-9\-.}{_}cs; diff --git a/mail-filter/spamassassin-fuzzyocr/files/spamassassin-fuzzyocr-3.6.0-fix_tmpdir.patch b/mail-filter/spamassassin-fuzzyocr/files/spamassassin-fuzzyocr-3.6.0-fix_tmpdir.patch new file mode 100644 index 000000000000..93896ef76c0e --- /dev/null +++ b/mail-filter/spamassassin-fuzzyocr/files/spamassassin-fuzzyocr-3.6.0-fix_tmpdir.patch @@ -0,0 +1,69 @@ +diff -ur FuzzyOcr.orig/Deanimate.pm FuzzyOcr/Deanimate.pm +--- FuzzyOcr.orig/Deanimate.pm Sun Jan 7 19:05:18 2007 ++++ FuzzyOcr/Deanimate.pm Thu Nov 15 13:19:00 2007 +@@ -8,13 +8,14 @@ + use FuzzyOcr::Config qw(get_config set_config get_tmpdir); + use FuzzyOcr::Misc qw(save_execute); + use FuzzyOcr::Logging qw(errorlog warnlog infolog); ++use File::Basename qw(dirname); + + # Provide functions to deanimate gifs + + sub deanimate { + my $conf = get_config(); +- my $imgdir = get_tmpdir(); + my $tfile = shift; ++ my $imgdir = dirname($tfile); + my $efile = $tfile . ".err"; + my $tfile2 = $tfile; + my $tfile3 = $tfile; +@@ -58,8 +59,8 @@ + + sub gif_info { + my $conf = get_config(); +- my $imgdir = get_tmpdir(); + my $giffile = $_[0]; ++ my $imgdir = dirname($giffile); + + my $fd = new IO::Handle; + +diff -ur FuzzyOcr.orig/Preprocessor.pm FuzzyOcr/Preprocessor.pm +--- FuzzyOcr.orig/Preprocessor.pm Sun Jan 7 19:05:18 2007 ++++ FuzzyOcr/Preprocessor.pm Thu Nov 15 12:31:05 2007 +@@ -1,5 +1,7 @@ + package FuzzyOcr::Preprocessor; + ++use File::Basename qw(dirname); ++ + sub new { + my ($class, $label, $command, $args) = @_; + +@@ -12,7 +14,7 @@ + + sub run { + my ($self, $input) = @_; +- my $tmpdir = FuzzyOcr::Config::get_tmpdir(); ++ my $tmpdir = dirname($input); + my $label = $self->{label}; + my $output = "$tmpdir/prep.$label.out"; + my $stderr = ">$tmpdir/prep.$label.err"; +diff -ur FuzzyOcr.orig/Scanset.pm FuzzyOcr/Scanset.pm +--- FuzzyOcr.orig/Scanset.pm Sun Jan 7 19:05:18 2007 ++++ FuzzyOcr/Scanset.pm Thu Nov 15 13:20:39 2007 +@@ -2,6 +2,7 @@ + + use lib qw(..); + use FuzzyOcr::Logging qw(errorlog); ++use File::Basename qw(dirname); + + sub new { + my ($class, $label, $preprocessors, $command, $args, $output_in) = @_; +@@ -19,7 +20,7 @@ + sub run { + my ($self, $input) = @_; + my $conf = FuzzyOcr::Config::get_config(); +- my $tmpdir = FuzzyOcr::Config::get_tmpdir(); ++ my $tmpdir = dirname($input); + my $label = $self->{label}; + my $output = "$tmpdir/scanset.$label.out"; + my $stderr = ">$tmpdir/scanset.$label.err"; diff --git a/mail-filter/spamassassin-fuzzyocr/metadata.xml b/mail-filter/spamassassin-fuzzyocr/metadata.xml index 9834ec2d0912..a83c9e7b4998 100644 --- a/mail-filter/spamassassin-fuzzyocr/metadata.xml +++ b/mail-filter/spamassassin-fuzzyocr/metadata.xml @@ -3,6 +3,10 @@ <pkgmetadata> <herd>perl</herd> <maintainer> + <email>voyageur@gentoo.org</email> + <name>Bernard Cafarelli</name> + </maintainer> + <maintainer> <email>tomk@gentoo.org</email> <name>Tom Knight</name> </maintainer> diff --git a/mail-filter/spamassassin-fuzzyocr/spamassassin-fuzzyocr-3.6.0.ebuild b/mail-filter/spamassassin-fuzzyocr/spamassassin-fuzzyocr-3.6.0.ebuild new file mode 100644 index 000000000000..e842f2f99ded --- /dev/null +++ b/mail-filter/spamassassin-fuzzyocr/spamassassin-fuzzyocr-3.6.0.ebuild @@ -0,0 +1,185 @@ +# Copyright 1999-2009 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.6.0.ebuild,v 1.1 2009/11/13 15:28:25 voyageur Exp $ + +EAPI=2 +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}.tar.gz" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~ppc ~ppc64 ~sparc ~x86" +IUSE="dbm gocr ocrad tesseract mysql logrotate amavis" + +DEPEND="dev-lang/perl + dev-perl/Tie-Cache + >=mail-filter/spamassassin-3.2.0" + +RDEPEND="${DEPEND} + gocr? ( >=app-text/gocr-0.43 ) + ocrad? ( >=app-text/ocrad-0.14 ) + tesseract? ( app-text/tesseract ) + !gocr? ( !ocrad? ( !tesseract? ( >=app-text/ocrad-0.14 ) ) ) + mysql? ( dev-perl/DBD-mysql dev-perl/DBI ) + logrotate? ( app-admin/logrotate ) + dbm? ( virtual/perl-DB_File dev-perl/MLDBM-Sync virtual/perl-Storable ) + media-libs/netpbm[jpeg,png,tiff] + media-libs/giflib + dev-perl/String-Approx + virtual/perl-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 + ewarn You did not specify an OCR engine. They can be + ewarn enabled/disabled via the USE flags: + ewarn gocr ocrad tesseract + ewarn Defaulting to ocrad + fi + + # create fuzzyocr group for logging and hashing + if use dbm || use logrotate ; then + use amavis || enewgroup fuzzyocr + fi +} + +src_prepare() { + # Bug #174993 + epatch "${FILESDIR}"/${P}-fix_falsepositives.patch + # Bug #273183 + epatch "${FILESDIR}"/${P}-fix_tmpdir.patch + + # 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() { + elog "You need to restart spamassassin (as root) before this plugin will work:" + elog "/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 + elog "All permissions are set for the user amavis!" + else + elog "Permissions have been set for the fuzzyocr group, to enable" + elog "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 +} |