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: bb4d91312148192ef41e2692f5982e1d
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: bug_771408_perl_version
32 URL: http://spamassassin.apache.org/
33 BuildRequires: openssl-devel >= 0.9.7d
34 BuildRequires: perl(ExtUtils::MakeMaker) >= 6.16
35 BuildRequires: perl-Archive-Tar
36 BuildRequires: perl-DBI
37 BuildRequires: perl-DB_File
38 BuildRequires: perl-Digest-SHA1 >= 2.10
39 BuildRequires: perl-HTML-Parser >= 3
40 BuildRequires: perl-IO-Socket-INET6 >= 2.51
41 BuildRequires: perl-IO-Socket-SSL
42 BuildRequires: perl-IO-Zlib
43 BuildRequires: perl-IP-Country
44 BuildRequires: perl-Mail-SPF-Query
45 BuildRequires: perl-Net-DNS >= 0.65-3
46 BuildRequires: perl-Net-Ident
47 BuildRequires: perl-NetAddr-IP >= 4.000
48 #BuildRequires: perl-Razor2
49 BuildRequires: perl-devel >= 1:5.8.0
50 BuildRequires: perl-libwww
52 BuildRequires: rpm-perlprov >= 4.1-13
53 BuildRequires: rpmbuild(macros) >= 1.453
55 # are these really needed?
56 #BuildRequires: perl-Compress-Zlib
57 BuildRequires: perl-Encode-Detect
58 BuildRequires: perl-MIME-Base64
59 BuildRequires: perl-MIME-tools
60 BuildRequires: perl-Mail-DKIM
61 BuildRequires: perl-Mail-DomainKeys
62 BuildRequires: perl-Mail-SPF
63 BuildRequires: perl-MailTools
64 BuildRequires: perl-Razor > 2.61
66 Requires: perl-Mail-SpamAssassin = %{version}-%{release}
67 Obsoletes: SpamAssassin
68 Obsoletes: spamassassin-tools
69 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
71 %define _noautoreq 'perl(Razor2::Client::Agent)' 'perl(Razor::Agent)' 'perl(Razor::Client)' 'perl(DBI)' 'perl(Net::Ident)'
74 Apache SpamAssassin provides you with a way to reduce if not
75 completely eliminate Unsolicited Commercial Email (SPAM) from your
76 incoming email. It can be invoked by a MDA such as sendmail or
77 postfix, or can be called from a procmail script, .forward file, etc.
78 It uses a genetic-algorithm evolved scoring system to identify
79 messages which look spammy, then adds headers to the message so they
80 can be filtered by the user's mail reading software. This distribution
81 includes the spamd/spamc components which create a server that
82 considerably speeds processing of mail.
84 To enable spamassassin, if you are receiving mail locally, simply add
85 this line to your ~/.procmailrc:
86 INCLUDERC=/etc/mail/spamassassin/spamassassin-default.rc
88 To filter spam for all users, add that line to /etc/procmailrc
89 (creating if necessary).
91 %description -l pl.UTF-8
92 Apache SpamAssassin daje możliwość zredukowania, jeśli nie kompletnego
93 wyeliminowania niezamawianej komercyjnej poczty (Unsolicited
94 Commercial Email, spamu) z poczty. Może być wywoływany z MDA, np.
95 Sendmaila czy Postfiksa, lub z pliku ~/.forward itp. Używa ogólnego
96 algorytmu oceniania w celu identyfikacji wiadomości, które wyglądają
97 na SPAM, po czym dodaje nagłówki do wiadomości, umożliwiając
98 filtrowanie przez oprogramowanie użytkownika. Ta dystrybucja zawiera
99 programy spamd/spamc, umożliwiające uruchomienie serwera, co znacznie
100 przyspieszy proces przetwarzania poczty.
102 Aby uruchomić spamassassina dla lokalnie przychodzącej poczty,
103 wystarczy dodać do własnego ~/.procmailrc linię:
104 INCLUDERC=/etc/mail/spamassassin/spamassassin-default.rc
106 Aby filtrować spam dla wszystkich użytkowników, należy dodać tę linię
107 do pliku /etc/procmailrc (tworząc go w razie potrzeby).
110 Summary: spamd - daemonized version of spamassassin
111 Summary(pl.UTF-8): spamd - spamassassin w postaci demona
112 Group: Applications/Mail
113 Requires(post,preun): /sbin/chkconfig
114 Requires: perl-Mail-SpamAssassin = %{version}-%{release}
116 Suggests: perl-Apache-Test
117 Suggests: perl-IO-Socket-IP
118 Suggests: perl-IO-Socket-SSL
119 Suggests: perl-IO-Socket-INET6
120 Suggests: perl-Net-Ident
123 The purpose of this program is to provide a daemonized version of the
124 spamassassin executable. The goal is improving throughput performance
125 for automated mail checking.
127 This is intended to be used alongside "spamc", a fast, low-overhead C
130 %description spamd -l pl.UTF-8
131 Spamd jest "demoniczną" wersją spamassassina. Jego zadaniem jest
132 poprawa wydajności automatycznego sprawdzania poczty.
134 Spamd powinien być używany wespół ze "spamc", który jest szybkim i
135 wydajnym programem klienckim.
138 Summary: spamc - client for spamd
139 Summary(pl.UTF-8): spamc - klient dla spamd
140 Group: Applications/Mail
141 Suggests: perl-Compress-Zlib
144 Spamc is the client half of the spamc/spamd pair. It should be used in
145 place of "spamassassin" in scripts to process mail. It will read the
146 mail from STDIN, and spool it to its connection to spamd, then read
147 the result back and print it to STDOUT. Spamc has extremely low
148 overhead in loading, so it should be much faster to load than the
149 whole spamassassin program.
151 To enable spamassassin, if you are receiving mail locally, simply add
152 this line to your ~/.procmailrc:
153 INCLUDERC=/etc/mail/spamassassin/spamassassin-spamc.rc
155 To filter spam for all users, add that line to /etc/procmailrc
156 (creating if necessary).
158 %description spamc -l pl.UTF-8
159 Spamc powinien być używany zamiast "spamassassina" w skryptach
160 przetwarzających pocztę. Zczytuje pocztę ze STDIN, kolejkuje ją a
161 następnie przekazuje spamdowi, odczytuje wynik i podaje go na STDOUT.
162 Spamc stara się nie obciążać zbytnio procesora podczas ładowania,
163 dzięki czemu powinien działać szybciej niż sam spamassassin.
165 Aby uruchomić spamassassina dla lokalnie przychodzącej poczty,
166 wystarczy dodać do własnego ~/.procmailrc linię:
167 INCLUDERC=/etc/mail/spamassassin/spamassassin-spamc.rc
169 Aby filtrować spam dla wszystkich użytkowników, należy dodać tę linię
170 do pliku /etc/procmailrc (tworząc go w razie potrzeby).
173 Summary: sa-compile - compile SpamAssassin ruleset into native code
174 Summary(pl.UTF-8): sa-compile - kompilowanie reguł SpamAssasina do kodu natywnego
175 Group: Applications/Mail
177 Requires: glibc-devel
179 Requires: perl(ExtUtils::MakeMaker)
180 Requires: perl-Mail-SpamAssassin = %{version}-%{release}
182 Requires: re2c >= 0.10
185 sa-compile uses "re2c" to compile the SpamAssassin ruleset. This is
186 then used by the "Mail::SpamAssassin::Plugin::Rule2XSBody" plugin to
187 speed up SpamAssassin's operation, where possible, and when that
190 %description compile -l pl.UTF-8
191 sa-compile wykorzystuje re2c do kompilacji reguł SpamAssassina. Służy
192 to do przyspieszenia operacji SpamAssassina w miarę możliwości, kiedy
193 ta wtyczka jest wczytana.
196 Summary: sa-update - automate SpamAssassin rule updates
197 Summary(pl.UTF-8): sa-update - automatyczne uaktualnianie regułek SpamAssassina
198 Group: Applications/Mail
201 Requires: perl-Archive-Tar
202 Requires: perl-Mail-SpamAssassin = %{version}-%{release}
203 Requires: perl-libwww
206 sa-update automates the process of downloading and installing new
207 rules and configuration, based on channels. The default channel is
208 updates.spamassassin.org, which has updated rules since the previous
211 Update archives are verified by default using SHA1 hashes and GPG
214 %description update -l pl.UTF-8
215 sa-update automatyzuje proces ściągania i instalowania nowych regułek
216 i konfiguracji w oparciu o kanały. Domyślny kanał to
217 updates.spamassassin.org, który ma uaktualnione regułki od czasu
218 poprzedniego wydania.
220 Archiwa uaktualnień są sprawdzane domyślnie przy użyciu skrótów SHA1 i
223 %package -n perl-Mail-SpamAssassin
224 Summary: Mail::SpamAssassin - SpamAssassin e-mail filter libraries
225 Summary(pl.UTF-8): Mail::SpamAssassin - biblioteki filtra poczty SpamAssassin
226 Group: Development/Languages/Perl
227 Requires: perl-HTML-Parser >= 3
229 #Requires: perl-Sys-Hostname-Long
231 Suggests: perl-Cache-DB_File >= 0.2
232 Suggests: perl-DBD-mysql
233 Suggests: perl-Encode-Detect
234 Suggests: perl-Geo-IP
235 Suggests: perl-IO-Socket-INET6 >= 2.51
236 Suggests: perl-IP-Country
237 Suggests: perl-Mail-DKIM
238 #Suggests: perl-Mail-DomainKeys
239 #Suggests: perl-Mail-SPF
240 Suggests: perl-Mail-SPF-Query
241 Suggests: perl-Net-DNS >= 0.34
242 Suggests: perl-Net-Patricia
243 Suggests: spamassassin-compile
244 Suggests: spamassassin-plugin-fuzzyocr
245 Suggests: spamassassin-update
247 %description -n perl-Mail-SpamAssassin
248 Mail::SpamAssassin is a Mail::Audit plugin to identify spam using text
249 analysis and several internet-based realtime blacklists. Using its
250 rule base, it uses a wide range of heuristic tests on mail headers and
251 body text to identify ``spam'', also known as unsolicited commercial
252 email. Once identified, the mail can then be optionally tagged as spam
253 for later filtering using the user's own mail user-agent application.
255 %description -n perl-Mail-SpamAssassin -l pl.UTF-8
256 Mail::SpamAssassin jest pluginem dla Mail::Audit, służącym do
257 identyfikacji spamu przy użyciu analizy zawartości i/lub internetowych
258 czarnych list. Do zidentyfikowania jako ,,spam'' stosuje szeroki
259 zakres testów heurystycznych na nagłówkach i treści, posiłkując się
260 stworzoną wcześniej bazą reguł. Po zidentyfikowaniu, poczta może być
261 oznaczona jako spam w celu późniejszego wyfiltrowania, np. przy użyciu
262 aplikacji do czytania poczty.
265 %setup -q -n %{pdir}-%{pnam}-%{version}
268 # disable broken test
269 %{__mv} t/sa_compile.t{,.disabled}
271 # this test needs network, does not work on builders
272 %{__mv} t/dnsbl_subtests.t{,.disabled}
274 # temporary disable problematic tests
275 %{__mv} t/trust_path.t{,.disabled}
276 %{__mv} t/urilocalbl_geoip.t{,.disabled}
279 # for spamc/configure
280 export CFLAGS="%{rpmcflags}"
281 %{__perl} Makefile.PL \
284 SYSCONFDIR=%{_sysconfdir} \
285 DATADIR=%{_datadir}/spamassassin \
287 CONTACT_ADDRESS="postmaster@localhost" \
288 PERL_BIN=%{__perl} < /dev/null
292 OPTIMIZE="%{rpmcflags}"
294 %{?with_tests:%{__make} -j1 TEST_VERBOSE=1 test}
297 rm -rf $RPM_BUILD_ROOT
298 install -d $RPM_BUILD_ROOT{/etc/{cron.d,sysconfig,rc.d/init.d},%{_sysconfdir}/mail/spamassassin/channel.d,%{systemdunitdir}}
301 DESTDIR=$RPM_BUILD_ROOT
303 install %{SOURCE1} $RPM_BUILD_ROOT/etc/sysconfig/spamd
304 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/spamd
305 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin
306 install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin
307 install %{SOURCE5} $RPM_BUILD_ROOT%{_datadir}/spamassassin/sa-update.cron
308 install %{SOURCE6} $RPM_BUILD_ROOT/etc/cron.d/sa-update
309 install %{SOURCE7} $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin/channel.d
310 install %{SOURCE8} $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin/channel.d
311 install %{SOURCE9} $RPM_BUILD_ROOT%{systemdunitdir}/cronjob-sa-update.service
312 install %{SOURCE10} $RPM_BUILD_ROOT%{systemdunitdir}/cronjob-sa-update.timer
314 # sa-update, sa-compile
315 install -d $RPM_BUILD_ROOT/var/lib/spamassassin/{%{sa_version},compiled/%{sa_version}}
316 install -d $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin/sa-update-keys
317 touch $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin/sa-update-keys/{pubring,secring,trustdb}.gpg
319 rm -f $RPM_BUILD_ROOT{%{perl_archlib}/perllocal.pod,%{perl_vendorarch}/auto/Mail/SpamAssassin/.packlist,%{_mandir}/man3/spamassassin-run.*}
321 cat > $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin/channels << 'EOF'
322 # Use %{_sysconfdir}/mail/spamassassin/channel.d/*.conf for new channels
326 rm -rf $RPM_BUILD_ROOT
329 /sbin/chkconfig --add spamd
330 %service spamd restart
333 if [ "$1" = "0" ]; then
335 /sbin/chkconfig --del spamd
338 %triggerpostun spamd -- spamassassin-spamd < 3.1.0-5.3
339 # temp hack, should we care of the dead link?
340 ln -s spamd /etc/rc.d/init.d/spamassassin
341 /sbin/chkconfig --del spamassassin
342 rm -f /etc/rc.d/init.d/spamassassin
343 if [ -f /etc/sysconfig/spamassassin.rpmsave ]; then
344 mv -f /etc/sysconfig/spamassassin.rpmsave /etc/sysconfig/spamd
348 %defattr(644,root,root,755)
349 %doc CREDITS Changes INSTALL README TRADEMARK UPGRADE USAGE
350 %doc procmailrc.example sql/ ldap/
351 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/spamassassin/spamassassin-default.rc
352 %attr(755,root,root) %{_bindir}/sa-learn
353 %attr(755,root,root) %{_bindir}/sa-awl
354 %attr(755,root,root) %{_bindir}/spamassassin
355 %attr(755,root,root) %{_bindir}/sa-check_spamd
357 # It's needed for help of spamassassin command.
358 %{perl_vendorlib}/spamassassin-run.pod
359 %{_mandir}/man1/sa-learn.1*
360 %{_mandir}/man1/spamassassin.1*
361 %{_mandir}/man1/spamassassin-run.1*
362 %{_mandir}/man1/sa-awl.1*
365 %defattr(644,root,root,755)
367 %attr(754,root,root) /etc/rc.d/init.d/spamd
368 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/spamd
369 %attr(755,root,root) %{_bindir}/spamd
370 %{_mandir}/man1/spamd.1*
373 %defattr(644,root,root,755)
374 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/spamassassin/spamassassin-spamc.rc
375 %attr(755,root,root) %{_bindir}/spamc
376 %{_mandir}/man1/spamc.1*
379 %defattr(644,root,root,755)
380 %attr(755,root,root) %{_bindir}/sa-compile
381 %{_mandir}/man1/sa-compile.1*
382 %dir /var/lib/spamassassin/compiled
383 %dir /var/lib/spamassassin/compiled/%{sa_version}
386 %defattr(644,root,root,755)
387 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/spamassassin/channels
388 %dir %{_sysconfdir}/mail/spamassassin/channel.d
389 %{_sysconfdir}/mail/spamassassin/channel.d/spamassassin-official.conf
390 %{_sysconfdir}/mail/spamassassin/channel.d/sought.conf
391 %attr(700,root,root) %dir %{_sysconfdir}/mail/spamassassin/sa-update-keys
392 %attr(700,root,root) %ghost %{_sysconfdir}/mail/spamassassin/sa-update-keys/*
393 %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/sa-update
394 %attr(755,root,root) %{_bindir}/sa-update
395 %attr(755,root,root) %{_datadir}/spamassassin/sa-update.cron
396 %{_datadir}/spamassassin/sa-update-pubkey.txt
397 %dir /var/lib/spamassassin/%{sa_version}
398 %{_mandir}/man1/sa-update.1*
399 %{systemdunitdir}/cronjob-sa-update.service
400 %{systemdunitdir}/cronjob-sa-update.timer
402 %files -n perl-Mail-SpamAssassin
403 %defattr(644,root,root,755)
404 %doc sample-nonspam.txt sample-spam.txt
405 %dir %{_sysconfdir}/mail/spamassassin
406 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/spamassassin/*.pre
407 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/spamassassin/*.cf
408 %exclude %{_sysconfdir}/mail/spamassassin/sa-update-keys
409 %dir %{_datadir}/spamassassin
410 %config(noreplace) %{_datadir}/spamassassin/languages
411 %config(noreplace) %{_datadir}/spamassassin/user_prefs.template
412 %exclude %{_datadir}/spamassassin/sa-update-pubkey.txt
414 %dir /var/lib/spamassassin
416 %{perl_vendorlib}/Mail/*