diff options
author | Dan Callaghan <djc@djc.id.au> | 2023-09-21 20:49:14 +1000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2023-09-22 09:17:01 +0000 |
commit | ab9c08b9ed789ac072ef66eefcbe316ef069b1e4 (patch) | |
tree | b38a2364bf2fb2bdbfd27d9d455e0e0f7b4017f1 /pkgs/servers/mail/spamassassin | |
parent | 938380b329405d770c767357e8ced0349666aab6 (diff) |
spamassassin: install default rules
This lets spamassassin work as normal out of the box, without having to
invoke sa-update first.
Diffstat (limited to 'pkgs/servers/mail/spamassassin')
-rw-r--r-- | pkgs/servers/mail/spamassassin/default.nix | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/pkgs/servers/mail/spamassassin/default.nix b/pkgs/servers/mail/spamassassin/default.nix index 95b613f0b478..8e9aee8ad986 100644 --- a/pkgs/servers/mail/spamassassin/default.nix +++ b/pkgs/servers/mail/spamassassin/default.nix @@ -3,11 +3,16 @@ perlPackages.buildPerlPackage rec { pname = "SpamAssassin"; version = "4.0.0"; + rulesRev = "r1905950"; src = fetchurl { url = "mirror://apache/spamassassin/source/Mail-${pname}-${version}.tar.bz2"; hash = "sha256-5aoXBQowvHK6qGr9xgSMrepNHsLsxh14dxegWbgxnog="; }; + defaultRulesSrc = fetchurl { + url = "mirror://apache/spamassassin/source/Mail-${pname}-rules-${version}.${rulesRev}.tgz"; + hash = "sha256-rk/7uRfrx/76ckD8W7UVHdpmP45AWRYa18m0Lu0brG0="; + }; patches = [ ./satest-no-clean-path.patch @@ -53,6 +58,10 @@ perlPackages.buildPerlPackage rec { mkdir -p $out/share/spamassassin mv "rules/"* $out/share/spamassassin/ + tar -xzf ${defaultRulesSrc} -C $out/share/spamassassin/ + local moduleversion="$(${perlPackages.perl}/bin/perl -I lib -e 'use Mail::SpamAssassin; print $Mail::SpamAssassin::VERSION')" + sed -i -e "s/@@VERSION@@/$moduleversion/" $out/share/spamassassin/*.cf + for n in "$out/bin/"*; do # Skip if this isn't a perl script if ! head -n1 "$n" | grep -q bin/perl; then |