]> git.pld-linux.org Git - packages/spamassassin.git/blob - spamassassin.spec
9b53a835efe9fcaf3f6a8452beec1e5e2eda28e2
[packages/spamassassin.git] / spamassassin.spec
1 # TODO
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?
7 #
8 # Conditional build:
9 %bcond_without  tests           # do not perform "make test"
10 #
11 %include        /usr/lib/rpm/macros.perl
12 %define         pdir    Mail
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)
17 Name:           spamassassin
18 Version:        3.2.1
19 Release:        1
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
46 BuildRequires:  re2c
47 BuildRequires:  rpmbuild(macros) >= 1.310
48 %if %{with tests}
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
59 %endif
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)
66
67 %define         _noautoreq      'perl(Razor2::Client::Agent)' 'perl(Razor::Agent)' 'perl(Razor::Client)' 'perl(DBI)' 'perl(Net::Ident)'
68
69 %description
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
78 processing of mail.
79
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
83
84 To filter spam for all users, add that line to /etc/procmailrc
85 (creating if necessary).
86
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.
97
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
101
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).
104
105 %package tools
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
110
111 %description tools
112 Miscleanous tools from various authors, distributed with SpamAssassin.
113 See /usr/share/doc/spamassassin-tools-*/.
114
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-*/.
118
119 %package spamd
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}
125 Requires:       rc-scripts
126 Suggests:       spamassassin-update
127 Suggests:       perl-IO-Socket-SSL
128
129 %description spamd
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.
133
134 This is intended to be used alongside "spamc", a fast, low-overhead C
135 client program.
136
137 %description spamd -l pl.UTF-8
138 Spamd jest "demoniczną" wersją spamassassina. Jego zadaniem jest
139 poprawa wydajności automatycznego sprawdzania poczty.
140
141 Spamd powinien być używany wespół ze "spamc", który jest szybkim i
142 wydajnym programem klienckim.
143
144 %package spamc
145 Summary:        spamc - client for spamd
146 Summary(pl.UTF-8):      spamc - klient dla spamd
147 Group:          Applications/Mail
148
149 %description spamc
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.
156
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
160
161 To filter spam for all users, add that line to /etc/procmailrc
162 (creating if necessary).
163
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.
170
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
174
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).
177
178 %package compile
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
182 Requires:       gcc
183 Requires:       glibc-devel
184 Requires:       make
185 Requires:       perl(ExtUtils::MakeMaker)
186 Requires:       perl-Mail-SpamAssassin = %{version}-%{release}
187 Requires:       perl-devel
188 Requires:       re2c >= 0.10
189
190 %description compile
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
194 plugin is loaded.
195
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.
200
201 %package update
202 Summary:        sa-update - automate SpamAssassin rule updates
203 Summary(pl.UTF-8):      sa-update - automatyczne uaktualnianie regułek SpamAssassina
204 Group:          Applications/Mail
205 Requires:       gnupg
206 Requires:       perl-Archive-Tar
207 Requires:       perl-Mail-SpamAssassin = %{version}-%{release}
208 Requires:       perl-libwww
209
210 %description update
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
214 release.
215
216 Update archives are verified by default using SHA1 hashes and GPG
217 signatures.
218
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.
224
225 Archiwa uaktualnień są sprawdzane domyślnie przy użyciu skrótów SHA1 i
226 podpisów GPG.
227
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
238
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.
246
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.
255
256 %prep
257 %setup -q -n %{pdir}-%{pnam}-%{version}
258
259 %build
260 # for spamc/configure
261 export CFLAGS="%{rpmcflags}"
262 %{__perl} Makefile.PL \
263         INSTALLDIRS=vendor \
264         PREFIX=%{_prefix} \
265         SYSCONFDIR=%{_sysconfdir} \
266         ENABLE_SSL=yes \
267         CONTACT_ADDRESS="postmaster@localhost" \
268         PERL_BIN=%{__perl} < /dev/null
269 %{__make} \
270         CC="%{__cc}" \
271         OPTIMIZE="%{rpmcflags}"
272
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
276
277 %{?with_tests:%{__make} test}
278
279 %install
280 rm -rf $RPM_BUILD_ROOT
281 install -d $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d},%{_sysconfdir}/mail/spamassassin}
282
283 %{__make} install \
284         DESTDIR=$RPM_BUILD_ROOT
285
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
290
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
296
297 rm -f $RPM_BUILD_ROOT{%{perl_archlib}/perllocal.pod,%{perl_vendorarch}/auto/Mail/SpamAssassin/.packlist,%{_mandir}/man3/spamassassin-run.*}
298
299 %clean
300 rm -rf $RPM_BUILD_ROOT
301
302 %post spamd
303 /sbin/chkconfig --add spamd
304 %service spamd restart
305
306 %preun spamd
307 if [ "$1" = "0" ]; then
308         %service spamd stop
309         /sbin/chkconfig --del spamd
310 fi
311
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
319 fi
320
321 %files
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
328
329 # It's needed for help of spamassassin command.
330 %{perl_vendorlib}/spamassassin-run.pod
331 %{_mandir}/man1/sa-learn*
332 %{_mandir}/man1/spamassassin*
333
334 %files tools
335 %defattr(644,root,root,755)
336 %doc sql ldap
337
338 %files spamd
339 %defattr(644,root,root,755)
340 %doc spamd/README*
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*
345
346 %files spamc
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*
351
352 %files compile
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}
358
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
371
372 %files update
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*
380
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
388
389 %dir %{_datadir}/spamassassin
390 %config(noreplace) %{_datadir}/spamassassin/*
391 %exclude %{_datadir}/spamassassin/sa-update-pubkey.txt
392
393 %dir /var/lib/spamassassin
394
395 %{perl_vendorlib}/Mail/*
396 %{_mandir}/man3/*
This page took 0.127479 seconds and 3 git commands to generate.