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