about summary refs log tree commit diff
path: root/pkgs/tools/misc/bogofilter/default.nix
blob: df78108e43e200632a41514429c2b5bf05eca943 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{ lib
, stdenv
, fetchurl
, flex
, db
, makeWrapper
, pax
}:

stdenv.mkDerivation rec {
  pname = "bogofilter";
  version = "1.2.5";

  src = fetchurl {
    url = "mirror://sourceforge/bogofilter/bogofilter-${version}.tar.xz";
    hash = "sha256-MkihNzv/VSxQCDStvqS2yu4EIkUWrlgfslpMam3uieo=";
  };

  nativeBuildInputs = [ makeWrapper ];

  buildInputs = [ flex db ];

  doCheck = false; # needs "y" tool

  postInstall = ''
    wrapProgram "$out/bin/bf_tar" --prefix PATH : "${lib.makeBinPath [ pax ]}"
  '';

  meta = {
    homepage = "http://bogofilter.sourceforge.net/";
    longDescription = ''
      Bogofilter is a mail filter that classifies mail as spam or ham
      (non-spam) by a statistical analysis of the message's header and
      content (body).  The program is able to learn from the user's
      classifications and corrections.  It is based on a Bayesian
      filter.
    '';
    license = lib.licenses.gpl2;
    platforms = lib.platforms.linux;
  };
}