LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File spamassassin.spec of Package spamassassin (Project home:pheinlein)

# spec file for package spamassassin
# Copyright (c) 2013 SUSE LINUX Products 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/

%define ix_version 2.05
%define spd_version 2.20

%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.3.2
Release:        0
%define sa_version 3.3.2
Url:            http://spamassassin.org/
Source:         http://search.cpan.org/CPAN/authors/id/K/KM/KMCGRAIL/Mail-SpamAssassin-%{version}.tar.gz
Source1:        Mail-SpamAssassin-rules-%{version}.tar.bz2
Source2:        %{IXHASH}.tar.gz
Source3:        %{SPAMPD}.tar.gz
Source10:       local.cf
Source11:       init.spamd
Source12:       sysconfig.spamd
Source13:       init.spampd
Source14:       sysconfig.spampd
Source15:       suse.cron-sa-update
Source16:       spamd.service
Source17:       spampd.service
Patch0:         patch-utf8
Patch1:         patch-PgSQL
Patch2:         patch-URIDNSBL
Patch3:         patch-SQL_ASCII_SORT
Patch6:         bnc#582111.diff
Patch10:        iXhash2-meta-rules.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
PreReq:         %insserv_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)
%if 0%{?suse_version} > 1140
BuildRequires:  systemd

%if %suse_version > 1220
%define         _unitdir /usr/lib/systemd
%define         _unitdir /lib/systemd

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-macros
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)
%if 0%{?suse_version} >= 1100
BuildRequires:  perl(Mail::SPF)
BuildRequires:  perl(DBI)
BuildRequires:  perl(Encode::Detect)
BuildRequires:  perl(IO::Socket::INET6)
BuildRequires:  perl(IO::Socket::SSL)
BuildRequires:  perl(IP::Country)
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::Zlib) >= 1.04
Requires:       perl(Mail::DKIM) >= 0.37
Requires:       perl(Net::DNS) >= 0.34
Requires:       perl(NetAddr::IP) >= 4.000
Requires:       perl(Pod::Usage) >= 1.10
Requires:       perl(Sys::Hostname)
Requires:       perl(Time::HiRes)
Requires:       perl(Time::Local)
# optional
%if 0%{?suse_version} >= 1100
Recommends:     perl(Mail::SPF)
Recommends:     perl(IP::Country)
Recommends:     perl(Razor2::Client::Agent) >= 2.61
Recommends:     perl(Net::Ident)
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
Version:        %{ix_version}
Release:        0
Provides:       perl-Mail-SpamAssassin-Plugin-iXhash = %{ix_version}
Obsoletes:      perl-Mail-SpamAssassin-Plugin-iXhash < 2

%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

%setup -q -n Mail-SpamAssassin-%{sa_version} -a 2 -a 3
%patch0 -p0
%patch1 -p0
%patch2 -p0
%patch3 -p0
%patch6 -p0
%patch10 -p0

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
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

 CONTACT_ADDRESS="postmaster" ENABLE_SSL="yes"


# fails now... FIGURE out why
#%{__make} test

## perl-Mail-SpamAssassin stuff
# 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 $RPM_BUILD_ROOT/etc/mail/spamassassin
cp %{IXHASH}/iXhash2.pm $RPM_BUILD_ROOT%{perl_vendorlib}/Mail/SpamAssassin/Plugin
cp %{IXHASH}/iXhash2.cf $RPM_BUILD_ROOT/etc/mail/spamassassin/iXhash2.cf
## spamassassin stuff
%{__install} -d $RPM_BUILD_ROOT/etc/cron.daily/
%{__install} -m 0755 %{S:15} $RPM_BUILD_ROOT/etc/cron.daily/
%{__install} -D -m0755 %{SPAMPD}/spampd $RPM_BUILD_ROOT%{_sbindir}/spampd
mv $RPM_BUILD_ROOT%{_bindir}/spamd $RPM_BUILD_ROOT%{_sbindir}/
%{__install} -m 0644 %{S:10} $RPM_BUILD_ROOT/etc/mail/spamassassin/local.cf
%{__install} -D -m 0644 %{S:11} $RPM_BUILD_ROOT/etc/init.d/spamd
%{__install} -m 0644 %{S:13} $RPM_BUILD_ROOT/etc/init.d/spampd
%{__ln_s} ../../etc/init.d/spamd $RPM_BUILD_ROOT/usr/sbin/rcspamd
%{__ln_s} ../../etc/init.d/spampd $RPM_BUILD_ROOT/usr/sbin/rcspampd
echo "Most of the documentation is at ../perl-Mail-SpamAssassin/." > README.SuSE
%{__install} -D -m 0640 %{S:12} $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.spamd
%{__install} -m 0640 %{S:14} $RPM_BUILD_ROOT/var/adm/fillup-templates/
test -f $RPM_BUILD_ROOT/usr/share/spamassassin/user_prefs.template || {
	echo "MakeMaker is broken again..."
	exit 1
%{__install} -d $RPM_BUILD_ROOT/usr/share/spamassassin
pushd $RPM_BUILD_ROOT/usr/share/spamassassin && tar -xjf %{S:1} && popd

%if 0%{?suse_version} > 1140
## systemd stuff
mkdir -p $RPM_BUILD_ROOT%{_unitdir}/system
%{__install} -m 644 %{S:16} $RPM_BUILD_ROOT%{_unitdir}/system/
%{__install} -m 644 %{S:17} $RPM_BUILD_ROOT%{_unitdir}/system/

%{fillup_and_insserv -n spamd}
%{fillup_and_insserv -n spampd}
%if %suse_version > 1140
%service_add_post spamd.service
%service_add_post spampd.service

%if %suse_version > 1140
%service_add_pre spamd.service
%service_add_pre spampd.service

%stop_on_removal spamd
%if %suse_version > 1140
%service_del_preun spamd.service
%service_del_preun spampd.service

%restart_on_update spamd
%if %suse_version > 1140
%service_del_postun spamd.service
%service_del_postun spampd.service

exit 0

%{__rm} -rf $RPM_BUILD_ROOT

%doc spamd/README* spamd/PROTOCOL
%doc %{_mandir}/man1/*
%attr(755,root,root) %{_bindir}/*
%attr(755,root,root) %{_sbindir}/*
%config %attr(744,root,root) /etc/init.d/spamd
%config %attr(744,root,root) /etc/init.d/spampd
%if 0%{?suse_version} > 1140
%config %{_unitdir}/system/spamd.service
%config %{_unitdir}/system/spampd.service

%files -n perl-Mail-SpamAssassin -f %{name}.files
%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

%files -n perl-Mail-SpamAssassin-Plugin-iXhash2
%config(noreplace) /etc/mail/spamassassin/iXhash2.cf