OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/spamassassin?expand=0&rev=114
296 lines
10 KiB
RPMSpec
296 lines
10 KiB
RPMSpec
#
|
|
# spec file for package spamassassin
|
|
#
|
|
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
|
|
#
|
|
# All modifications and additions to the file contributed by third parties
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
# upon. The license for this file, and modifications and additions to the
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
# license for the pristine package is not an Open Source License, in which
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
# published by the Open Source Initiative.
|
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
#
|
|
|
|
|
|
#Compat macro for new _fillupdir macro introduced in Nov 2017
|
|
%if ! %{defined _fillupdir}
|
|
%define _fillupdir /var/adm/fillup-templates
|
|
%endif
|
|
|
|
%define ix_version 2.05
|
|
%define spd_version 2.42
|
|
# http://www.worlddesign.com/index.cfm/rd/mta/spampd.htm
|
|
|
|
%define IXHASH iXhash2-%{ix_version}
|
|
%define SPAMPD spampd-%{spd_version}
|
|
|
|
Name: spamassassin
|
|
Summary: Extensible email filter which is used to identify spam
|
|
License: Apache-2.0
|
|
Group: Productivity/Networking/Email/Utilities
|
|
Version: 3.4.1
|
|
Release: 0
|
|
%define sa_version 3.4.1
|
|
%define rules_revision 1675274
|
|
Url: http://spamassassin.org/
|
|
Source: http://apache.mirrors.hoobly.com//spamassassin/source/Mail-SpamAssassin-%{version}.tar.bz2
|
|
Source1: http://apache.mirrors.hoobly.com//spamassassin/source/Mail-SpamAssassin-rules-%{version}.r%{rules_revision}.tgz
|
|
Source2: %{IXHASH}.tar.gz
|
|
Source3: %{SPAMPD}.tar.bz2
|
|
Source10: local.cf
|
|
Source12: sysconfig.spamd
|
|
Source14: sysconfig.spampd
|
|
Source15: suse.cron-sa-update
|
|
Source16: spamd.service
|
|
Source17: spampd.service
|
|
Patch1: patch-PgSQL
|
|
Patch2: patch-URIDNSBL
|
|
Patch3: patch-SQL_ASCII_SORT
|
|
Patch6: bnc#582111.diff
|
|
Patch7: spampd-2.42_git_20170226.patch
|
|
Patch10: iXhash2-meta-rules.patch
|
|
# add OpenSSL 1.1 support
|
|
# PATCH-FIX-UPSTREAM https://svn.apache.org/viewvc?view=revision&revision=1806555
|
|
Patch11: 0001-bug-7361-Allow-building-against-OpenSSL-1.1.0.patch
|
|
# PATCH-FIX-SUSE don't use deprecated SSLv3_client_method
|
|
Patch12: spamassassin-dont_use_SSLv3_methods.patch
|
|
# PATCH-FIX-UPSTREAM https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7367
|
|
Patch13: 0001-Fix-bug-7367-Don-t-assume-cwd-.-is-in-INC-it-may-be-.patch
|
|
# PATCH-FIX-UPSTREAM https://bz.apache.org/SpamAssassin/attachment.cgi?id=5314
|
|
Patch14: DNS-resolver-recursion-desired-not-set.patch
|
|
# PATCH-FIX-UPSTREAM https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7404
|
|
Patch15: deprecated-regex.patch
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
%{perl_requires}
|
|
PreReq: %fillup_prereq
|
|
BuildRequires: dos2unix
|
|
BuildRequires: openssl-devel
|
|
#
|
|
Requires: perl-IO-Socket-INET6
|
|
Requires: perl-Mail-DKIM
|
|
Requires: perl-Mail-SpamAssassin = %version
|
|
Requires: re2c
|
|
Requires: perl(Net::Server::PreForkSimple)
|
|
BuildRequires: systemd
|
|
%{?systemd_requires}
|
|
|
|
%description
|
|
spamassassin adds a header line that shows if the mail has been
|
|
determined spam or not. This way, you can decide what to do with the
|
|
mail within the scope of your own filtering rules in your MUA (Mail
|
|
User Agent, your mail program) or your LDA (Local Delivery Agent).
|
|
|
|
See the files in the documentation directory
|
|
/usr/share/doc/packages/spamassassin/ for more information on how to
|
|
use the filter.
|
|
|
|
%package -n perl-Mail-SpamAssassin
|
|
Summary: Perl Modules For Using Spamassassin Within An Own Perl Script
|
|
Group: Development/Libraries/Perl
|
|
BuildRequires: perl
|
|
BuildRequires: perl-Error
|
|
BuildRequires: perl(Archive::Tar) >= 1.23
|
|
BuildRequires: perl(Digest::SHA1)
|
|
BuildRequires: perl(Errno)
|
|
BuildRequires: perl(File::Copy) >= 2.02
|
|
BuildRequires: perl(File::Spec) >= 0.8
|
|
BuildRequires: perl(HTML::Parser) >= 3.43
|
|
BuildRequires: perl(IO::Zlib) >= 1.04
|
|
BuildRequires: perl(Mail::DKIM) >= 0.37
|
|
BuildRequires: perl(Net::DNS) >= 0.34
|
|
BuildRequires: perl(NetAddr::IP) >= 4.000
|
|
BuildRequires: perl(Pod::Usage) >= 1.10
|
|
BuildRequires: perl(Sys::Hostname)
|
|
BuildRequires: perl(Time::HiRes)
|
|
BuildRequires: perl(Time::Local)
|
|
# optional, but want them for build (test)
|
|
BuildRequires: perl(DBI)
|
|
BuildRequires: perl(Encode::Detect)
|
|
BuildRequires: perl(IO::Socket::INET6)
|
|
BuildRequires: perl(IO::Socket::SSL)
|
|
BuildRequires: perl(IP::Country)
|
|
BuildRequires: perl(Mail::SPF)
|
|
BuildRequires: perl(Net::Ident)
|
|
BuildRequires: perl(Razor2::Client::Agent) >= 2.61
|
|
#
|
|
Requires: perl-libwww-perl
|
|
Requires: perl(Archive::Tar) >= 1.23
|
|
Requires: perl(Digest::SHA1)
|
|
Requires: perl(Errno)
|
|
Requires: perl(File::Copy) >= 2.02
|
|
Requires: perl(File::Spec) >= 0.8
|
|
Requires: perl(HTML::Parser) >= 3.43
|
|
Requires: perl(IO::Socket::IP)
|
|
Requires: perl(IO::Zlib) >= 1.04
|
|
Requires: perl(Mail::DKIM) >= 0.37
|
|
Requires: perl(Net::DNS) >= 0.34
|
|
Requires: perl(NetAddr::IP) >= 4.010
|
|
Requires: perl(Pod::Usage) >= 1.10
|
|
Requires: perl(Sys::Hostname)
|
|
Requires: perl(Time::HiRes)
|
|
Requires: perl(Time::Local)
|
|
# optional
|
|
Recommends: perl(Mail::SPF)
|
|
Recommends: perl(Net::Patricia)
|
|
Recommends: perl(Razor2::Client::Agent) >= 2.61
|
|
Recommends: perl(IO::Socket::INET6)
|
|
Recommends: perl(IO::Socket::SSL)
|
|
Recommends: perl(DBI)
|
|
Recommends: perl(Encode::Detect)
|
|
Recommends: cron
|
|
Provides: perl-spamassassin = %version
|
|
Obsoletes: perl-spamassassin < %version
|
|
|
|
%description -n perl-Mail-SpamAssassin
|
|
This package contains the perl modules for the spamassassin, including
|
|
the filter rules. This package is required for the package
|
|
"spamassassin", the commandline tool.
|
|
|
|
%package -n perl-Mail-SpamAssassin-Plugin-iXhash2
|
|
Summary: The iXhash plugin for SpamAssassin
|
|
Group: Development/Libraries/Perl
|
|
Requires: perl-Mail-SpamAssassin = %version
|
|
Requires: perl(Digest::MD5)
|
|
Version: %{ix_version}
|
|
Release: 0
|
|
Provides: perl-Mail-SpamAssassin-Plugin-iXhash = %{ix_version}
|
|
Obsoletes: perl-Mail-SpamAssassin-Plugin-iXhash < 2
|
|
%{perl_requires}
|
|
|
|
%description -n perl-Mail-SpamAssassin-Plugin-iXhash2
|
|
This archive contains the iXhash2 plugin for the SpamAssassin spam filtering
|
|
software, along with an example config file.
|
|
|
|
Basically the plugin provides a network-based test just as razor2, pyzor
|
|
and DCC do. Working solely on the body of an email, it removes parts of it
|
|
and computes a hash value from the rest. These values will then be looked up
|
|
via DNS using the domains given in the config file(s). You need Net::DNS and
|
|
Digest::MD5 installed
|
|
|
|
%prep
|
|
%setup -q -n Mail-SpamAssassin-%{sa_version} -a 2 -a 3
|
|
%patch1 -p0
|
|
%patch2 -p1
|
|
%patch3 -p0
|
|
%patch6 -p0
|
|
%patch7 -p0
|
|
%patch10 -p0
|
|
%patch11 -p1
|
|
%patch12 -p1
|
|
%patch13 -p1
|
|
%patch14 -p1
|
|
%patch15 -p2
|
|
|
|
%build
|
|
if [ -e t/data/whitelists/winxpnews.com ]; then
|
|
echo "t/data/whitelists/winxpnews.com is not allowed to be distributed."
|
|
echo "see #102221"
|
|
#exit -1 # hidden bug description, so I can't see there - ignored
|
|
fi;
|
|
if [ -e build/cf_to_html ]; then
|
|
echo "build/cf_to_html is not allowed to be distributed."
|
|
echo "see #102221"
|
|
#exit -1 # hidden bug description, so I can't see there - ignored
|
|
fi;
|
|
|
|
export CFLAGS="%{optflags}"
|
|
perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}" \
|
|
CONTACT_ADDRESS="postmaster" ENABLE_SSL="yes"
|
|
|
|
make
|
|
|
|
%check
|
|
# fails now... FIGURE out why
|
|
#make test
|
|
|
|
%install
|
|
## perl-Mail-SpamAssassin stuff
|
|
%perl_make_install
|
|
%perl_process_packlist
|
|
%perl_gen_filelist
|
|
# remove %%{_bindir} from filelist
|
|
sed -i -e "/\/usr\/bin/d" %{name}.files
|
|
# package only %%{_mandir}/man3
|
|
sed -i -e "s,%{_mandir}/man?,%{_mandir}/man3," %{name}.files
|
|
#
|
|
## perl-Mail-SpamAssassin-Plugin-iXhash2 stuff
|
|
install -d %{buildroot}/etc/mail/spamassassin
|
|
cp %{IXHASH}/iXhash2.pm %{buildroot}/%{perl_vendorlib}/Mail/SpamAssassin/Plugin
|
|
cp %{IXHASH}/iXhash2.cf %{buildroot}/etc/mail/spamassassin/iXhash2.cf
|
|
#
|
|
## spamassassin stuff
|
|
install -d %{buildroot}/etc/cron.daily/
|
|
install -m 0755 %{S:15} %{buildroot}/etc/cron.daily/
|
|
install -D -m0755 %{SPAMPD}/spampd.pl %{buildroot}/%{_sbindir}/spampd
|
|
mv %{buildroot}/%{_bindir}/spamd %{buildroot}/%{_sbindir}/
|
|
install -m 0644 %{S:10} %{buildroot}/etc/mail/spamassassin/local.cf
|
|
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rcspamd
|
|
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rcspampd
|
|
echo "Most of the documentation is at ../perl-Mail-SpamAssassin/." > README.SUSE
|
|
install -D -m 0640 %{S:12} %{buildroot}/%{_fillupdir}/sysconfig.spamd
|
|
install -m 0640 %{S:14} %{buildroot}/%{_fillupdir}/
|
|
test -f %{buildroot}/usr/share/spamassassin/user_prefs.template || {
|
|
echo "MakeMaker is broken again..."
|
|
exit 1
|
|
}
|
|
install -d %{buildroot}/usr/share/spamassassin
|
|
pushd %{buildroot}/usr/share/spamassassin && tar -xjf %{S:1} && popd
|
|
|
|
## systemd stuff
|
|
mkdir -p %{buildroot}/%{_unitdir}
|
|
install -D -m 644 %{S:16} %{buildroot}/%{_unitdir}
|
|
install -D -m 644 %{S:17} %{buildroot}/%{_unitdir}
|
|
|
|
%post
|
|
%service_add_post spamd.service
|
|
%service_add_post spampd.service
|
|
%{fillup_only -n spamd}
|
|
%{fillup_only -n spampd}
|
|
|
|
%pre
|
|
%service_add_pre spamd.service
|
|
%service_add_pre spampd.service
|
|
|
|
%preun
|
|
%service_del_preun spamd.service
|
|
%service_del_preun spampd.service
|
|
|
|
%postun
|
|
%service_del_postun spamd.service
|
|
%service_del_postun spampd.service
|
|
|
|
%files
|
|
%defattr(-,root,root)
|
|
%doc spamd/README* spamd/PROTOCOL
|
|
%doc %{_mandir}/man1/*
|
|
%{_bindir}/*
|
|
%{_sbindir}/*
|
|
%{_fillupdir}/sysconfig.spamd
|
|
%{_fillupdir}/sysconfig.spampd
|
|
%{_unitdir}/spamd.service
|
|
%{_unitdir}/spampd.service
|
|
|
|
%files -n perl-Mail-SpamAssassin -f %{name}.files
|
|
%defattr(-,root,root)
|
|
%doc CREDITS Changes LICENSE MANIFEST* NOTICE PACKAGING README
|
|
%doc TRADEMARK UPGRADE USAGE sample-nonspam.txt sample-spam.txt
|
|
%doc ldap sql
|
|
%dir /etc/mail
|
|
%config(noreplace) /etc/mail/spamassassin
|
|
%config(noreplace) /etc/cron.daily/suse.cron-sa-update
|
|
%exclude /etc/mail/spamassassin/iXhash2.cf
|
|
%dir /usr/share/spamassassin
|
|
/usr/share/spamassassin/*
|
|
|
|
%files -n perl-Mail-SpamAssassin-Plugin-iXhash2
|
|
%defattr(-,root,root)
|
|
%doc %{IXHASH}/CHANGELOG %{IXHASH}/LICENSE %{IXHASH}/README
|
|
%config(noreplace) /etc/mail/spamassassin/iXhash2.cf
|
|
%{perl_vendorlib}/Mail/SpamAssassin/Plugin/iXhash2.pm
|
|
|
|
%changelog
|