2 # - build lib{,ssl}spamc.so (if there is a point)
3 # - sa-check_spamd into nagios-plugin-check_spamd subpackage
6 %bcond_without tests # do not perform "make test"
9 %define pnam SpamAssassin
10 %define sa_version %(printf %d.%03d%03d $(echo %{version} | tr '.' ' '))
11 %include /usr/lib/rpm/macros.perl
12 Summary: A spam filter for email which can be invoked from mail delivery agents
13 Summary(pl.UTF-8): Filtr antyspamowy, przeznaczony dla programów dostarczających pocztę (MDA)
18 Group: Applications/Mail
19 Source0: http://ftp.ps.pl/pub/apache//spamassassin/source/%{pdir}-%{pnam}-%{version}.tar.bz2
20 # Source0-md5: 0db5d27d7b782ff5eadee12b95eae84c
21 Source1: %{name}.sysconfig
22 Source2: %{name}-spamd.init
23 Source3: %{name}-default.rc
24 Source4: %{name}-spamc.rc
26 Source6: sa-update.cron
27 Source7: spamassassin-official.conf
29 Source9: cronjob-sa-update.service
30 Source10: cronjob-sa-update.timer
31 Patch0: spamassassin-3.4.1-netdns.patch
32 Patch1: %{name}-perl-fix.patch
33 Patch2: bug_771408_perl_version
34 Patch3: bug_828552-openssl-1.1.0
35 Patch4: bug-869408-unescaped-brace-in-regex.patch
37 Patch6: dkim_subdomains
38 Patch7: fix-uninitialized-concat
39 URL: http://spamassassin.apache.org/
40 BuildRequires: openssl-devel >= 0.9.7d
41 BuildRequires: perl(ExtUtils::MakeMaker) >= 6.16
42 BuildRequires: perl-Archive-Tar
43 BuildRequires: perl-DBI
44 BuildRequires: perl-DB_File
45 BuildRequires: perl-Digest-SHA1 >= 2.10
46 BuildRequires: perl-HTML-Parser >= 3
47 BuildRequires: perl-IO-Socket-INET6 >= 2.51
48 BuildRequires: perl-IO-Socket-SSL
49 BuildRequires: perl-IO-Zlib
50 BuildRequires: perl-IP-Country
51 BuildRequires: perl-Mail-SPF-Query
52 BuildRequires: perl-Net-DNS >= 0.65-3
53 BuildRequires: perl-Net-Ident
54 BuildRequires: perl-NetAddr-IP >= 4.000
55 #BuildRequires: perl-Razor2
56 BuildRequires: perl-devel >= 1:5.8.0
57 BuildRequires: perl-libwww
59 BuildRequires: rpm-perlprov >= 4.1-13
60 BuildRequires: rpmbuild(macros) >= 1.453
62 # are these really needed?
63 #BuildRequires: perl-Compress-Zlib
64 BuildRequires: perl-Encode-Detect
65 BuildRequires: perl-MIME-Base64
66 BuildRequires: perl-MIME-tools
67 BuildRequires: perl-Mail-DKIM
68 BuildRequires: perl-Mail-DomainKeys
69 BuildRequires: perl-Mail-SPF
70 BuildRequires: perl-MailTools
71 BuildRequires: perl-Razor > 2.61
73 Requires: perl-Mail-SpamAssassin = %{version}-%{release}
74 Obsoletes: SpamAssassin
75 Obsoletes: spamassassin-tools
76 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
78 %define _noautoreq 'perl(Razor2::Client::Agent)' 'perl(Razor::Agent)' 'perl(Razor::Client)' 'perl(DBI)' 'perl(Net::Ident)'
81 Apache SpamAssassin provides you with a way to reduce if not
82 completely eliminate Unsolicited Commercial Email (SPAM) from your
83 incoming email. It can be invoked by a MDA such as sendmail or
84 postfix, or can be called from a procmail script, .forward file, etc.
85 It uses a genetic-algorithm evolved scoring system to identify
86 messages which look spammy, then adds headers to the message so they
87 can be filtered by the user's mail reading software. This distribution
88 includes the spamd/spamc components which create a server that
89 considerably speeds processing of mail.
91 To enable spamassassin, if you are receiving mail locally, simply add
92 this line to your ~/.procmailrc:
93 INCLUDERC=/etc/mail/spamassassin/spamassassin-default.rc
95 To filter spam for all users, add that line to /etc/procmailrc
96 (creating if necessary).
98 %description -l pl.UTF-8
99 Apache SpamAssassin daje możliwość zredukowania, jeśli nie kompletnego
100 wyeliminowania niezamawianej komercyjnej poczty (Unsolicited
101 Commercial Email, spamu) z poczty. Może być wywoływany z MDA, np.
102 Sendmaila czy Postfiksa, lub z pliku ~/.forward itp. Używa ogólnego
103 algorytmu oceniania w celu identyfikacji wiadomości, które wyglądają
104 na SPAM, po czym dodaje nagłówki do wiadomości, umożliwiając
105 filtrowanie przez oprogramowanie użytkownika. Ta dystrybucja zawiera
106 programy spamd/spamc, umożliwiające uruchomienie serwera, co znacznie
107 przyspieszy proces przetwarzania poczty.
109 Aby uruchomić spamassassina dla lokalnie przychodzącej poczty,
110 wystarczy dodać do własnego ~/.procmailrc linię:
111 INCLUDERC=/etc/mail/spamassassin/spamassassin-default.rc
113 Aby filtrować spam dla wszystkich użytkowników, należy dodać tę linię
114 do pliku /etc/procmailrc (tworząc go w razie potrzeby).
117 Summary: spamd - daemonized version of spamassassin
118 Summary(pl.UTF-8): spamd - spamassassin w postaci demona
119 Group: Applications/Mail
120 Requires(post,preun): /sbin/chkconfig
121 Requires: perl-Mail-SpamAssassin = %{version}-%{release}
123 Suggests: perl-Apache-Test
124 Suggests: perl-IO-Socket-IP
125 Suggests: perl-IO-Socket-SSL
126 Suggests: perl-IO-Socket-INET6
127 Suggests: perl-Net-Ident
130 The purpose of this program is to provide a daemonized version of the
131 spamassassin executable. The goal is improving throughput performance
132 for automated mail checking.
134 This is intended to be used alongside "spamc", a fast, low-overhead C
137 %description spamd -l pl.UTF-8
138 Spamd jest "demoniczną" wersją spamassassina. Jego zadaniem jest
139 poprawa wydajności automatycznego sprawdzania poczty.
141 Spamd powinien być używany wespół ze "spamc", który jest szybkim i
142 wydajnym programem klienckim.
145 Summary: spamc - client for spamd
146 Summary(pl.UTF-8): spamc - klient dla spamd
147 Group: Applications/Mail
148 Suggests: perl-Compress-Zlib
151 Spamc is the client half of the spamc/spamd pair. It should be used in
152 place of "spamassassin" in scripts to process mail. It will read the
153 mail from STDIN, and spool it to its connection to spamd, then read
154 the result back and print it to STDOUT. Spamc has extremely low
155 overhead in loading, so it should be much faster to load than the
156 whole spamassassin program.
158 To enable spamassassin, if you are receiving mail locally, simply add
159 this line to your ~/.procmailrc:
160 INCLUDERC=/etc/mail/spamassassin/spamassassin-spamc.rc
162 To filter spam for all users, add that line to /etc/procmailrc
163 (creating if necessary).
165 %description spamc -l pl.UTF-8
166 Spamc powinien być używany zamiast "spamassassina" w skryptach
167 przetwarzających pocztę. Zczytuje pocztę ze STDIN, kolejkuje ją a
168 następnie przekazuje spamdowi, odczytuje wynik i podaje go na STDOUT.
169 Spamc stara się nie obciążać zbytnio procesora podczas ładowania,
170 dzięki czemu powinien działać szybciej niż sam spamassassin.
172 Aby uruchomić spamassassina dla lokalnie przychodzącej poczty,
173 wystarczy dodać do własnego ~/.procmailrc linię:
174 INCLUDERC=/etc/mail/spamassassin/spamassassin-spamc.rc
176 Aby filtrować spam dla wszystkich użytkowników, należy dodać tę linię
177 do pliku /etc/procmailrc (tworząc go w razie potrzeby).
180 Summary: sa-compile - compile SpamAssassin ruleset into native code
181 Summary(pl.UTF-8): sa-compile - kompilowanie reguł SpamAssasina do kodu natywnego
182 Group: Applications/Mail
184 Requires: glibc-devel
186 Requires: perl(ExtUtils::MakeMaker)
187 Requires: perl-Mail-SpamAssassin = %{version}-%{release}
189 Requires: re2c >= 0.10
192 sa-compile uses "re2c" to compile the SpamAssassin ruleset. This is
193 then used by the "Mail::SpamAssassin::Plugin::Rule2XSBody" plugin to
194 speed up SpamAssassin's operation, where possible, and when that
197 %description compile -l pl.UTF-8
198 sa-compile wykorzystuje re2c do kompilacji reguł SpamAssassina. Służy
199 to do przyspieszenia operacji SpamAssassina w miarę możliwości, kiedy
200 ta wtyczka jest wczytana.
203 Summary: sa-update - automate SpamAssassin rule updates
204 Summary(pl.UTF-8): sa-update - automatyczne uaktualnianie regułek SpamAssassina
205 Group: Applications/Mail
208 Requires: perl-Archive-Tar
209 Requires: perl-Mail-SpamAssassin = %{version}-%{release}
210 Requires: perl-libwww
213 sa-update automates the process of downloading and installing new
214 rules and configuration, based on channels. The default channel is
215 updates.spamassassin.org, which has updated rules since the previous
218 Update archives are verified by default using SHA1 hashes and GPG
221 %description update -l pl.UTF-8
222 sa-update automatyzuje proces ściągania i instalowania nowych regułek
223 i konfiguracji w oparciu o kanały. Domyślny kanał to
224 updates.spamassassin.org, który ma uaktualnione regułki od czasu
225 poprzedniego wydania.
227 Archiwa uaktualnień są sprawdzane domyślnie przy użyciu skrótów SHA1 i
230 %package -n perl-Mail-SpamAssassin
231 Summary: Mail::SpamAssassin - SpamAssassin e-mail filter libraries
232 Summary(pl.UTF-8): Mail::SpamAssassin - biblioteki filtra poczty SpamAssassin
233 Group: Development/Languages/Perl
234 Requires: perl-HTML-Parser >= 3
236 #Requires: perl-Sys-Hostname-Long
238 Suggests: perl-Cache-DB_File >= 0.2
239 Suggests: perl-DBD-mysql
240 Suggests: perl-Encode-Detect
241 Suggests: perl-Geo-IP
242 Suggests: perl-IO-Socket-INET6 >= 2.51
243 Suggests: perl-IP-Country
244 Suggests: perl-Mail-DKIM
245 #Suggests: perl-Mail-DomainKeys
246 #Suggests: perl-Mail-SPF
247 Suggests: perl-Mail-SPF-Query
248 Suggests: perl-Net-DNS >= 0.34
249 Suggests: perl-Net-Patricia
250 Suggests: spamassassin-compile
251 Suggests: spamassassin-plugin-fuzzyocr
252 Suggests: spamassassin-update
254 %description -n perl-Mail-SpamAssassin
255 Mail::SpamAssassin is a Mail::Audit plugin to identify spam using text
256 analysis and several internet-based realtime blacklists. Using its
257 rule base, it uses a wide range of heuristic tests on mail headers and
258 body text to identify ``spam'', also known as unsolicited commercial
259 email. Once identified, the mail can then be optionally tagged as spam
260 for later filtering using the user's own mail user-agent application.
262 %description -n perl-Mail-SpamAssassin -l pl.UTF-8
263 Mail::SpamAssassin jest pluginem dla Mail::Audit, służącym do
264 identyfikacji spamu przy użyciu analizy zawartości i/lub internetowych
265 czarnych list. Do zidentyfikowania jako ,,spam'' stosuje szeroki
266 zakres testów heurystycznych na nagłówkach i treści, posiłkując się
267 stworzoną wcześniej bazą reguł. Po zidentyfikowaniu, poczta może być
268 oznaczona jako spam w celu późniejszego wyfiltrowania, np. przy użyciu
269 aplikacji do czytania poczty.
272 %setup -q -n %{pdir}-%{pnam}-%{version}
282 # disable broken test
283 %{__mv} t/sa_compile.t{,.disabled}
285 # this test needs network, does not work on builders
286 %{__mv} t/dnsbl_subtests.t{,.disabled}
289 # for spamc/configure
290 export CFLAGS="%{rpmcflags}"
291 %{__perl} Makefile.PL \
294 SYSCONFDIR=%{_sysconfdir} \
295 DATADIR=%{_datadir}/spamassassin \
297 CONTACT_ADDRESS="postmaster@localhost" \
298 PERL_BIN=%{__perl} < /dev/null
302 OPTIMIZE="%{rpmcflags}"
304 %{__sed} -e "s,@@LOCAL_STATE_DIR@@,$(pwd)," sa-compile.raw > sa-compile.pl
305 %{__perl} -T sa-compile.pl --siteconfigpath=rules
307 %{?with_tests:%{__make} -j1 TEST_VERBOSE=1 test}
310 rm -rf $RPM_BUILD_ROOT
311 install -d $RPM_BUILD_ROOT{/etc/{cron.d,sysconfig,rc.d/init.d},%{_sysconfdir}/mail/spamassassin/channel.d}
314 DESTDIR=$RPM_BUILD_ROOT
316 install %{SOURCE1} $RPM_BUILD_ROOT/etc/sysconfig/spamd
317 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/spamd
318 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin
319 install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin
320 install %{SOURCE5} $RPM_BUILD_ROOT%{_datadir}/spamassassin/sa-update.cron
321 install %{SOURCE6} $RPM_BUILD_ROOT/etc/cron.d/sa-update
322 install %{SOURCE7} $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin/channel.d
323 install %{SOURCE8} $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin/channel.d
325 # sa-update, sa-compile
326 install -d $RPM_BUILD_ROOT/var/lib/spamassassin/{%{sa_version},compiled/%{sa_version}}
327 install -d $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin/sa-update-keys
328 touch $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin/sa-update-keys/{pubring,secring,trustdb}.gpg
330 rm -f $RPM_BUILD_ROOT{%{perl_archlib}/perllocal.pod,%{perl_vendorarch}/auto/Mail/SpamAssassin/.packlist,%{_mandir}/man3/spamassassin-run.*}
332 cat > $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin/channels << 'EOF'
333 # Use %{_sysconfdir}/mail/spamassassin/channel.d/*.conf for new channels
337 rm -rf $RPM_BUILD_ROOT
340 /sbin/chkconfig --add spamd
341 %service spamd restart
344 if [ "$1" = "0" ]; then
346 /sbin/chkconfig --del spamd
349 %triggerpostun spamd -- spamassassin-spamd < 3.1.0-5.3
350 # temp hack, should we care of the dead link?
351 ln -s spamd /etc/rc.d/init.d/spamassassin
352 /sbin/chkconfig --del spamassassin
353 rm -f /etc/rc.d/init.d/spamassassin
354 if [ -f /etc/sysconfig/spamassassin.rpmsave ]; then
355 mv -f /etc/sysconfig/spamassassin.rpmsave /etc/sysconfig/spamd
359 %defattr(644,root,root,755)
360 %doc CREDITS Changes INSTALL README TRADEMARK UPGRADE USAGE
361 %doc procmailrc.example sql/ ldap/
362 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/spamassassin/spamassassin-default.rc
363 %attr(755,root,root) %{_bindir}/sa-learn
364 %attr(755,root,root) %{_bindir}/sa-awl
365 %attr(755,root,root) %{_bindir}/spamassassin
366 %attr(755,root,root) %{_bindir}/sa-check_spamd
368 # It's needed for help of spamassassin command.
369 %{perl_vendorlib}/spamassassin-run.pod
370 %{_mandir}/man1/sa-learn.1*
371 %{_mandir}/man1/spamassassin.1*
372 %{_mandir}/man1/spamassassin-run.1*
373 %{_mandir}/man1/sa-awl.1*
376 %defattr(644,root,root,755)
378 %attr(754,root,root) /etc/rc.d/init.d/spamd
379 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/spamd
380 %attr(755,root,root) %{_bindir}/spamd
381 %{_mandir}/man1/spamd.1*
384 %defattr(644,root,root,755)
385 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/spamassassin/spamassassin-spamc.rc
386 %attr(755,root,root) %{_bindir}/spamc
387 %{_mandir}/man1/spamc.1*
390 %defattr(644,root,root,755)
391 %attr(755,root,root) %{_bindir}/sa-compile
392 %{_mandir}/man1/sa-compile.1*
393 %dir /var/lib/spamassassin/compiled
394 %dir /var/lib/spamassassin/compiled/%{sa_version}
397 %defattr(644,root,root,755)
398 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/spamassassin/channels
399 %dir %{_sysconfdir}/mail/spamassassin/channel.d
400 %{_sysconfdir}/mail/spamassassin/channel.d/spamassassin-official.conf
401 %{_sysconfdir}/mail/spamassassin/channel.d/sought.conf
402 %attr(700,root,root) %dir %{_sysconfdir}/mail/spamassassin/sa-update-keys
403 %attr(700,root,root) %ghost %{_sysconfdir}/mail/spamassassin/sa-update-keys/*
404 %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/sa-update
405 %attr(755,root,root) %{_bindir}/sa-update
406 %attr(755,root,root) %{_datadir}/spamassassin/sa-update.cron
407 %{_datadir}/spamassassin/sa-update-pubkey.txt
408 %dir /var/lib/spamassassin/%{sa_version}
409 %{_mandir}/man1/sa-update.1*
411 %files -n perl-Mail-SpamAssassin
412 %defattr(644,root,root,755)
413 %doc sample-nonspam.txt sample-spam.txt
414 %dir %{_sysconfdir}/mail/spamassassin
415 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/spamassassin/*.pre
416 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/spamassassin/*.cf
417 %exclude %{_sysconfdir}/mail/spamassassin/sa-update-keys
418 %dir %{_datadir}/spamassassin
419 %config(noreplace) %{_datadir}/spamassassin/languages
420 %config(noreplace) %{_datadir}/spamassassin/user_prefs.template
421 %exclude %{_datadir}/spamassassin/sa-update-pubkey.txt
423 %dir /var/lib/spamassassin
425 %{perl_vendorlib}/Mail/*