]> git.pld-linux.org Git - packages/spamassassin.git/blob - spamassassin.spec
- release 6
[packages/spamassassin.git] / spamassassin.spec
1 # TODO
2 # - build lib{,ssl}spamc.so (if there is a point)
3 #
4 # Conditional build:
5 %bcond_without  tests           # do not perform "make test"
6 #
7 %include        /usr/lib/rpm/macros.perl
8 %define         pdir    Mail
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)
13 Name:           spamassassin
14 Version:        3.2.5
15 Release:        6
16 License:        Apache v2.0
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
24 Source5:        sa-update.sh
25 Source6:        sa-update.cron
26 Patch0:         %{name}-bug-6269.patch
27 Patch1:         %{name}-bug-6131.patch
28 URL:            http://spamassassin.apache.org/
29 BuildRequires:  dos2unix
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-Razor2
45 BuildRequires:  perl-devel >= 1:5.8.0
46 BuildRequires:  perl-libwww
47 BuildRequires:  re2c
48 BuildRequires:  rpm-perlprov >= 4.1-13
49 BuildRequires:  rpmbuild(macros) >= 1.453
50 %if %{with tests}
51 # are these really needed?
52 BuildRequires:  perl-Compress-Zlib
53 BuildRequires:  perl-Encode-Detect
54 BuildRequires:  perl-MIME-Base64
55 BuildRequires:  perl-MIME-tools
56 BuildRequires:  perl-Mail-DKIM
57 BuildRequires:  perl-Mail-DomainKeys
58 BuildRequires:  perl-Mail-SPF
59 BuildRequires:  perl-MailTools
60 BuildRequires:  perl-Razor > 2.61
61 %endif
62 Requires:       perl-Mail-SpamAssassin = %{version}-%{release}
63 Obsoletes:      SpamAssassin
64 Obsoletes:      spamassassin-tools
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 Apache SpamAssassin provides you with a way to reduce if not
71 completely eliminate Unsolicited Commercial Email (SPAM) from your
72 incoming email. It can be invoked by a MDA such as sendmail or
73 postfix, or can be called from a procmail script, .forward file, etc.
74 It uses a genetic-algorithm evolved scoring system to identify
75 messages which look spammy, then adds headers to the message so they
76 can be filtered by the user's mail reading software. This distribution
77 includes the spamd/spamc components which create a server that
78 considerably speeds 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 Apache 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 spamd
106 Summary:        spamd - daemonized version of spamassassin
107 Summary(pl.UTF-8):      spamd - spamassassin w postaci demona
108 Group:          Applications/Mail
109 Requires(post,preun):   /sbin/chkconfig
110 Requires:       perl-Mail-SpamAssassin = %{version}-%{release}
111 Requires:       rc-scripts
112 Suggests:       perl-Apache-Test
113 Suggests:       perl-IO-Socket-SSL
114 Suggests:       perl-Net-Ident
115
116 %description spamd
117 The purpose of this program is to provide a daemonized version of the
118 spamassassin executable. The goal is improving throughput performance
119 for automated mail checking.
120
121 This is intended to be used alongside "spamc", a fast, low-overhead C
122 client program.
123
124 %description spamd -l pl.UTF-8
125 Spamd jest "demoniczną" wersją spamassassina. Jego zadaniem jest
126 poprawa wydajności automatycznego sprawdzania poczty.
127
128 Spamd powinien być używany wespół ze "spamc", który jest szybkim i
129 wydajnym programem klienckim.
130
131 %package spamc
132 Summary:        spamc - client for spamd
133 Summary(pl.UTF-8):      spamc - klient dla spamd
134 Group:          Applications/Mail
135 Suggests:       perl-Compress-Zlib
136
137 %description spamc
138 Spamc is the client half of the spamc/spamd pair. It should be used in
139 place of "spamassassin" in scripts to process mail. It will read the
140 mail from STDIN, and spool it to its connection to spamd, then read
141 the result back and print it to STDOUT. Spamc has extremely low
142 overhead in loading, so it should be much faster to load than the
143 whole spamassassin program.
144
145 To enable spamassassin, if you are receiving mail locally, simply add
146 this line to your ~/.procmailrc:
147 INCLUDERC=/etc/mail/spamassassin/spamassassin-spamc.rc
148
149 To filter spam for all users, add that line to /etc/procmailrc
150 (creating if necessary).
151
152 %description spamc -l pl.UTF-8
153 Spamc powinien być używany zamiast "spamassassina" w skryptach
154 przetwarzających pocztę. Zczytuje pocztę ze STDIN, kolejkuje ją a
155 następnie przekazuje spamdowi, odczytuje wynik i podaje go na STDOUT.
156 Spamc stara się nie obciążać zbytnio procesora podczas ładowania,
157 dzięki czemu powinien działać szybciej niż sam spamassassin.
158
159 Aby uruchomić spamassassina dla lokalnie przychodzącej poczty,
160 wystarczy dodać do własnego ~/.procmailrc linię:
161 INCLUDERC=/etc/mail/spamassassin/spamassassin-spamc.rc
162
163 Aby filtrować spam dla wszystkich użytkowników, należy dodać tę linię
164 do pliku /etc/procmailrc (tworząc go w razie potrzeby).
165
166 %package compile
167 Summary:        sa-compile - compile SpamAssassin ruleset into native code
168 Summary(pl.UTF-8):      sa-compile - kompilowanie reguł SpamAssasina do kodu natywnego
169 Group:          Applications/Mail
170 Requires:       gcc
171 Requires:       glibc-devel
172 Requires:       make
173 Requires:       perl(ExtUtils::MakeMaker)
174 Requires:       perl-Mail-SpamAssassin = %{version}-%{release}
175 Requires:       perl-devel
176 Requires:       re2c >= 0.10
177
178 %description compile
179 sa-compile uses "re2c" to compile the SpamAssassin ruleset. This is
180 then used by the "Mail::SpamAssassin::Plugin::Rule2XSBody" plugin to
181 speed up SpamAssassin's operation, where possible, and when that
182 plugin is loaded.
183
184 %description compile -l pl.UTF-8
185 sa-compile wykorzystuje re2c do kompilacji reguł SpamAssassina. Służy
186 to do przyspieszenia operacji SpamAssassina w miarę możliwości, kiedy
187 ta wtyczka jest wczytana.
188
189 %package update
190 Summary:        sa-update - automate SpamAssassin rule updates
191 Summary(pl.UTF-8):      sa-update - automatyczne uaktualnianie regułek SpamAssassina
192 Group:          Applications/Mail
193 Requires:       gnupg
194 Requires:       perl-Archive-Tar
195 Requires:       perl-Mail-SpamAssassin = %{version}-%{release}
196 Requires:       perl-libwww
197
198 %description update
199 sa-update automates the process of downloading and installing new
200 rules and configuration, based on channels. The default channel is
201 updates.spamassassin.org, which has updated rules since the previous
202 release.
203
204 Update archives are verified by default using SHA1 hashes and GPG
205 signatures.
206
207 %description update -l pl.UTF-8
208 sa-update automatyzuje proces ściągania i instalowania nowych regułek
209 i konfiguracji w oparciu o kanały. Domyślny kanał to
210 updates.spamassassin.org, który ma uaktualnione regułki od czasu
211 poprzedniego wydania.
212
213 Archiwa uaktualnień są sprawdzane domyślnie przy użyciu skrótów SHA1 i
214 podpisów GPG.
215
216 %package -n perl-Mail-SpamAssassin
217 Summary:        Mail::SpamAssassin - SpamAssassin e-mail filter libraries
218 Summary(pl.UTF-8):      Mail::SpamAssassin - biblioteki filtra poczty SpamAssassin
219 Group:          Development/Languages/Perl
220 Requires:       perl-HTML-Parser >= 3
221 # what for this one?
222 #Requires:      perl-Sys-Hostname-Long
223 Suggests:       Razor
224 Suggests:       perl-Cache-DB_File >= 0.2
225 Suggests:       perl-DBD-mysql
226 Suggests:       perl-Encode-Detect
227 Suggests:       perl-IO-Socket-INET6 >= 2.51
228 Suggests:       perl-IP-Country
229 Suggests:       perl-Mail-DKIM
230 #Suggests:      perl-Mail-DomainKeys
231 #Suggests:      perl-Mail-SPF
232 Suggests:       perl-Mail-SPF-Query
233 Suggests:       perl-Net-DNS >= 0.34
234 Suggests:       spamassassin-compile
235 Suggests:       spamassassin-plugin-fuzzyocr
236 Suggests:       spamassassin-update
237
238 %description -n perl-Mail-SpamAssassin
239 Mail::SpamAssassin is a Mail::Audit plugin to identify spam using text
240 analysis and several internet-based realtime blacklists. Using its
241 rule base, it uses a wide range of heuristic tests on mail headers and
242 body text to identify ``spam'', also known as unsolicited commercial
243 email. Once identified, the mail can then be optionally tagged as spam
244 for later filtering using the user's own mail user-agent application.
245
246 %description -n perl-Mail-SpamAssassin -l pl.UTF-8
247 Mail::SpamAssassin jest pluginem dla Mail::Audit, służącym do
248 identyfikacji spamu przy użyciu analizy zawartości i/lub internetowych
249 czarnych list. Do zidentyfikowania jako ,,spam'' stosuje szeroki
250 zakres testów heurystycznych na nagłówkach i treści, posiłkując się
251 stworzoną wcześniej bazą reguł. Po zidentyfikowaniu, poczta może być
252 oznaczona jako spam w celu późniejszego wyfiltrowania, np. przy użyciu
253 aplikacji do czytania poczty.
254
255 %prep
256 %setup -q -n %{pdir}-%{pnam}-%{version}
257 dos2unix rules/72_active.cf
258 %patch0 -p1
259 %patch1 -p1
260
261 %build
262 # for spamc/configure
263 export CFLAGS="%{rpmcflags}"
264 %{__perl} Makefile.PL \
265         INSTALLDIRS=vendor \
266         PREFIX=%{_prefix} \
267         SYSCONFDIR=%{_sysconfdir} \
268         DATADIR=%{_datadir}/spamassassin \
269         ENABLE_SSL=yes \
270         CONTACT_ADDRESS="postmaster@localhost" \
271         PERL_BIN=%{__perl} < /dev/null
272 %{__make} \
273         CC="%{__cc}" \
274         OPTIMIZE="%{rpmcflags}"
275
276 %{__sed} -e "s,@@LOCAL_STATE_DIR@@,$(pwd)," sa-compile.raw > sa-compile.pl
277 %{__perl} -T sa-compile.pl --siteconfigpath=rules
278 rm -f compiled/%{sa_version}/auto/Mail/SpamAssassin/CompiledRegexps/body_0/.packlist
279
280 %{?with_tests:%{__make} test}
281
282 %install
283 rm -rf $RPM_BUILD_ROOT
284 install -d $RPM_BUILD_ROOT{/etc/{cron.d,sysconfig,rc.d/init.d},%{_sysconfdir}/mail/spamassassin}
285
286 %{__make} install \
287         DESTDIR=$RPM_BUILD_ROOT
288
289 install %{SOURCE1} $RPM_BUILD_ROOT/etc/sysconfig/spamd
290 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/spamd
291 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin
292 install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin
293 install %{SOURCE5} $RPM_BUILD_ROOT%{_datadir}/spamassassin/sa-update.cron
294 install %{SOURCE6} $RPM_BUILD_ROOT/etc/cron.d/sa-update
295
296 # sa-update, sa-compile
297 install -d $RPM_BUILD_ROOT/var/lib/spamassassin/{%{sa_version},compiled/%{sa_version}}
298 install -d $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin/sa-update-keys
299 touch $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin/sa-update-keys/{pubring,secring,trustdb}.gpg
300 cp -a compiled/*/%{sa_version} $RPM_BUILD_ROOT/var/lib/spamassassin/compiled
301
302 rm -f $RPM_BUILD_ROOT{%{perl_archlib}/perllocal.pod,%{perl_vendorarch}/auto/Mail/SpamAssassin/.packlist,%{_mandir}/man3/spamassassin-run.*}
303
304 cat > $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin/channels << 'EOF'
305 updates.spamassassin.org
306 # http://saupdates.openprotect.com/
307 # saupdates.openprotect.com
308 EOF
309
310 %clean
311 rm -rf $RPM_BUILD_ROOT
312
313 %post spamd
314 /sbin/chkconfig --add spamd
315 %service spamd restart
316
317 %preun spamd
318 if [ "$1" = "0" ]; then
319         %service spamd stop
320         /sbin/chkconfig --del spamd
321 fi
322
323 %triggerpostun spamd -- spamassassin-spamd < 3.1.0-5.3
324 # temp hack, should we care of the dead link?
325 ln -s spamd /etc/rc.d/init.d/spamassassin
326 /sbin/chkconfig --del spamassassin
327 rm -f /etc/rc.d/init.d/spamassassin
328 if [ -f /etc/sysconfig/spamassassin.rpmsave ]; then
329         mv -f /etc/sysconfig/spamassassin.rpmsave /etc/sysconfig/spamd
330 fi
331
332 %files
333 %defattr(644,root,root,755)
334 %doc CREDITS Changes INSTALL README TRADEMARK UPGRADE USAGE
335 %doc procmailrc.example sql/ ldap/
336 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/spamassassin/spamassassin-default.rc
337 %attr(755,root,root) %{_bindir}/sa-learn
338 %attr(755,root,root) %{_bindir}/spamassassin
339
340 # It's needed for help of spamassassin command.
341 %{perl_vendorlib}/spamassassin-run.pod
342 %{_mandir}/man1/sa-learn*
343 %{_mandir}/man1/spamassassin*
344
345 %files spamd
346 %defattr(644,root,root,755)
347 %doc spamd/README*
348 %attr(754,root,root) /etc/rc.d/init.d/spamd
349 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/spamd
350 %attr(755,root,root) %{_bindir}/spamd
351 %{_mandir}/man1/spamd*
352
353 %files spamc
354 %defattr(644,root,root,755)
355 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/spamassassin/spamassassin-spamc.rc
356 %attr(755,root,root) %{_bindir}/spamc
357 %{_mandir}/man1/spamc*
358
359 %files compile
360 %defattr(644,root,root,755)
361 %attr(755,root,root) %{_bindir}/sa-compile
362 %{_mandir}/man1/sa-compile*
363 %dir /var/lib/spamassassin/compiled
364 %dir /var/lib/spamassassin/compiled/%{sa_version}
365
366 # maybe include these in main package?
367 %dir /var/lib/spamassassin/compiled/%{sa_version}/auto
368 %dir /var/lib/spamassassin/compiled/%{sa_version}/auto/Mail
369 %dir /var/lib/spamassassin/compiled/%{sa_version}/auto/Mail/SpamAssassin
370 %dir /var/lib/spamassassin/compiled/%{sa_version}/auto/Mail/SpamAssassin/CompiledRegexps
371 %dir /var/lib/spamassassin/compiled/%{sa_version}/auto/Mail/SpamAssassin/CompiledRegexps/body_0
372 %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
373 %config(noreplace) %verify(not md5 mtime size) /var/lib/spamassassin/compiled/%{sa_version}/auto/Mail/SpamAssassin/CompiledRegexps/body_0/body_0.bs
374 %dir /var/lib/spamassassin/compiled/%{sa_version}/Mail
375 %dir /var/lib/spamassassin/compiled/%{sa_version}/Mail/SpamAssassin
376 %dir /var/lib/spamassassin/compiled/%{sa_version}/Mail/SpamAssassin/CompiledRegexps
377 %config(noreplace) %verify(not md5 mtime size) /var/lib/spamassassin/compiled/%{sa_version}/Mail/SpamAssassin/CompiledRegexps/body_0.pm
378 %config(noreplace) %verify(not md5 mtime size) /var/lib/spamassassin/compiled/%{sa_version}/bases_body_0.pl
379
380 %files update
381 %defattr(644,root,root,755)
382 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/spamassassin/channels
383 %attr(700,root,root) %dir %{_sysconfdir}/mail/spamassassin/sa-update-keys
384 %attr(700,root,root) %ghost %{_sysconfdir}/mail/spamassassin/sa-update-keys/*
385 %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/sa-update
386 %attr(755,root,root) %{_bindir}/sa-update
387 %attr(755,root,root) %{_datadir}/spamassassin/sa-update.cron
388 %{_datadir}/spamassassin/sa-update-pubkey.txt
389 %dir /var/lib/spamassassin/%{sa_version}
390 %{_mandir}/man1/sa-update*
391
392 %files -n perl-Mail-SpamAssassin
393 %defattr(644,root,root,755)
394 %doc sample-nonspam.txt sample-spam.txt
395 %dir %{_sysconfdir}/mail/spamassassin
396 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/spamassassin/*.pre
397 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/spamassassin/*.cf
398 %exclude %{_sysconfdir}/mail/spamassassin/sa-update-keys
399
400 %dir %{_datadir}/spamassassin
401 %config(noreplace) %{_datadir}/spamassassin/*
402 %exclude %{_datadir}/spamassassin/sa-update-pubkey.txt
403
404 %dir /var/lib/spamassassin
405
406 %{perl_vendorlib}/Mail/*
407 %{_mandir}/man3/*
This page took 0.073925 seconds and 4 git commands to generate.