<commit_before>{ stdenv, fetchurl, buildPerlPackage, perl, HTMLParser, NetDNS, NetAddrIP, DBFile
, HTTPDate, MailDKIM, makeWrapper
}:

# TODO:
#
#  - Mail::SPF
#  - IP::Country
#  - Razor2
#  - Net::Ident
#  - DBI
#  - LWP::UserAgent
#  - Encode::Detect

buildPerlPackage rec {
  name = "SpamAssassin-3.3.2";

  src = fetchurl {
    url = "http://apache.imsam.info/spamassassin/source/Mail-${name}.tar.bz2";
    sha256 = "01d2jcpy423zfnhg123wlhzysih1hmb93nxfspiaajzh9r5rn8y7";
  };

  buildInputs = [ makeWrapper HTMLParser NetDNS NetAddrIP DBFile HTTPDate
    MailDKIM ];

  # Enabling 'taint' mode is desirable, but that flag disables support
  # for the PERL5LIB environment variable. Needs further investigation.
  makeFlags = "PERL_BIN=${perl}/bin/perl PERL_TAINT=no";

  doCheck = false;

  postInstall = ''
    for n in "$out/bin/"*; do
      wrapProgram "$n" --prefix PERL5LIB : "$PERL5LIB"
    done
  '';<commit_msg>spamassassin: site-wide rules are in $out/share/spamassassin; user-rules in /etc/spamassassin<commit_after>{ stdenv, fetchurl, buildPerlPackage, perl, HTMLParser, NetDNS, NetAddrIP, DBFile
, HTTPDate, MailDKIM, makeWrapper
}:

# TODO:
#
#  - Mail::SPF
#  - IP::Country
#  - Razor2
#  - Net::Ident
#  - DBI
#  - LWP::UserAgent
#  - Encode::Detect

buildPerlPackage rec {
  name = "SpamAssassin-3.3.2";

  src = fetchurl {
    url = "http://apache.imsam.info/spamassassin/source/Mail-${name}.tar.bz2";
    sha256 = "01d2jcpy423zfnhg123wlhzysih1hmb93nxfspiaajzh9r5rn8y7";
  };

  buildInputs = [ makeWrapper HTMLParser NetDNS NetAddrIP DBFile HTTPDate
    MailDKIM ];

  # Enabling 'taint' mode is desirable, but that flag disables support
  # for the PERL5LIB environment variable. Needs further investigation.
  makeFlags = "PERL_BIN=${perl}/bin/perl PERL_TAINT=no";

  makeMakerFlags = "CONFDIR=/etc/spamassassin LOCALSTATEDIR=/var/lib/spamassassin";

  doCheck = false;

  postInstall = ''
    mv "rules/"* $out/share/spamassassin/

    for n in "$out/bin/"*; do
      wrapProgram "$n" --prefix PERL5LIB : "$PERL5LIB"
    done
  '';
{'fraction_non_alphanumeric': 0.13313896987366375, 'fraction_numerical': 0.026239067055393587, 'mean_word_length': 3.777262180974478, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1357679', 'n_tokens_mistral': 836, 'n_tokens_neox': 801, 'n_words': 160}