2 # - build lib{,ssl}spamc.so (if there is a point)
3 # - kill "update" subpackage and move it to perl-Mail-SpamAssassin?
4 # it's `strongly recommended' in 3.2.0 (instead of `optional').
5 # - is it possible to package compiled results in -compile or the result is
6 # site/machine dependant?
9 %bcond_without tests # do not perform "make test"
11 %include /usr/lib/rpm/macros.perl
13 %define pnam SpamAssassin
14 %define sa_version %(printf %d.%03d%03d $(echo %{version} | tr '.' ' '))
15 Summary: A spam filter for email which can be invoked from mail delivery agents
16 Summary(pl.UTF-8): Filtr antyspamowy, przeznaczony dla programów dostarczających pocztę (MDA)
20 License: Apache Software License v2
21 Group: Applications/Mail
22 Source0: http://www.apache.net.pl/spamassassin/source/%{pdir}-%{pnam}-%{version}.tar.bz2
23 # Source0-md5: 7b2fdbcdca5e9a181d4bb1b17663c138
24 Source1: %{name}.sysconfig
25 Source2: %{name}-spamd.init
26 Source3: %{name}-default.rc
27 Source4: %{name}-spamc.rc
28 URL: http://spamassassin.apache.org/
29 BuildRequires: openssl-devel >= 0.9.7d
30 BuildRequires: perl(ExtUtils::MakeMaker) >= 6.16
31 BuildRequires: perl-Archive-Tar
32 BuildRequires: perl-DBI
33 BuildRequires: perl-DB_File
34 BuildRequires: perl-Digest-SHA1 >= 2.10
35 BuildRequires: perl-HTML-Parser >= 3
36 BuildRequires: perl-IO-Socket-INET6 >= 2.51
37 BuildRequires: perl-IO-Socket-SSL
38 BuildRequires: perl-IO-Zlib
39 BuildRequires: perl-IP-Country
40 BuildRequires: perl-Mail-SPF-Query
41 BuildRequires: perl-Net-DNS
42 BuildRequires: perl-Net-Ident
43 #BuildRequires: perl-Razor2
44 BuildRequires: perl-devel >= 1:5.8.0
45 BuildRequires: perl-libwww
47 BuildRequires: rpmbuild(macros) >= 1.310
49 # are these really needed?
50 BuildRequires: perl-Encode-Detect
51 BuildRequires: perl-MIME-Base64
52 BuildRequires: perl-MIME-tools
53 BuildRequires: perl-Mail-DKIM
54 BuildRequires: perl-Mail-DomainKeys
55 BuildRequires: perl-Mail-SPF
56 BuildRequires: perl-MailTools
57 BuildRequires: perl-Razor > 2.61
58 BUildRequires: perl-Compress-Zlib
60 BuildRequires: rpm-perlprov >= 4.1-13
61 Requires: perl-Mail-SpamAssassin = %{version}-%{release}
62 Obsoletes: SpamAssassin
63 Suggests: spamassassin-update
64 Suggests: spamassassin-compile
65 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
67 %define _noautoreq 'perl(Razor2::Client::Agent)' 'perl(Razor::Agent)' 'perl(Razor::Client)' 'perl(DBI)' 'perl(Net::Ident)'
70 SpamAssassin provides you with a way to reduce if not completely
71 eliminate Unsolicited Commercial Email (SPAM) from your incoming
72 email. It can be invoked by a MDA such as sendmail or postfix, or can
73 be called from a procmail script, .forward file, etc. It uses a
74 genetic-algorithm evolved scoring system to identify messages which
75 look spammy, then adds headers to the message so they can be filtered
76 by the user's mail reading software. This distribution includes the
77 spamd/spamc components which create a server that considerably speeds
80 To enable spamassassin, if you are receiving mail locally, simply add
81 this line to your ~/.procmailrc:
82 INCLUDERC=/etc/mail/spamassassin/spamassassin-default.rc
84 To filter spam for all users, add that line to /etc/procmailrc
85 (creating if necessary).
87 %description -l pl.UTF-8
88 SpamAssassin daje możliwość zredukowania, jeśli nie kompletnego
89 wyeliminowania niezamawianej komercyjnej poczty (Unsolicited
90 Commercial Email, spamu) z poczty. Może być wywoływany z MDA, np.
91 Sendmaila czy Postfiksa, lub z pliku ~/.forward itp. Używa ogólnego
92 algorytmu oceniania w celu identyfikacji wiadomości, które wyglądają
93 na SPAM, po czym dodaje nagłówki do wiadomości, umożliwiając
94 filtrowanie przez oprogramowanie użytkownika. Ta dystrybucja zawiera
95 programy spamd/spamc, umożliwiające uruchomienie serwera, co znacznie
96 przyspieszy proces przetwarzania poczty.
98 Aby uruchomić spamassassina dla lokalnie przychodzącej poczty,
99 wystarczy dodać do własnego ~/.procmailrc linię:
100 INCLUDERC=/etc/mail/spamassassin/spamassassin-default.rc
102 Aby filtrować spam dla wszystkich użytkowników, należy dodać tę linię
103 do pliku /etc/procmailrc (tworząc go w razie potrzeby).
106 Summary: Miscleanous tools for SpamAssassin
107 Summary(pl.UTF-8): Przeróżne narzędzia związane z SpamAssassin
108 Group: Applications/Mail
109 Obsoletes: SpamAssassin-tools
112 Miscleanous tools from various authors, distributed with SpamAssassin.
113 See /usr/share/doc/spamassassin-tools-*/.
115 %description tools -l pl.UTF-8
116 Przeróżne narzędzia, dystrybuowane razem ze SpamAssassinem. Więcej
117 informacji w /usr/share/doc/spamassassin-tools-*/.
120 Summary: spamd - daemonized version of spamassassin
121 Summary(pl.UTF-8): spamd - spamassassin w postaci demona
122 Group: Applications/Mail
123 Requires(post,preun): /sbin/chkconfig
124 Requires: perl-Mail-SpamAssassin = %{version}-%{release}
126 Suggests: spamassassin-update
127 Suggests: perl-IO-Socket-SSL
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
150 Spamc is the client half of the spamc/spamd pair. It should be used in
151 place of "spamassassin" in scripts to process mail. It will read the
152 mail from STDIN, and spool it to its connection to spamd, then read
153 the result back and print it to STDOUT. Spamc has extremely low
154 overhead in loading, so it should be much faster to load than the
155 whole spamassassin program.
157 To enable spamassassin, if you are receiving mail locally, simply add
158 this line to your ~/.procmailrc:
159 INCLUDERC=/etc/mail/spamassassin/spamassassin-spamc.rc
161 To filter spam for all users, add that line to /etc/procmailrc
162 (creating if necessary).
164 %description spamc -l pl.UTF-8
165 Spamc powinien być używany zamiast "spamassassina" w skryptach
166 przetwarzających pocztę. Zczytuje pocztę ze STDIN, kolejkuje ją a
167 następnie przekazuje spamdowi, odczytuje wynik i podaje go na STDOUT.
168 Spamc stara się nie obciążać zbytnio procesora podczas ładowania,
169 dzięki czemu powinien działać szybciej niż sam spamassassin.
171 Aby uruchomić spamassassina dla lokalnie przychodzącej poczty,
172 wystarczy dodać do własnego ~/.procmailrc linię:
173 INCLUDERC=/etc/mail/spamassassin/spamassassin-spamc.rc
175 Aby filtrować spam dla wszystkich użytkowników, należy dodać tę linię
176 do pliku /etc/procmailrc (tworząc go w razie potrzeby).
179 Summary: sa-compile - compile SpamAssassin ruleset into native code
180 Summary(pl.UTF-8): sa-compile - kompilowanie reguł SpamAssasina do kodu natywnego
181 Group: Applications/Mail
183 Requires: glibc-devel
185 Requires: perl(ExtUtils::MakeMaker)
186 Requires: perl-Mail-SpamAssassin = %{version}-%{release}
188 Requires: re2c >= 0.10
191 sa-compile uses "re2c" to compile the SpamAssassin ruleset. This is
192 then used by the "Mail::SpamAssassin::Plugin::Rule2XSBody" plugin to
193 speed up SpamAssassin's operation, where possible, and when that
196 %description compile -l pl.UTF-8
197 sa-compile wykorzystuje re2c do kompilacji reguł SpamAssassina. Służy
198 to do przyspieszenia operacji SpamAssassina w miarę możliwości, kiedy
199 ta wtyczka jest wczytana.
202 Summary: sa-update - automate SpamAssassin rule updates
203 Summary(pl.UTF-8): sa-update - automatyczne uaktualnianie regułek SpamAssassina
204 Group: Applications/Mail
206 Requires: perl-Archive-Tar
207 Requires: perl-Mail-SpamAssassin = %{version}-%{release}
208 Requires: perl-libwww
211 sa-update automates the process of downloading and installing new
212 rules and configuration, based on channels. The default channel is
213 updates.spamassassin.org, which has updated rules since the previous
216 Update archives are verified by default using SHA1 hashes and GPG
219 %description update -l pl.UTF-8
220 sa-update automatyzuje proces ściągania i instalowania nowych regułek
221 i konfiguracji w oparciu o kanały. Domyślny kanał to
222 updates.spamassassin.org, który ma uaktualnione regułki od czasu
223 poprzedniego wydania.
225 Archiwa uaktualnień są sprawdzane domyślnie przy użyciu skrótów SHA1 i
228 %package -n perl-Mail-SpamAssassin
229 Summary: Mail::SpamAssassin - SpamAssassin e-mail filter libraries
230 Summary(pl.UTF-8): Mail::SpamAssassin - biblioteki filtra poczty SpamAssassin
231 Group: Development/Languages/Perl
232 Requires: perl-Cache-DB_File >= 0.2
233 Requires: perl-HTML-Parser >= 3
234 Requires: perl-IO-Socket-INET6 >= 2.51
235 Requires: perl-Mail-SPF-Query
236 Requires: perl-Sys-Hostname-Long
237 Conflicts: perl-Net-DNS < 0.50
239 %description -n perl-Mail-SpamAssassin
240 Mail::SpamAssassin is a Mail::Audit plugin to identify spam using text
241 analysis and several internet-based realtime blacklists. Using its
242 rule base, it uses a wide range of heuristic tests on mail headers and
243 body text to identify ``spam'', also known as unsolicited commercial
244 email. Once identified, the mail can then be optionally tagged as spam
245 for later filtering using the user's own mail user-agent application.
247 %description -n perl-Mail-SpamAssassin -l pl.UTF-8
248 Mail::SpamAssassin jest pluginem dla Mail::Audit, służącym do
249 identyfikacji spamu przy użyciu analizy zawartości i/lub internetowych
250 czarnych list. Do zidentyfikowania jako ,,spam'' stosuje szeroki
251 zakres testów heurystycznych na nagłówkach i treści, posiłkując się
252 stworzoną wcześniej bazą reguł. Po zidentyfikowaniu, poczta może być
253 oznaczona jako spam w celu późniejszego wyfiltrowania, np. przy użyciu
254 aplikacji do czytania poczty.
257 %setup -q -n %{pdir}-%{pnam}-%{version}
260 # for spamc/configure
261 export CFLAGS="%{rpmcflags}"
262 %{__perl} Makefile.PL \
265 SYSCONFDIR=%{_sysconfdir} \
267 CONTACT_ADDRESS="postmaster@localhost" \
268 PERL_BIN=%{__perl} < /dev/null
271 OPTIMIZE="%{rpmcflags}"
273 %{__sed} -e "s,@@LOCAL_STATE_DIR@@,$(pwd)," sa-compile.raw > sa-compile.pl
274 %{__perl} -T sa-compile.pl --siteconfigpath=rules
275 rm -f compiled/%{sa_version}/auto/Mail/SpamAssassin/CompiledRegexps/body_0/.packlist
277 %{?with_tests:%{__make} test}
280 rm -rf $RPM_BUILD_ROOT
281 install -d $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d},%{_sysconfdir}/mail/spamassassin}
284 DESTDIR=$RPM_BUILD_ROOT
286 install %{SOURCE1} $RPM_BUILD_ROOT/etc/sysconfig/spamd
287 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/spamd
288 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin
289 install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin
291 # sa-update, sa-compile
292 install -d $RPM_BUILD_ROOT/var/lib/spamassassin/{%{sa_version},compiled/%{sa_version}}
293 install -d $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin/sa-update-keys
294 touch $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin/sa-update-keys/{pubring,secring,trustdb}.gpg
295 cp -a compiled/%{sa_version} $RPM_BUILD_ROOT/var/lib/spamassassin/compiled
297 rm -f $RPM_BUILD_ROOT{%{perl_archlib}/perllocal.pod,%{perl_vendorarch}/auto/Mail/SpamAssassin/.packlist,%{_mandir}/man3/spamassassin-run.*}
300 rm -rf $RPM_BUILD_ROOT
303 /sbin/chkconfig --add spamd
304 %service spamd restart
307 if [ "$1" = "0" ]; then
309 /sbin/chkconfig --del spamd
312 %triggerpostun spamd -- spamassassin-spamd < 3.1.0-5.3
313 # temp hack, should we care of the dead link?
314 ln -s spamd /etc/rc.d/init.d/spamassassin
315 /sbin/chkconfig --del spamassassin
316 rm -f /etc/rc.d/init.d/spamassassin
317 if [ -f /etc/sysconfig/spamassassin.rpmsave ]; then
318 mv -f /etc/sysconfig/spamassassin.rpmsave /etc/sysconfig/spamd
322 %defattr(644,root,root,755)
323 %doc CREDITS Changes INSTALL README TRADEMARK UPGRADE USAGE
324 %doc procmailrc.example
325 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/spamassassin/spamassassin-default.rc
326 %attr(755,root,root) %{_bindir}/sa-learn
327 %attr(755,root,root) %{_bindir}/spamassassin
329 # It's needed for help of spamassassin command.
330 %{perl_vendorlib}/spamassassin-run.pod
331 %{_mandir}/man1/sa-learn*
332 %{_mandir}/man1/spamassassin*
335 %defattr(644,root,root,755)
339 %defattr(644,root,root,755)
341 %attr(754,root,root) /etc/rc.d/init.d/spamd
342 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/spamd
343 %attr(755,root,root) %{_bindir}/spamd
344 %{_mandir}/man1/spamd*
347 %defattr(644,root,root,755)
348 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/spamassassin/spamassassin-spamc.rc
349 %attr(755,root,root) %{_bindir}/spamc
350 %{_mandir}/man1/spamc*
353 %defattr(644,root,root,755)
354 %attr(755,root,root) %{_bindir}/sa-compile
355 %{_mandir}/man1/sa-compile*
356 %dir /var/lib/spamassassin/compiled
357 %dir /var/lib/spamassassin/compiled/%{sa_version}
359 # maybe include these in main package?
360 %dir /var/lib/spamassassin/compiled/%{sa_version}/auto
361 %dir /var/lib/spamassassin/compiled/%{sa_version}/auto/Mail
362 %dir /var/lib/spamassassin/compiled/%{sa_version}/auto/Mail/SpamAssassin/CompiledRegexps
363 %dir /var/lib/spamassassin/compiled/%{sa_version}/auto/Mail/SpamAssassin/CompiledRegexps/body_0
364 %config(noreplace) %verify(not md5 mtime size) %attr(755,root,root) /var/lib/spamassassin/compiled/%{sa_version}/auto/Mail/SpamAssassin/CompiledRegexps/body_0/body_0.so
365 %config(noreplace) %verify(not md5 mtime size) /var/lib/spamassassin/compiled/%{sa_version}/auto/Mail/SpamAssassin/CompiledRegexps/body_0/body_0.bs
366 %dir /var/lib/spamassassin/compiled/%{sa_version}/Mail
367 %dir /var/lib/spamassassin/compiled/%{sa_version}/Mail/SpamAssassin
368 %dir /var/lib/spamassassin/compiled/%{sa_version}/Mail/SpamAssassin/CompiledRegexps
369 %config(noreplace) %verify(not md5 mtime size) /var/lib/spamassassin/compiled/%{sa_version}/Mail/SpamAssassin/CompiledRegexps/body_0.pm
370 %config(noreplace) %verify(not md5 mtime size) /var/lib/spamassassin/compiled/%{sa_version}/bases_body_0.pl
373 %defattr(644,root,root,755)
374 %attr(700,root,root) %dir %{_sysconfdir}/mail/spamassassin/sa-update-keys
375 %attr(700,root,root) %ghost %{_sysconfdir}/mail/spamassassin/sa-update-keys/*
376 %attr(755,root,root) %{_bindir}/sa-update
377 %{_datadir}/spamassassin/sa-update-pubkey.txt
378 %dir /var/lib/spamassassin/%{sa_version}
379 %{_mandir}/man1/sa-update*
381 %files -n perl-Mail-SpamAssassin
382 %defattr(644,root,root,755)
383 %doc sample-nonspam.txt sample-spam.txt
384 %dir %{_sysconfdir}/mail/spamassassin
385 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/spamassassin/*.pre
386 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/spamassassin/*.cf
387 %exclude %{_sysconfdir}/mail/spamassassin/sa-update-keys
389 %dir %{_datadir}/spamassassin
390 %config(noreplace) %{_datadir}/spamassassin/*
391 %exclude %{_datadir}/spamassassin/sa-update-pubkey.txt
393 %dir /var/lib/spamassassin
395 %{perl_vendorlib}/Mail/*