spamassassin: install default rules
This lets spamassassin work as normal out of the box, without having to invoke sa-update first.
This commit is contained in:
parent
938380b329
commit
ab9c08b9ed
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user