Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 317575 - mail-filter/spamassassin-fuzzyocr-3.6.0 requires gocr even if USE flag not set
Summary: mail-filter/spamassassin-fuzzyocr-3.6.0 requires gocr even if USE flag not set
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High minor (vote)
Assignee: Patrick McLean
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-28 05:00 UTC by Oliver Schwabedissen
Modified: 2014-11-29 00:19 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Schwabedissen 2010-04-28 05:00:04 UTC
I updated spamassassin-fuzzyocr to stable version 3.6 recently. Although I don't have the "gocr" USE flag set it complains about not finding the gocr executable.

 $ emerge -pv spamassassin-fuzzyocr

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R   ] mail-filter/spamassassin-fuzzyocr-3.6.0  USE="dbm logrotate mysql ocrad -amavis -gocr -tesseract" 0 kB

 $ spamassassin -x -r < ~/tmp/spam.mbox
[26308] warn: FuzzyOcr: Cannot find executable for gocr
1 message(s) examined.


Reproducible: Always

Steps to Reproduce:
1.emerge spamassassin-fuzzyocr-3.6.0 without gocr USE flag
2.run spamassassin on a suspect file
3.

Actual Results:  
spamassassin analyzes the file, then spamassassin-fuzzyocr complains about gocr not found.

Expected Results:  
No warning from spamassassin-fuzzyocr since gocr USE flag is not set.

When adding the gocr USE flag and re-emerging spamassassin-fuzzyocr gocr gets pulled in as a dependency. Now spamassassin-fuzzyocr doesn't complain anymore about the gocr executable not found.
Comment 1 David Abbott (RETIRED) gentoo-dev 2010-04-30 14:25:50 UTC
Looking here;
http://wiki.apache.org/spamassassin/FuzzyOcrPlugin
Looks like gocr is a runtime dependency from the site;

Requirements

You will need giftopnm, jpegtopnm and pngtopnm (from netpbm), imagemagick and gocr installed.

Additionally, you will need the perl module  String::Approx  and several tools from  giflib  (also known as libungif). 
Comment 2 Oliver Schwabedissen 2010-04-30 18:30:25 UTC
(In reply to comment #1)
> Looking here;
> http://wiki.apache.org/spamassassin/FuzzyOcrPlugin
> Looks like gocr is a runtime dependency from the site;

The INSTALL file from the tarball says the official installation documentation can be found here: http://fuzzyocr.own-hero.net/wiki/Installation-3.6.x

There it says "At least one OCR Engine (though multiple engines at once are possible)"

However, it doesn't say how to disable gocr or ocrad. And the config file (FuzzyOcr.cf) says that these helpers are defined by default:

# The following are already included by default:
#
#focr_bin_helper gifsicle, giffix, giftext, gifinter, giftopnm
#focr_bin_helper jpegtopnm, pngtopnm, bmptopnm, tifftopnm, ppmhist
#focr_bin_helper gocr, ocrad

Removing a comment gives a warning that these helpers are already defined. Other helpers can be activated if required:

# Include additional scanner/preprocessor commands here:
#
focr_bin_helper pnmnorm, pnminvert, pamthreshold, ppmtopgm, pamtopnm
#focr_bin_helper tesseract

# These helpers must be defined before enabling PDF scanning
focr_bin_helper pdfinfo, pdftops, pstopnm

I disabled tesseract because I don't have it installed.

But it seems the only way to disable one of the default helpers is to modify /usr/lib/perl5/vendor_perl/5.8.8/FuzzyOcr/Config.pm:

our @bin_utils = qw/gifsicle
    giffix
    giftext
    gifinter
    giftopnm
    jpegtopnm
    pngtopnm
    bmptopnm
    tifftopnm
    ppmhist
    pamfile
    ocrad
    gocr/;


The ebuild just disables the scansets for gocr when the USE flag is disabled:
  # If gocr USE flag is unset, enable disable gocr in Fuzzyocr.scansets /jni
  use gocr || epatch "${FILESDIR}"/disablegocr.patch

So if we need the USE flags for gocr and ocrad the ebuild should also patch Config.pm depending on which flags are enabled/disabled.

If neither gocr, ocrad or tesseract is set the ebuild defaults to ocrad.

Comment 3 Bernard Cafarelli gentoo-dev 2010-05-06 16:17:27 UTC
Thanks for the detailed report! So we should also patch Config.pm according to the USE flags, and maybe also default to gocr as this is the default recommended upstream
Comment 4 Andreas K. Hüttel archtester gentoo-dev 2014-10-27 22:28:29 UTC
Masked for removal
Comment 5 Andreas K. Hüttel archtester gentoo-dev 2014-11-29 00:19:20 UTC
Package removed