]> TLD Linux GIT Repositories - packages/spamassassin.git/blob - spamassassin.spec
- merged 3.4.2 from PLD
[packages/spamassassin.git] / spamassassin.spec
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.2
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:  4f4c38a7cd4ae3e3750895ae21d2fc78
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 Patch0:         bug_771408_perl_version
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
49 BuildRequires:  re2c
50 BuildRequires:  rpm-perlprov >= 4.1-13
51 BuildRequires:  rpmbuild(macros) >= 1.453
52 %if %{with tests}
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
63 %endif
64 Requires:       perl-Mail-SpamAssassin = %{version}-%{release}
65 Obsoletes:      SpamAssassin
66 Obsoletes:      spamassassin-tools
67 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
68
69 %define         _noautoreq      'perl(Razor2::Client::Agent)' 'perl(Razor::Agent)' 'perl(Razor::Client)' 'perl(DBI)' 'perl(Net::Ident)'
70
71 %description
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.
81
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
85
86 To filter spam for all users, add that line to /etc/procmailrc
87 (creating if necessary).
88
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.
99
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
103
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).
106
107 %package spamd
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}
113 Requires:       rc-scripts
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
119
120 %description spamd
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.
124
125 This is intended to be used alongside "spamc", a fast, low-overhead C
126 client program.
127
128 %description spamd -l pl.UTF-8
129 Spamd jest "demoniczną" wersją spamassassina. Jego zadaniem jest
130 poprawa wydajności automatycznego sprawdzania poczty.
131
132 Spamd powinien być używany wespół ze "spamc", który jest szybkim i
133 wydajnym programem klienckim.
134
135 %package spamc
136 Summary:        spamc - client for spamd
137 Summary(pl.UTF-8):      spamc - klient dla spamd
138 Group:          Applications/Mail
139 Suggests:       perl-Compress-Zlib
140
141 %description spamc
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.
148
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
152
153 To filter spam for all users, add that line to /etc/procmailrc
154 (creating if necessary).
155
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.
162
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
166
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).
169
170 %package compile
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
174 Requires:       gcc
175 Requires:       glibc-devel
176 Requires:       make
177 Requires:       perl(ExtUtils::MakeMaker)
178 Requires:       perl-Mail-SpamAssassin = %{version}-%{release}
179 Requires:       perl-devel
180 Requires:       re2c >= 0.10
181
182 %description compile
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
186 plugin is loaded.
187
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.
192
193 %package update
194 Summary:        sa-update - automate SpamAssassin rule updates
195 Summary(pl.UTF-8):      sa-update - automatyczne uaktualnianie regułek SpamAssassina
196 Group:          Applications/Mail
197 Requires:       cronjobs
198 Requires:       gnupg
199 Requires:       perl-Archive-Tar
200 Requires:       perl-Mail-SpamAssassin = %{version}-%{release}
201 Requires:       perl-libwww
202
203 %description update
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
207 release.
208
209 Update archives are verified by default using SHA1 hashes and GPG
210 signatures.
211
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.
217
218 Archiwa uaktualnień są sprawdzane domyślnie przy użyciu skrótów SHA1 i
219 podpisów GPG.
220
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
226 # what for this one?
227 #Requires:      perl-Sys-Hostname-Long
228 Suggests:       Razor
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
244
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.
252
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.
261
262 %prep
263 %setup -q -n %{pdir}-%{pnam}-%{version}
264 %patch0 -p1
265
266 # disable broken test
267 %{__mv} t/sa_compile.t{,.disabled}
268
269 # this test needs network, does not work on builders
270 %{__mv} t/dnsbl_subtests.t{,.disabled}
271
272 # temporary disable problematic tests
273 %{__mv} t/trust_path.t{,.disabled}
274 %{__mv} t/urilocalbl_geoip.t{,.disabled}
275
276 %build
277 # for spamc/configure
278 export CFLAGS="%{rpmcflags}"
279 %{__perl} Makefile.PL \
280         INSTALLDIRS=vendor \
281         PREFIX=%{_prefix} \
282         SYSCONFDIR=%{_sysconfdir} \
283         DATADIR=%{_datadir}/spamassassin \
284         ENABLE_SSL=yes \
285         CONTACT_ADDRESS="postmaster@localhost" \
286         PERL_BIN=%{__perl} < /dev/null
287
288 %{__make} \
289         CC="%{__cc}" \
290         OPTIMIZE="%{rpmcflags}"
291
292 %{?with_tests:%{__make} -j1 TEST_VERBOSE=1 test}
293
294 %install
295 rm -rf $RPM_BUILD_ROOT
296 install -d $RPM_BUILD_ROOT{/etc/{cron.d,sysconfig,rc.d/init.d},%{_sysconfdir}/mail/spamassassin/channel.d}
297
298 %{__make} install \
299         DESTDIR=$RPM_BUILD_ROOT
300
301 install %{SOURCE1} $RPM_BUILD_ROOT/etc/sysconfig/spamd
302 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/spamd
303 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin
304 install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin
305 install %{SOURCE5} $RPM_BUILD_ROOT%{_datadir}/spamassassin/sa-update.cron
306 install %{SOURCE6} $RPM_BUILD_ROOT/etc/cron.d/sa-update
307 install %{SOURCE7} $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin/channel.d
308 install %{SOURCE8} $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin/channel.d
309
310 # sa-update, sa-compile
311 install -d $RPM_BUILD_ROOT/var/lib/spamassassin/{%{sa_version},compiled/%{sa_version}}
312 install -d $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin/sa-update-keys
313 touch $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin/sa-update-keys/{pubring,secring,trustdb}.gpg
314
315 rm -f $RPM_BUILD_ROOT{%{perl_archlib}/perllocal.pod,%{perl_vendorarch}/auto/Mail/SpamAssassin/.packlist,%{_mandir}/man3/spamassassin-run.*}
316
317 cat > $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin/channels << 'EOF'
318 # Use %{_sysconfdir}/mail/spamassassin/channel.d/*.conf for new channels
319 EOF
320
321 %clean
322 rm -rf $RPM_BUILD_ROOT
323
324 %post spamd
325 /sbin/chkconfig --add spamd
326 %service spamd restart
327
328 %preun spamd
329 if [ "$1" = "0" ]; then
330         %service spamd stop
331         /sbin/chkconfig --del spamd
332 fi
333
334 %triggerpostun spamd -- spamassassin-spamd < 3.1.0-5.3
335 # temp hack, should we care of the dead link?
336 ln -s spamd /etc/rc.d/init.d/spamassassin
337 /sbin/chkconfig --del spamassassin
338 rm -f /etc/rc.d/init.d/spamassassin
339 if [ -f /etc/sysconfig/spamassassin.rpmsave ]; then
340         mv -f /etc/sysconfig/spamassassin.rpmsave /etc/sysconfig/spamd
341 fi
342
343 %files
344 %defattr(644,root,root,755)
345 %doc CREDITS Changes INSTALL README TRADEMARK UPGRADE USAGE
346 %doc procmailrc.example sql/ ldap/
347 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/spamassassin/spamassassin-default.rc
348 %attr(755,root,root) %{_bindir}/sa-learn
349 %attr(755,root,root) %{_bindir}/sa-awl
350 %attr(755,root,root) %{_bindir}/spamassassin
351 %attr(755,root,root) %{_bindir}/sa-check_spamd
352
353 # It's needed for help of spamassassin command.
354 %{perl_vendorlib}/spamassassin-run.pod
355 %{_mandir}/man1/sa-learn.1*
356 %{_mandir}/man1/spamassassin.1*
357 %{_mandir}/man1/spamassassin-run.1*
358 %{_mandir}/man1/sa-awl.1*
359
360 %files spamd
361 %defattr(644,root,root,755)
362 %doc spamd/README*
363 %attr(754,root,root) /etc/rc.d/init.d/spamd
364 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/spamd
365 %attr(755,root,root) %{_bindir}/spamd
366 %{_mandir}/man1/spamd.1*
367
368 %files spamc
369 %defattr(644,root,root,755)
370 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/spamassassin/spamassassin-spamc.rc
371 %attr(755,root,root) %{_bindir}/spamc
372 %{_mandir}/man1/spamc.1*
373
374 %files compile
375 %defattr(644,root,root,755)
376 %attr(755,root,root) %{_bindir}/sa-compile
377 %{_mandir}/man1/sa-compile.1*
378 %dir /var/lib/spamassassin/compiled
379 %dir /var/lib/spamassassin/compiled/%{sa_version}
380
381 %files update
382 %defattr(644,root,root,755)
383 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/spamassassin/channels
384 %dir %{_sysconfdir}/mail/spamassassin/channel.d
385 %{_sysconfdir}/mail/spamassassin/channel.d/spamassassin-official.conf
386 %{_sysconfdir}/mail/spamassassin/channel.d/sought.conf
387 %attr(700,root,root) %dir %{_sysconfdir}/mail/spamassassin/sa-update-keys
388 %attr(700,root,root) %ghost %{_sysconfdir}/mail/spamassassin/sa-update-keys/*
389 %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/sa-update
390 %attr(755,root,root) %{_bindir}/sa-update
391 %attr(755,root,root) %{_datadir}/spamassassin/sa-update.cron
392 %{_datadir}/spamassassin/sa-update-pubkey.txt
393 %dir /var/lib/spamassassin/%{sa_version}
394 %{_mandir}/man1/sa-update.1*
395
396 %files -n perl-Mail-SpamAssassin
397 %defattr(644,root,root,755)
398 %doc sample-nonspam.txt sample-spam.txt
399 %dir %{_sysconfdir}/mail/spamassassin
400 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/spamassassin/*.pre
401 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/spamassassin/*.cf
402 %exclude %{_sysconfdir}/mail/spamassassin/sa-update-keys
403 %dir %{_datadir}/spamassassin
404 %config(noreplace) %{_datadir}/spamassassin/languages
405 %config(noreplace) %{_datadir}/spamassassin/user_prefs.template
406 %exclude %{_datadir}/spamassassin/sa-update-pubkey.txt
407
408 %dir /var/lib/spamassassin
409
410 %{perl_vendorlib}/Mail/*
411 %{_mandir}/man3/*.3*