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