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