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 Summary: A spam filter for email which can be invoked from mail delivery agents
12 Summary(pl.UTF-8): Filtr antyspamowy, przeznaczony dla programów dostarczających pocztę (MDA)
17 Group: Applications/Mail
18 Source0: http://ftp.man.poznan.pl/pub/apache//spamassassin/source/%{pdir}-%{pnam}-%{version}.tar.bz2
19 # Source0-md5: ce51fe5665d5838c56db6712846b58bb
20 Source1: %{name}.sysconfig
21 Source2: %{name}-spamd.init
22 Source3: %{name}-default.rc
23 Source4: %{name}-spamc.rc
25 Source6: sa-update.cron
26 Source7: spamassassin-official.conf
27 Patch0: bug_771408_perl_version
28 Patch1: config-dir.patch
29 URL: http://spamassassin.apache.org/
30 BuildRequires: openssl-devel >= 0.9.7d
31 BuildRequires: perl(ExtUtils::MakeMaker) >= 6.16
32 BuildRequires: perl-Archive-Tar
33 BuildRequires: perl-DBI
34 BuildRequires: perl-DB_File
35 BuildRequires: perl-Digest-SHA1 >= 2.10
36 BuildRequires: perl-HTML-Parser >= 3
37 BuildRequires: perl-IO-Socket-INET6 >= 2.51
38 BuildRequires: perl-IO-Socket-SSL
39 BuildRequires: perl-IO-Zlib
40 BuildRequires: perl-IP-Country
41 BuildRequires: perl-Mail-SPF-Query
42 BuildRequires: perl-Net-DNS >= 0.65-3
43 BuildRequires: perl-Net-Ident
44 BuildRequires: perl-NetAddr-IP >= 4.000
45 #BuildRequires: perl-Razor2
46 BuildRequires: perl-devel >= 1:5.8.0
47 BuildRequires: perl-libwww
49 BuildRequires: rpm-perlprov >= 4.1-13
50 BuildRequires: rpmbuild(macros) >= 1.453
52 # are these really needed?
53 #BuildRequires: perl-Compress-Zlib
54 BuildRequires: perl-Encode-Detect
55 BuildRequires: perl-MIME-Base64
56 BuildRequires: perl-MIME-tools
57 BuildRequires: perl-Mail-DKIM
58 BuildRequires: perl-Mail-DomainKeys
59 BuildRequires: perl-Mail-SPF
60 BuildRequires: perl-MailTools
61 BuildRequires: perl-Razor > 2.61
63 Requires: perl-Mail-SpamAssassin = %{version}-%{release}
64 Obsoletes: SpamAssassin
65 Obsoletes: spamassassin-tools
66 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
68 %define _noautoreq 'perl(Razor2::Client::Agent)' 'perl(Razor::Agent)' 'perl(Razor::Client)' 'perl(DBI)' 'perl(Net::Ident)'
71 Apache SpamAssassin provides you with a way to reduce if not
72 completely eliminate Unsolicited Commercial Email (SPAM) from your
73 incoming email. It can be invoked by a MDA such as sendmail or
74 postfix, or can be called from a procmail script, .forward file, etc.
75 It uses a genetic-algorithm evolved scoring system to identify
76 messages which look spammy, then adds headers to the message so they
77 can be filtered by the user's mail reading software. This distribution
78 includes the spamd/spamc components which create a server that
79 considerably speeds processing of mail.
81 To enable spamassassin, if you are receiving mail locally, simply add
82 this line to your ~/.procmailrc:
83 INCLUDERC=/etc/spamassassin/spamassassin-default.rc
85 To filter spam for all users, add that line to /etc/procmailrc
86 (creating if necessary).
88 %description -l pl.UTF-8
89 Apache SpamAssassin daje możliwość zredukowania, jeśli nie kompletnego
90 wyeliminowania niezamawianej komercyjnej poczty (Unsolicited
91 Commercial Email, spamu) z poczty. Może być wywoływany z MDA, np.
92 Sendmaila czy Postfiksa, lub z pliku ~/.forward itp. Używa ogólnego
93 algorytmu oceniania w celu identyfikacji wiadomości, które wyglądają
94 na SPAM, po czym dodaje nagłówki do wiadomości, umożliwiając
95 filtrowanie przez oprogramowanie użytkownika. Ta dystrybucja zawiera
96 programy spamd/spamc, umożliwiające uruchomienie serwera, co znacznie
97 przyspieszy proces przetwarzania poczty.
99 Aby uruchomić spamassassina dla lokalnie przychodzącej poczty,
100 wystarczy dodać do własnego ~/.procmailrc linię:
101 INCLUDERC=/etc/spamassassin/spamassassin-default.rc
103 Aby filtrować spam dla wszystkich użytkowników, należy dodać tę linię
104 do pliku /etc/procmailrc (tworząc go w razie potrzeby).
107 Summary: spamd - daemonized version of spamassassin
108 Summary(pl.UTF-8): spamd - spamassassin w postaci demona
109 Group: Applications/Mail
110 Requires(post,preun): /sbin/chkconfig
111 Requires: perl-Mail-SpamAssassin = %{version}-%{release}
113 Suggests: perl-Apache-Test
114 Suggests: perl-IO-Socket-IP
115 Suggests: perl-IO-Socket-SSL
116 Suggests: perl-IO-Socket-INET6
117 Suggests: perl-Net-Ident
120 The purpose of this program is to provide a daemonized version of the
121 spamassassin executable. The goal is improving throughput performance
122 for automated mail checking.
124 This is intended to be used alongside "spamc", a fast, low-overhead C
127 %description spamd -l pl.UTF-8
128 Spamd jest "demoniczną" wersją spamassassina. Jego zadaniem jest
129 poprawa wydajności automatycznego sprawdzania poczty.
131 Spamd powinien być używany wespół ze "spamc", który jest szybkim i
132 wydajnym programem klienckim.
135 Summary: spamc - client for spamd
136 Summary(pl.UTF-8): spamc - klient dla spamd
137 Group: Applications/Mail
138 Suggests: perl-Compress-Zlib
141 Spamc is the client half of the spamc/spamd pair. It should be used in
142 place of "spamassassin" in scripts to process mail. It will read the
143 mail from STDIN, and spool it to its connection to spamd, then read
144 the result back and print it to STDOUT. Spamc has extremely low
145 overhead in loading, so it should be much faster to load than the
146 whole spamassassin program.
148 To enable spamassassin, if you are receiving mail locally, simply add
149 this line to your ~/.procmailrc:
150 INCLUDERC=/etc/spamassassin/spamassassin-spamc.rc
152 To filter spam for all users, add that line to /etc/procmailrc
153 (creating if necessary).
155 %description spamc -l pl.UTF-8
156 Spamc powinien być używany zamiast "spamassassina" w skryptach
157 przetwarzających pocztę. Zczytuje pocztę ze STDIN, kolejkuje ją a
158 następnie przekazuje spamdowi, odczytuje wynik i podaje go na STDOUT.
159 Spamc stara się nie obciążać zbytnio procesora podczas ładowania,
160 dzięki czemu powinien działać szybciej niż sam spamassassin.
162 Aby uruchomić spamassassina dla lokalnie przychodzącej poczty,
163 wystarczy dodać do własnego ~/.procmailrc linię:
164 INCLUDERC=/etc/spamassassin/spamassassin-spamc.rc
166 Aby filtrować spam dla wszystkich użytkowników, należy dodać tę linię
167 do pliku /etc/procmailrc (tworząc go w razie potrzeby).
170 Summary: sa-compile - compile SpamAssassin ruleset into native code
171 Summary(pl.UTF-8): sa-compile - kompilowanie reguł SpamAssasina do kodu natywnego
172 Group: Applications/Mail
174 Requires: glibc-devel
176 Requires: perl(ExtUtils::MakeMaker)
177 Requires: perl-Mail-SpamAssassin = %{version}-%{release}
179 Requires: re2c >= 0.10
182 sa-compile uses "re2c" to compile the SpamAssassin ruleset. This is
183 then used by the "Mail::SpamAssassin::Plugin::Rule2XSBody" plugin to
184 speed up SpamAssassin's operation, where possible, and when that
187 %description compile -l pl.UTF-8
188 sa-compile wykorzystuje re2c do kompilacji reguł SpamAssassina. Służy
189 to do przyspieszenia operacji SpamAssassina w miarę możliwości, kiedy
190 ta wtyczka jest wczytana.
193 Summary: sa-update - automate SpamAssassin rule updates
194 Summary(pl.UTF-8): sa-update - automatyczne uaktualnianie regułek SpamAssassina
195 Group: Applications/Mail
198 Requires: perl-Archive-Tar
199 Requires: perl-Mail-SpamAssassin = %{version}-%{release}
200 Requires: perl-libwww
203 sa-update automates the process of downloading and installing new
204 rules and configuration, based on channels. The default channel is
205 updates.spamassassin.org, which has updated rules since the previous
208 Update archives are verified by default using SHA1 hashes and GPG
211 %description update -l pl.UTF-8
212 sa-update automatyzuje proces ściągania i instalowania nowych regułek
213 i konfiguracji w oparciu o kanały. Domyślny kanał to
214 updates.spamassassin.org, który ma uaktualnione regułki od czasu
215 poprzedniego wydania.
217 Archiwa uaktualnień są sprawdzane domyślnie przy użyciu skrótów SHA1 i
220 %package -n perl-Mail-SpamAssassin
221 Summary: Mail::SpamAssassin - SpamAssassin e-mail filter libraries
222 Summary(pl.UTF-8): Mail::SpamAssassin - biblioteki filtra poczty SpamAssassin
223 Group: Development/Languages/Perl
224 Requires: perl-HTML-Parser >= 3
226 #Requires: perl-Sys-Hostname-Long
228 Suggests: perl-Cache-DB_File >= 0.2
229 Suggests: perl-DBD-mysql
230 Suggests: perl-Encode-Detect
231 Suggests: perl-Geo-IP
232 Suggests: perl-IO-Socket-INET6 >= 2.51
233 Suggests: perl-IP-Country
234 Suggests: perl-Mail-DKIM
235 #Suggests: perl-Mail-DomainKeys
236 #Suggests: perl-Mail-SPF
237 Suggests: perl-Mail-SPF-Query
238 Suggests: perl-Net-DNS >= 0.34
239 Suggests: perl-Net-Patricia
240 Suggests: spamassassin-compile
241 Suggests: spamassassin-plugin-fuzzyocr
242 Suggests: spamassassin-update
244 %description -n perl-Mail-SpamAssassin
245 Mail::SpamAssassin is a Mail::Audit plugin to identify spam using text
246 analysis and several internet-based realtime blacklists. Using its
247 rule base, it uses a wide range of heuristic tests on mail headers and
248 body text to identify ``spam'', also known as unsolicited commercial
249 email. Once identified, the mail can then be optionally tagged as spam
250 for later filtering using the user's own mail user-agent application.
252 %description -n perl-Mail-SpamAssassin -l pl.UTF-8
253 Mail::SpamAssassin jest pluginem dla Mail::Audit, służącym do
254 identyfikacji spamu przy użyciu analizy zawartości i/lub internetowych
255 czarnych list. Do zidentyfikowania jako ,,spam'' stosuje szeroki
256 zakres testów heurystycznych na nagłówkach i treści, posiłkując się
257 stworzoną wcześniej bazą reguł. Po zidentyfikowaniu, poczta może być
258 oznaczona jako spam w celu późniejszego wyfiltrowania, np. przy użyciu
259 aplikacji do czytania poczty.
262 %setup -q -n %{pdir}-%{pnam}-%{version}
266 # disable broken test
267 %{__mv} t/sa_compile.t{,.disabled}
269 # this test needs network, does not work on builders
270 %{__mv} t/dnsbl_subtests.t{,.disabled}
272 # temporary disable problematic tests
273 %{__mv} t/trust_path.t{,.disabled}
274 %{__mv} t/urilocalbl_geoip.t{,.disabled}
277 # for spamc/configure
278 export CFLAGS="%{rpmcflags}"
279 %{__perl} Makefile.PL \
282 SYSCONFDIR=%{_sysconfdir} \
283 CONFDIR=%{_sysconfdir}/spamassassin \
284 DATADIR=%{_datadir}/spamassassin \
286 CONTACT_ADDRESS="postmaster@localhost" \
287 PERL_BIN=%{__perl} < /dev/null
291 OPTIMIZE="%{rpmcflags}"
293 %{?with_tests:%{__make} -j1 TEST_VERBOSE=1 test}
296 rm -rf $RPM_BUILD_ROOT
297 install -d $RPM_BUILD_ROOT{/etc/{cron.d,sysconfig,rc.d/init.d},%{_sysconfdir}/spamassassin/channel.d}
300 DESTDIR=$RPM_BUILD_ROOT
302 install %{SOURCE1} $RPM_BUILD_ROOT/etc/sysconfig/spamd
303 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/spamd
304 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/spamassassin
305 install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/spamassassin
306 install %{SOURCE5} $RPM_BUILD_ROOT%{_datadir}/spamassassin/sa-update.cron
307 install %{SOURCE6} $RPM_BUILD_ROOT/etc/cron.d/sa-update
308 install %{SOURCE7} $RPM_BUILD_ROOT%{_sysconfdir}/spamassassin/channel.d
310 # sa-update, sa-compile
311 install -d $RPM_BUILD_ROOT/var/lib/spamassassin/{%{sa_version},compiled/%{sa_version}}
312 install -d $RPM_BUILD_ROOT%{_sysconfdir}/spamassassin/sa-update-keys
313 touch $RPM_BUILD_ROOT%{_sysconfdir}/spamassassin/sa-update-keys/{pubring,secring,trustdb}.gpg
315 rm -f $RPM_BUILD_ROOT{%{perl_archlib}/perllocal.pod,%{perl_vendorarch}/auto/Mail/SpamAssassin/.packlist,%{_mandir}/man3/spamassassin-run.*}
317 cat > $RPM_BUILD_ROOT%{_sysconfdir}/spamassassin/channels << 'EOF'
318 # Use %{_sysconfdir}/spamassassin/channel.d/*.conf for new channels
322 rm -rf $RPM_BUILD_ROOT
325 /sbin/chkconfig --add spamd
326 %service spamd restart
329 if [ "$1" = "0" ]; then
331 /sbin/chkconfig --del spamd
334 %triggerun -n perl-Mail-SpamAssassin -- perl-Mail-SpamAssassin < 3.4.2-2
335 if [ $1 -le 1 ]; then
338 [ -d /etc/spamassassin ] || mkdir /etc/spamassassin 2>/dev/null || :
339 for f in /etc/mail/spamassassin/*.{cf,pre}; do
341 [ -f "/etc/mail/spamassassin/$f" ] && mv "/etc/mail/spamassassin/$f" "/etc/spamassassin/$f" 2>/dev/null || :
343 [ -n "$(find /etc/mail/spamassassin -type d -empty 2>/dev/null)" ] && rmdir /etc/mail/spamassassin 2>/dev/null || :
344 [ -n "$(find /etc/mail -type d -empty 2>/dev/null)" ] && rmdir /etc/mail 2>/dev/null || :
346 %triggerun -- %{name} < 3.4.2-2
347 if [ $1 -le 1 ]; then
350 [ -d /etc/spamassassin ] || mkdir /etc/spamassassin 2>/dev/null || :
351 [ -f /etc/mail/spamassassin/spamassassin-default.rc ] && mv /etc/mail/spamassassin/spamassassin-default.rc /etc/spamassassin 2>/dev/null || :
352 [ -n "$(find /etc/mail/spamassassin -type d -empty 2>/dev/null)" ] && rmdir /etc/mail/spamassassin 2>/dev/null || :
353 [ -n "$(find /etc/mail -type d -empty 2>/dev/null)" ] && rmdir /etc/mail 2>/dev/null || :
355 %triggerun spamc -- spamassassin-spamc < 3.4.2-2
356 if [ $1 -le 1 ]; then
359 [ -d /etc/spamassassin ] || mkdir /etc/spamassassin 2>/dev/null || :
360 [ -f /etc/mail/spamassassin/spamassassin-spamc.rc ] && mv /etc/mail/spamassassin/spamassassin-spamc.rc /etc/spamassassin 2>/dev/null || :
361 [ -n "$(find /etc/mail/spamassassin -type d -empty 2>/dev/null)" ] && rmdir /etc/mail/spamassassin 2>/dev/null || :
362 [ -n "$(find /etc/mail -type d -empty 2>/dev/null)" ] && rmdir /etc/mail 2>/dev/null || :
364 %triggerpostun -n perl-Mail-SpamAssassin -- perl-Mail-SpamAssassin < 3.4.2-2
366 echo "Warning! Configuration has been migrated to /etc/spamassassin."
369 %triggerpostun spamd -- spamassassin-spamd < 3.1.0-5.3
370 # temp hack, should we care of the dead link?
371 ln -s spamd /etc/rc.d/init.d/spamassassin
372 /sbin/chkconfig --del spamassassin
373 rm -f /etc/rc.d/init.d/spamassassin
374 if [ -f /etc/sysconfig/spamassassin.rpmsave ]; then
375 mv -f /etc/sysconfig/spamassassin.rpmsave /etc/sysconfig/spamd
379 %defattr(644,root,root,755)
380 %doc CREDITS Changes INSTALL README TRADEMARK UPGRADE USAGE
381 %doc procmailrc.example sql/ ldap/
382 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/spamassassin/spamassassin-default.rc
383 %attr(755,root,root) %{_bindir}/sa-learn
384 %attr(755,root,root) %{_bindir}/sa-awl
385 %attr(755,root,root) %{_bindir}/spamassassin
386 %attr(755,root,root) %{_bindir}/sa-check_spamd
388 # It's needed for help of spamassassin command.
389 %{perl_vendorlib}/spamassassin-run.pod
390 %{_mandir}/man1/sa-learn.1*
391 %{_mandir}/man1/spamassassin.1*
392 %{_mandir}/man1/spamassassin-run.1*
393 %{_mandir}/man1/sa-awl.1*
396 %defattr(644,root,root,755)
398 %attr(754,root,root) /etc/rc.d/init.d/spamd
399 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/spamd
400 %attr(755,root,root) %{_bindir}/spamd
401 %{_mandir}/man1/spamd.1*
404 %defattr(644,root,root,755)
405 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/spamassassin/spamassassin-spamc.rc
406 %attr(755,root,root) %{_bindir}/spamc
407 %{_mandir}/man1/spamc.1*
410 %defattr(644,root,root,755)
411 %attr(755,root,root) %{_bindir}/sa-compile
412 %{_mandir}/man1/sa-compile.1*
413 %dir /var/lib/spamassassin/compiled
414 %dir /var/lib/spamassassin/compiled/%{sa_version}
417 %defattr(644,root,root,755)
418 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/spamassassin/channels
419 %dir %{_sysconfdir}/spamassassin/channel.d
420 %{_sysconfdir}/spamassassin/channel.d/spamassassin-official.conf
421 %attr(700,root,root) %dir %{_sysconfdir}/spamassassin/sa-update-keys
422 %attr(700,root,root) %ghost %{_sysconfdir}/spamassassin/sa-update-keys/*
423 %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/sa-update
424 %attr(755,root,root) %{_bindir}/sa-update
425 %attr(755,root,root) %{_datadir}/spamassassin/sa-update.cron
426 %{_datadir}/spamassassin/sa-update-pubkey.txt
427 %dir /var/lib/spamassassin/%{sa_version}
428 %{_mandir}/man1/sa-update.1*
430 %files -n perl-Mail-SpamAssassin
431 %defattr(644,root,root,755)
432 %doc sample-nonspam.txt sample-spam.txt
433 %dir %{_sysconfdir}/spamassassin
434 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/spamassassin/*.pre
435 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/spamassassin/*.cf
436 %exclude %{_sysconfdir}/spamassassin/sa-update-keys
437 %dir %{_datadir}/spamassassin
438 %config(noreplace) %{_datadir}/spamassassin/languages
439 %config(noreplace) %{_datadir}/spamassassin/user_prefs.template
440 %exclude %{_datadir}/spamassassin/sa-update-pubkey.txt
442 %dir /var/lib/spamassassin
444 %{perl_vendorlib}/Mail/*