]>
Commit | Line | Data |
---|---|---|
1 | # TODO | |
2 | # - build lib{,ssl}spamc.so (if there is a point) | |
3 | # - sa-check_spamd into nagios-plugin-check_spamd subpackage | |
4 | # | |
5 | # Conditional build: | |
6 | %bcond_without tests # do not perform "make test" | |
7 | ||
8 | %define pdir Mail | |
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) | |
14 | Name: spamassassin | |
15 | Version: 3.4.1 | |
16 | Release: 1 | |
17 | License: Apache v2.0 | |
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 | |
25 | Source5: sa-update.sh | |
26 | Source6: sa-update.cron | |
27 | Source7: spamassassin-official.conf | |
28 | Source8: sought.conf | |
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 | |
48 | BuildRequires: re2c | |
49 | BuildRequires: rpm-perlprov >= 4.1-13 | |
50 | BuildRequires: rpmbuild(macros) >= 1.453 | |
51 | %if %{with tests} | |
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 | |
62 | %endif | |
63 | Requires: perl-Mail-SpamAssassin = %{version}-%{release} | |
64 | Obsoletes: SpamAssassin | |
65 | Obsoletes: spamassassin-tools | |
66 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
67 | ||
68 | %define _noautoreq 'perl(Razor2::Client::Agent)' 'perl(Razor::Agent)' 'perl(Razor::Client)' 'perl(DBI)' 'perl(Net::Ident)' | |
69 | ||
70 | %description | |
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. | |
80 | ||
81 | To enable spamassassin, if you are receiving mail locally, simply add | |
82 | this line to your ~/.procmailrc: | |
83 | INCLUDERC=/etc/mail/spamassassin/spamassassin-default.rc | |
84 | ||
85 | To filter spam for all users, add that line to /etc/procmailrc | |
86 | (creating if necessary). | |
87 | ||
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. | |
98 | ||
99 | Aby uruchomić spamassassina dla lokalnie przychodzącej poczty, | |
100 | wystarczy dodać do własnego ~/.procmailrc linię: | |
101 | INCLUDERC=/etc/mail/spamassassin/spamassassin-default.rc | |
102 | ||
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). | |
105 | ||
106 | %package spamd | |
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} | |
112 | Requires: rc-scripts | |
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 | |
118 | ||
119 | %description spamd | |
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. | |
123 | ||
124 | This is intended to be used alongside "spamc", a fast, low-overhead C | |
125 | client program. | |
126 | ||
127 | %description spamd -l pl.UTF-8 | |
128 | Spamd jest "demoniczną" wersją spamassassina. Jego zadaniem jest | |
129 | poprawa wydajności automatycznego sprawdzania poczty. | |
130 | ||
131 | Spamd powinien być używany wespół ze "spamc", który jest szybkim i | |
132 | wydajnym programem klienckim. | |
133 | ||
134 | %package spamc | |
135 | Summary: spamc - client for spamd | |
136 | Summary(pl.UTF-8): spamc - klient dla spamd | |
137 | Group: Applications/Mail | |
138 | Suggests: perl-Compress-Zlib | |
139 | ||
140 | %description spamc | |
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. | |
147 | ||
148 | To enable spamassassin, if you are receiving mail locally, simply add | |
149 | this line to your ~/.procmailrc: | |
150 | INCLUDERC=/etc/mail/spamassassin/spamassassin-spamc.rc | |
151 | ||
152 | To filter spam for all users, add that line to /etc/procmailrc | |
153 | (creating if necessary). | |
154 | ||
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. | |
161 | ||
162 | Aby uruchomić spamassassina dla lokalnie przychodzącej poczty, | |
163 | wystarczy dodać do własnego ~/.procmailrc linię: | |
164 | INCLUDERC=/etc/mail/spamassassin/spamassassin-spamc.rc | |
165 | ||
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). | |
168 | ||
169 | %package compile | |
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 | |
173 | Requires: gcc | |
174 | Requires: glibc-devel | |
175 | Requires: make | |
176 | Requires: perl(ExtUtils::MakeMaker) | |
177 | Requires: perl-Mail-SpamAssassin = %{version}-%{release} | |
178 | Requires: perl-devel | |
179 | Requires: re2c >= 0.10 | |
180 | ||
181 | %description compile | |
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 | |
185 | plugin is loaded. | |
186 | ||
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. | |
191 | ||
192 | %package update | |
193 | Summary: sa-update - automate SpamAssassin rule updates | |
194 | Summary(pl.UTF-8): sa-update - automatyczne uaktualnianie regułek SpamAssassina | |
195 | Group: Applications/Mail | |
196 | Requires: crondaemon | |
197 | Requires: gnupg | |
198 | Requires: perl-Archive-Tar | |
199 | Requires: perl-Mail-SpamAssassin = %{version}-%{release} | |
200 | Requires: perl-libwww | |
201 | ||
202 | %description update | |
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 | |
206 | release. | |
207 | ||
208 | Update archives are verified by default using SHA1 hashes and GPG | |
209 | signatures. | |
210 | ||
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. | |
216 | ||
217 | Archiwa uaktualnień są sprawdzane domyślnie przy użyciu skrótów SHA1 i | |
218 | podpisów GPG. | |
219 | ||
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 | |
225 | # what for this one? | |
226 | #Requires: perl-Sys-Hostname-Long | |
227 | Suggests: Razor | |
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 | |
243 | ||
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. | |
251 | ||
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. | |
260 | ||
261 | %prep | |
262 | %setup -q -n %{pdir}-%{pnam}-%{version} | |
263 | ||
264 | %build | |
265 | # for spamc/configure | |
266 | export CFLAGS="%{rpmcflags}" | |
267 | %{__perl} Makefile.PL \ | |
268 | INSTALLDIRS=vendor \ | |
269 | PREFIX=%{_prefix} \ | |
270 | SYSCONFDIR=%{_sysconfdir} \ | |
271 | DATADIR=%{_datadir}/spamassassin \ | |
272 | ENABLE_SSL=yes \ | |
273 | CONTACT_ADDRESS="postmaster@localhost" \ | |
274 | PERL_BIN=%{__perl} < /dev/null | |
275 | %{__make} \ | |
276 | CC="%{__cc}" \ | |
277 | OPTIMIZE="%{rpmcflags}" | |
278 | ||
279 | %{__sed} -e "s,@@LOCAL_STATE_DIR@@,$(pwd)," sa-compile.raw > sa-compile.pl | |
280 | %{__perl} -T sa-compile.pl --siteconfigpath=rules | |
281 | ||
282 | %{?with_tests:%{__make} -j1 test} | |
283 | ||
284 | %install | |
285 | rm -rf $RPM_BUILD_ROOT | |
286 | install -d $RPM_BUILD_ROOT{/etc/{cron.d,sysconfig,rc.d/init.d},%{_sysconfdir}/mail/spamassassin/channel.d} | |
287 | ||
288 | %{__make} install \ | |
289 | DESTDIR=$RPM_BUILD_ROOT | |
290 | ||
291 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/sysconfig/spamd | |
292 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/spamd | |
293 | install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin | |
294 | install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin | |
295 | install %{SOURCE5} $RPM_BUILD_ROOT%{_datadir}/spamassassin/sa-update.cron | |
296 | install %{SOURCE6} $RPM_BUILD_ROOT/etc/cron.d/sa-update | |
297 | install %{SOURCE7} $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin/channel.d | |
298 | install %{SOURCE8} $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin/channel.d | |
299 | ||
300 | # sa-update, sa-compile | |
301 | install -d $RPM_BUILD_ROOT/var/lib/spamassassin/{%{sa_version},compiled/%{sa_version}} | |
302 | install -d $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin/sa-update-keys | |
303 | touch $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin/sa-update-keys/{pubring,secring,trustdb}.gpg | |
304 | ||
305 | rm -f $RPM_BUILD_ROOT{%{perl_archlib}/perllocal.pod,%{perl_vendorarch}/auto/Mail/SpamAssassin/.packlist,%{_mandir}/man3/spamassassin-run.*} | |
306 | ||
307 | cat > $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin/channels << 'EOF' | |
308 | # Use %{_sysconfdir}/mail/spamassassin/channel.d/*.conf for new channels | |
309 | EOF | |
310 | ||
311 | %clean | |
312 | rm -rf $RPM_BUILD_ROOT | |
313 | ||
314 | %post spamd | |
315 | /sbin/chkconfig --add spamd | |
316 | %service spamd restart | |
317 | ||
318 | %preun spamd | |
319 | if [ "$1" = "0" ]; then | |
320 | %service spamd stop | |
321 | /sbin/chkconfig --del spamd | |
322 | fi | |
323 | ||
324 | %triggerpostun spamd -- spamassassin-spamd < 3.1.0-5.3 | |
325 | # temp hack, should we care of the dead link? | |
326 | ln -s spamd /etc/rc.d/init.d/spamassassin | |
327 | /sbin/chkconfig --del spamassassin | |
328 | rm -f /etc/rc.d/init.d/spamassassin | |
329 | if [ -f /etc/sysconfig/spamassassin.rpmsave ]; then | |
330 | mv -f /etc/sysconfig/spamassassin.rpmsave /etc/sysconfig/spamd | |
331 | fi | |
332 | ||
333 | %files | |
334 | %defattr(644,root,root,755) | |
335 | %doc CREDITS Changes INSTALL README TRADEMARK UPGRADE USAGE | |
336 | %doc procmailrc.example sql/ ldap/ | |
337 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/spamassassin/spamassassin-default.rc | |
338 | %attr(755,root,root) %{_bindir}/sa-learn | |
339 | %attr(755,root,root) %{_bindir}/sa-awl | |
340 | %attr(755,root,root) %{_bindir}/spamassassin | |
341 | %attr(755,root,root) %{_bindir}/sa-check_spamd | |
342 | ||
343 | # It's needed for help of spamassassin command. | |
344 | %{perl_vendorlib}/spamassassin-run.pod | |
345 | %{_mandir}/man1/sa-learn.1* | |
346 | %{_mandir}/man1/spamassassin.1* | |
347 | %{_mandir}/man1/spamassassin-run.1* | |
348 | %{_mandir}/man1/sa-awl.1* | |
349 | ||
350 | %files spamd | |
351 | %defattr(644,root,root,755) | |
352 | %doc spamd/README* | |
353 | %attr(754,root,root) /etc/rc.d/init.d/spamd | |
354 | %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/spamd | |
355 | %attr(755,root,root) %{_bindir}/spamd | |
356 | %{_mandir}/man1/spamd.1* | |
357 | ||
358 | %files spamc | |
359 | %defattr(644,root,root,755) | |
360 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/spamassassin/spamassassin-spamc.rc | |
361 | %attr(755,root,root) %{_bindir}/spamc | |
362 | %{_mandir}/man1/spamc.1* | |
363 | ||
364 | %files compile | |
365 | %defattr(644,root,root,755) | |
366 | %attr(755,root,root) %{_bindir}/sa-compile | |
367 | %{_mandir}/man1/sa-compile.1* | |
368 | %dir /var/lib/spamassassin/compiled | |
369 | %dir /var/lib/spamassassin/compiled/%{sa_version} | |
370 | ||
371 | %files update | |
372 | %defattr(644,root,root,755) | |
373 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/spamassassin/channels | |
374 | %dir %{_sysconfdir}/mail/spamassassin/channel.d | |
375 | %{_sysconfdir}/mail/spamassassin/channel.d/spamassassin-official.conf | |
376 | %{_sysconfdir}/mail/spamassassin/channel.d/sought.conf | |
377 | %attr(700,root,root) %dir %{_sysconfdir}/mail/spamassassin/sa-update-keys | |
378 | %attr(700,root,root) %ghost %{_sysconfdir}/mail/spamassassin/sa-update-keys/* | |
379 | %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/sa-update | |
380 | %attr(755,root,root) %{_bindir}/sa-update | |
381 | %attr(755,root,root) %{_datadir}/spamassassin/sa-update.cron | |
382 | %{_datadir}/spamassassin/sa-update-pubkey.txt | |
383 | %dir /var/lib/spamassassin/%{sa_version} | |
384 | %{_mandir}/man1/sa-update.1* | |
385 | ||
386 | %files -n perl-Mail-SpamAssassin | |
387 | %defattr(644,root,root,755) | |
388 | %doc sample-nonspam.txt sample-spam.txt | |
389 | %dir %{_sysconfdir}/mail/spamassassin | |
390 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/spamassassin/*.pre | |
391 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/spamassassin/*.cf | |
392 | %exclude %{_sysconfdir}/mail/spamassassin/sa-update-keys | |
393 | %dir %{_datadir}/spamassassin | |
394 | %config(noreplace) %{_datadir}/spamassassin/languages | |
395 | %config(noreplace) %{_datadir}/spamassassin/user_prefs.template | |
396 | %exclude %{_datadir}/spamassassin/sa-update-pubkey.txt | |
397 | ||
398 | %dir /var/lib/spamassassin | |
399 | ||
400 | %{perl_vendorlib}/Mail/* | |
401 | %{_mandir}/man3/*.3* |