2 # - build lib{,ssl}spamc.so (if there is a point)
5 %bcond_without tests # do not perform "make test"
7 %include /usr/lib/rpm/macros.perl
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://www.apache.net.pl/spamassassin/source/%{pdir}-%{pnam}-%{version}.tar.bz2
19 # Source0-md5: 695f9107b240383e48df8938f2de334e
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 URL: http://spamassassin.apache.org/
27 BuildRequires: openssl-devel >= 0.9.7d
28 BuildRequires: perl(ExtUtils::MakeMaker) >= 6.16
29 BuildRequires: perl-Archive-Tar
30 BuildRequires: perl-DBI
31 BuildRequires: perl-DB_File
32 BuildRequires: perl-Digest-SHA1 >= 2.10
33 BuildRequires: perl-HTML-Parser >= 3
34 BuildRequires: perl-IO-Socket-INET6 >= 2.51
35 BuildRequires: perl-IO-Socket-SSL
36 BuildRequires: perl-IO-Zlib
37 BuildRequires: perl-IP-Country
38 BuildRequires: perl-Mail-SPF-Query
39 BuildRequires: perl-Net-DNS
40 BuildRequires: perl-Net-Ident
41 #BuildRequires: perl-Razor2
42 BuildRequires: perl-devel >= 1:5.8.0
43 BuildRequires: perl-libwww
45 BuildRequires: rpmbuild(macros) >= 1.310
47 # are these really needed?
48 BuildRequires: perl-Encode-Detect
49 BuildRequires: perl-MIME-Base64
50 BuildRequires: perl-MIME-tools
51 BuildRequires: perl-Mail-DKIM
52 BuildRequires: perl-Mail-DomainKeys
53 BuildRequires: perl-Mail-SPF
54 BuildRequires: perl-MailTools
55 BuildRequires: perl-Razor > 2.61
56 BUildRequires: perl-Compress-Zlib
58 BuildRequires: rpm-perlprov >= 4.1-13
59 Requires: perl-Mail-SpamAssassin = %{version}-%{release}
60 Obsoletes: SpamAssassin
61 Obsoletes: spamassassin-tools
62 Suggests: spamassassin-compile
63 Suggests: spamassassin-update
64 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
66 %define _noautoreq 'perl(Razor2::Client::Agent)' 'perl(Razor::Agent)' 'perl(Razor::Client)' 'perl(DBI)' 'perl(Net::Ident)'
69 Apache SpamAssassin provides you with a way to reduce if not completely
70 eliminate Unsolicited Commercial Email (SPAM) from your incoming
71 email. It can be invoked by a MDA such as sendmail or postfix, or can
72 be called from a procmail script, .forward file, etc. It uses a
73 genetic-algorithm evolved scoring system to identify messages which
74 look spammy, then adds headers to the message so they can be filtered
75 by the user's mail reading software. This distribution includes the
76 spamd/spamc components which create a server that considerably speeds
79 To enable spamassassin, if you are receiving mail locally, simply add
80 this line to your ~/.procmailrc:
81 INCLUDERC=/etc/mail/spamassassin/spamassassin-default.rc
83 To filter spam for all users, add that line to /etc/procmailrc
84 (creating if necessary).
86 %description -l pl.UTF-8
87 Apache SpamAssassin daje możliwość zredukowania, jeśli nie kompletnego
88 wyeliminowania niezamawianej komercyjnej poczty (Unsolicited
89 Commercial Email, spamu) z poczty. Może być wywoływany z MDA, np.
90 Sendmaila czy Postfiksa, lub z pliku ~/.forward itp. Używa ogólnego
91 algorytmu oceniania w celu identyfikacji wiadomości, które wyglądają
92 na SPAM, po czym dodaje nagłówki do wiadomości, umożliwiając
93 filtrowanie przez oprogramowanie użytkownika. Ta dystrybucja zawiera
94 programy spamd/spamc, umożliwiające uruchomienie serwera, co znacznie
95 przyspieszy proces przetwarzania poczty.
97 Aby uruchomić spamassassina dla lokalnie przychodzącej poczty,
98 wystarczy dodać do własnego ~/.procmailrc linię:
99 INCLUDERC=/etc/mail/spamassassin/spamassassin-default.rc
101 Aby filtrować spam dla wszystkich użytkowników, należy dodać tę linię
102 do pliku /etc/procmailrc (tworząc go w razie potrzeby).
105 Summary: spamd - daemonized version of spamassassin
106 Summary(pl.UTF-8): spamd - spamassassin w postaci demona
107 Group: Applications/Mail
108 Requires(post,preun): /sbin/chkconfig
109 Requires: perl-Mail-SpamAssassin = %{version}-%{release}
111 Suggests: perl-IO-Socket-SSL
112 Suggests: spamassassin-update
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
135 Spamc is the client half of the spamc/spamd pair. It should be used in
136 place of "spamassassin" in scripts to process mail. It will read the
137 mail from STDIN, and spool it to its connection to spamd, then read
138 the result back and print it to STDOUT. Spamc has extremely low
139 overhead in loading, so it should be much faster to load than the
140 whole spamassassin program.
142 To enable spamassassin, if you are receiving mail locally, simply add
143 this line to your ~/.procmailrc:
144 INCLUDERC=/etc/mail/spamassassin/spamassassin-spamc.rc
146 To filter spam for all users, add that line to /etc/procmailrc
147 (creating if necessary).
149 %description spamc -l pl.UTF-8
150 Spamc powinien być używany zamiast "spamassassina" w skryptach
151 przetwarzających pocztę. Zczytuje pocztę ze STDIN, kolejkuje ją a
152 następnie przekazuje spamdowi, odczytuje wynik i podaje go na STDOUT.
153 Spamc stara się nie obciążać zbytnio procesora podczas ładowania,
154 dzięki czemu powinien działać szybciej niż sam spamassassin.
156 Aby uruchomić spamassassina dla lokalnie przychodzącej poczty,
157 wystarczy dodać do własnego ~/.procmailrc linię:
158 INCLUDERC=/etc/mail/spamassassin/spamassassin-spamc.rc
160 Aby filtrować spam dla wszystkich użytkowników, należy dodać tę linię
161 do pliku /etc/procmailrc (tworząc go w razie potrzeby).
164 Summary: sa-compile - compile SpamAssassin ruleset into native code
165 Summary(pl.UTF-8): sa-compile - kompilowanie reguł SpamAssasina do kodu natywnego
166 Group: Applications/Mail
168 Requires: glibc-devel
170 Requires: perl(ExtUtils::MakeMaker)
171 Requires: perl-Mail-SpamAssassin = %{version}-%{release}
173 Requires: re2c >= 0.10
176 sa-compile uses "re2c" to compile the SpamAssassin ruleset. This is
177 then used by the "Mail::SpamAssassin::Plugin::Rule2XSBody" plugin to
178 speed up SpamAssassin's operation, where possible, and when that
181 %description compile -l pl.UTF-8
182 sa-compile wykorzystuje re2c do kompilacji reguł SpamAssassina. Służy
183 to do przyspieszenia operacji SpamAssassina w miarę możliwości, kiedy
184 ta wtyczka jest wczytana.
187 Summary: sa-update - automate SpamAssassin rule updates
188 Summary(pl.UTF-8): sa-update - automatyczne uaktualnianie regułek SpamAssassina
189 Group: Applications/Mail
191 Requires: perl-Archive-Tar
192 Requires: perl-Mail-SpamAssassin = %{version}-%{release}
193 Requires: perl-libwww
196 sa-update automates the process of downloading and installing new
197 rules and configuration, based on channels. The default channel is
198 updates.spamassassin.org, which has updated rules since the previous
201 Update archives are verified by default using SHA1 hashes and GPG
204 %description update -l pl.UTF-8
205 sa-update automatyzuje proces ściągania i instalowania nowych regułek
206 i konfiguracji w oparciu o kanały. Domyślny kanał to
207 updates.spamassassin.org, który ma uaktualnione regułki od czasu
208 poprzedniego wydania.
210 Archiwa uaktualnień są sprawdzane domyślnie przy użyciu skrótów SHA1 i
213 %package -n perl-Mail-SpamAssassin
214 Summary: Mail::SpamAssassin - SpamAssassin e-mail filter libraries
215 Summary(pl.UTF-8): Mail::SpamAssassin - biblioteki filtra poczty SpamAssassin
216 Group: Development/Languages/Perl
217 Requires: perl-Cache-DB_File >= 0.2
218 Requires: perl-HTML-Parser >= 3
219 Requires: perl-IO-Socket-INET6 >= 2.51
220 Requires: perl-Mail-SPF-Query
221 Requires: perl-Sys-Hostname-Long
223 %description -n perl-Mail-SpamAssassin
224 Mail::SpamAssassin is a Mail::Audit plugin to identify spam using text
225 analysis and several internet-based realtime blacklists. Using its
226 rule base, it uses a wide range of heuristic tests on mail headers and
227 body text to identify ``spam'', also known as unsolicited commercial
228 email. Once identified, the mail can then be optionally tagged as spam
229 for later filtering using the user's own mail user-agent application.
231 %description -n perl-Mail-SpamAssassin -l pl.UTF-8
232 Mail::SpamAssassin jest pluginem dla Mail::Audit, służącym do
233 identyfikacji spamu przy użyciu analizy zawartości i/lub internetowych
234 czarnych list. Do zidentyfikowania jako ,,spam'' stosuje szeroki
235 zakres testów heurystycznych na nagłówkach i treści, posiłkując się
236 stworzoną wcześniej bazą reguł. Po zidentyfikowaniu, poczta może być
237 oznaczona jako spam w celu późniejszego wyfiltrowania, np. przy użyciu
238 aplikacji do czytania poczty.
241 %setup -q -n %{pdir}-%{pnam}-%{version}
244 # for spamc/configure
245 export CFLAGS="%{rpmcflags}"
246 %{__perl} Makefile.PL \
249 SYSCONFDIR=%{_sysconfdir} \
250 DATADIR=%{_datadir}/spamassassin \
252 CONTACT_ADDRESS="postmaster@localhost" \
253 PERL_BIN=%{__perl} < /dev/null
256 OPTIMIZE="%{rpmcflags}"
258 %{__sed} -e "s,@@LOCAL_STATE_DIR@@,$(pwd)," sa-compile.raw > sa-compile.pl
259 %{__perl} -T sa-compile.pl --siteconfigpath=rules
260 rm -f compiled/%{sa_version}/auto/Mail/SpamAssassin/CompiledRegexps/body_0/.packlist
262 %{?with_tests:%{__make} test}
265 rm -rf $RPM_BUILD_ROOT
266 install -d $RPM_BUILD_ROOT{/etc/{cron.d,sysconfig,rc.d/init.d},%{_sysconfdir}/mail/spamassassin}
269 DESTDIR=$RPM_BUILD_ROOT
271 install %{SOURCE1} $RPM_BUILD_ROOT/etc/sysconfig/spamd
272 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/spamd
273 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin
274 install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin
275 install %{SOURCE5} $RPM_BUILD_ROOT%{_datadir}/spamassassin/sa-update.cron
276 install %{SOURCE6} $RPM_BUILD_ROOT/etc/cron.d/sa-update
278 # sa-update, sa-compile
279 install -d $RPM_BUILD_ROOT/var/lib/spamassassin/{%{sa_version},compiled/%{sa_version}}
280 install -d $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin/sa-update-keys
281 touch $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin/sa-update-keys/{pubring,secring,trustdb}.gpg
282 cp -a compiled/*/%{sa_version} $RPM_BUILD_ROOT/var/lib/spamassassin/compiled
284 rm -f $RPM_BUILD_ROOT{%{perl_archlib}/perllocal.pod,%{perl_vendorarch}/auto/Mail/SpamAssassin/.packlist,%{_mandir}/man3/spamassassin-run.*}
286 cat > $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin/channels << 'EOF'
287 updates.spamassassin.org
288 # http://saupdates.openprotect.com/
289 # saupdates.openprotect.com
293 rm -rf $RPM_BUILD_ROOT
296 /sbin/chkconfig --add spamd
297 %service spamd restart
300 if [ "$1" = "0" ]; then
302 /sbin/chkconfig --del spamd
305 %triggerpostun spamd -- spamassassin-spamd < 3.1.0-5.3
306 # temp hack, should we care of the dead link?
307 ln -s spamd /etc/rc.d/init.d/spamassassin
308 /sbin/chkconfig --del spamassassin
309 rm -f /etc/rc.d/init.d/spamassassin
310 if [ -f /etc/sysconfig/spamassassin.rpmsave ]; then
311 mv -f /etc/sysconfig/spamassassin.rpmsave /etc/sysconfig/spamd
315 %defattr(644,root,root,755)
316 %doc CREDITS Changes INSTALL README TRADEMARK UPGRADE USAGE
317 %doc procmailrc.example sql/ ldap/
318 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/spamassassin/spamassassin-default.rc
319 %attr(755,root,root) %{_bindir}/sa-learn
320 %attr(755,root,root) %{_bindir}/spamassassin
322 # It's needed for help of spamassassin command.
323 %{perl_vendorlib}/spamassassin-run.pod
324 %{_mandir}/man1/sa-learn*
325 %{_mandir}/man1/spamassassin*
328 %defattr(644,root,root,755)
330 %attr(754,root,root) /etc/rc.d/init.d/spamd
331 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/spamd
332 %attr(755,root,root) %{_bindir}/spamd
333 %{_mandir}/man1/spamd*
336 %defattr(644,root,root,755)
337 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/spamassassin/spamassassin-spamc.rc
338 %attr(755,root,root) %{_bindir}/spamc
339 %{_mandir}/man1/spamc*
342 %defattr(644,root,root,755)
343 %attr(755,root,root) %{_bindir}/sa-compile
344 %{_mandir}/man1/sa-compile*
345 %dir /var/lib/spamassassin/compiled
346 %dir /var/lib/spamassassin/compiled/%{sa_version}
348 # maybe include these in main package?
349 %dir /var/lib/spamassassin/compiled/%{sa_version}/auto
350 %dir /var/lib/spamassassin/compiled/%{sa_version}/auto/Mail
351 %dir /var/lib/spamassassin/compiled/%{sa_version}/auto/Mail/SpamAssassin
352 %dir /var/lib/spamassassin/compiled/%{sa_version}/auto/Mail/SpamAssassin/CompiledRegexps
353 %dir /var/lib/spamassassin/compiled/%{sa_version}/auto/Mail/SpamAssassin/CompiledRegexps/body_0
354 %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
355 %config(noreplace) %verify(not md5 mtime size) /var/lib/spamassassin/compiled/%{sa_version}/auto/Mail/SpamAssassin/CompiledRegexps/body_0/body_0.bs
356 %dir /var/lib/spamassassin/compiled/%{sa_version}/Mail
357 %dir /var/lib/spamassassin/compiled/%{sa_version}/Mail/SpamAssassin
358 %dir /var/lib/spamassassin/compiled/%{sa_version}/Mail/SpamAssassin/CompiledRegexps
359 %config(noreplace) %verify(not md5 mtime size) /var/lib/spamassassin/compiled/%{sa_version}/Mail/SpamAssassin/CompiledRegexps/body_0.pm
360 %config(noreplace) %verify(not md5 mtime size) /var/lib/spamassassin/compiled/%{sa_version}/bases_body_0.pl
363 %defattr(644,root,root,755)
364 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/spamassassin/channels
365 %attr(700,root,root) %dir %{_sysconfdir}/mail/spamassassin/sa-update-keys
366 %attr(700,root,root) %ghost %{_sysconfdir}/mail/spamassassin/sa-update-keys/*
367 %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/sa-update
368 %attr(755,root,root) %{_bindir}/sa-update
369 %attr(755,root,root) %{_datadir}/spamassassin/sa-update.cron
370 %{_datadir}/spamassassin/sa-update-pubkey.txt
371 %dir /var/lib/spamassassin/%{sa_version}
372 %{_mandir}/man1/sa-update*
374 %files -n perl-Mail-SpamAssassin
375 %defattr(644,root,root,755)
376 %doc sample-nonspam.txt sample-spam.txt
377 %dir %{_sysconfdir}/mail/spamassassin
378 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/spamassassin/*.pre
379 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/spamassassin/*.cf
380 %exclude %{_sysconfdir}/mail/spamassassin/sa-update-keys
382 %dir %{_datadir}/spamassassin
383 %config(noreplace) %{_datadir}/spamassassin/*
384 %exclude %{_datadir}/spamassassin/sa-update-pubkey.txt
386 %dir /var/lib/spamassassin
388 %{perl_vendorlib}/Mail/*