]> git.pld-linux.org Git - packages/spamassassin.git/blame_incremental - spamassassin.spec
- perl 5.18 patch added
[packages/spamassassin.git] / spamassassin.spec
... / ...
CommitLineData
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%include /usr/lib/rpm/macros.perl
9%define pdir Mail
10%define pnam SpamAssassin
11%define sa_version %(printf %d.%03d%03d $(echo %{version} | tr '.' ' '))
12Summary: A spam filter for email which can be invoked from mail delivery agents
13Summary(pl.UTF-8): Filtr antyspamowy, przeznaczony dla programów dostarczających pocztę (MDA)
14Name: spamassassin
15Version: 3.3.2
16Release: 4
17License: Apache v2.0
18Group: Applications/Mail
19Source0: http://ftp.tpnet.pl/vol/d1/apache/spamassassin/source/%{pdir}-%{pnam}-%{version}.tar.bz2
20# Source0-md5: 253f8fcbeb6c8bfcab9d139865c1a404
21Source1: %{name}.sysconfig
22Source2: %{name}-spamd.init
23Source3: %{name}-default.rc
24Source4: %{name}-spamc.rc
25Source5: sa-update.sh
26Source6: sa-update.cron
27Patch0: %{name}-perl_5.18.patch
28URL: http://spamassassin.apache.org/
29BuildRequires: openssl-devel >= 0.9.7d
30BuildRequires: perl(ExtUtils::MakeMaker) >= 6.16
31BuildRequires: perl-Archive-Tar
32BuildRequires: perl-DBI
33BuildRequires: perl-DB_File
34BuildRequires: perl-Digest-SHA1 >= 2.10
35BuildRequires: perl-HTML-Parser >= 3
36BuildRequires: perl-IO-Socket-INET6 >= 2.51
37BuildRequires: perl-IO-Socket-SSL
38BuildRequires: perl-IO-Zlib
39BuildRequires: perl-IP-Country
40BuildRequires: perl-Mail-SPF-Query
41BuildRequires: perl-Net-DNS >= 0.65-3
42BuildRequires: perl-Net-Ident
43BuildRequires: perl-NetAddr-IP >= 4.000
44#BuildRequires: perl-Razor2
45BuildRequires: perl-devel >= 1:5.8.0
46BuildRequires: perl-libwww
47BuildRequires: re2c
48BuildRequires: rpm-perlprov >= 4.1-13
49BuildRequires: rpmbuild(macros) >= 1.453
50%if %{with tests}
51# are these really needed?
52#BuildRequires: perl-Compress-Zlib
53BuildRequires: perl-Encode-Detect
54BuildRequires: perl-MIME-Base64
55BuildRequires: perl-MIME-tools
56BuildRequires: perl-Mail-DKIM
57BuildRequires: perl-Mail-DomainKeys
58BuildRequires: perl-Mail-SPF
59BuildRequires: perl-MailTools
60BuildRequires: perl-Razor > 2.61
61%endif
62Requires: perl-Mail-SpamAssassin = %{version}-%{release}
63Obsoletes: SpamAssassin
64Obsoletes: spamassassin-tools
65BuildRoot: %{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
70Apache SpamAssassin provides you with a way to reduce if not
71completely eliminate Unsolicited Commercial Email (SPAM) from your
72incoming email. It can be invoked by a MDA such as sendmail or
73postfix, or can be called from a procmail script, .forward file, etc.
74It uses a genetic-algorithm evolved scoring system to identify
75messages which look spammy, then adds headers to the message so they
76can be filtered by the user's mail reading software. This distribution
77includes the spamd/spamc components which create a server that
78considerably speeds processing of mail.
79
80To enable spamassassin, if you are receiving mail locally, simply add
81this line to your ~/.procmailrc:
82INCLUDERC=/etc/mail/spamassassin/spamassassin-default.rc
83
84To filter spam for all users, add that line to /etc/procmailrc
85(creating if necessary).
86
87%description -l pl.UTF-8
88Apache SpamAssassin daje możliwość zredukowania, jeśli nie kompletnego
89wyeliminowania niezamawianej komercyjnej poczty (Unsolicited
90Commercial Email, spamu) z poczty. Może być wywoływany z MDA, np.
91Sendmaila czy Postfiksa, lub z pliku ~/.forward itp. Używa ogólnego
92algorytmu oceniania w celu identyfikacji wiadomości, które wyglądają
93na SPAM, po czym dodaje nagłówki do wiadomości, umożliwiając
94filtrowanie przez oprogramowanie użytkownika. Ta dystrybucja zawiera
95programy spamd/spamc, umożliwiające uruchomienie serwera, co znacznie
96przyspieszy proces przetwarzania poczty.
97
98Aby uruchomić spamassassina dla lokalnie przychodzącej poczty,
99wystarczy dodać do własnego ~/.procmailrc linię:
100INCLUDERC=/etc/mail/spamassassin/spamassassin-default.rc
101
102Aby filtrować spam dla wszystkich użytkowników, należy dodać tę linię
103do pliku /etc/procmailrc (tworząc go w razie potrzeby).
104
105%package spamd
106Summary: spamd - daemonized version of spamassassin
107Summary(pl.UTF-8): spamd - spamassassin w postaci demona
108Group: Applications/Mail
109Requires(post,preun): /sbin/chkconfig
110Requires: perl-Mail-SpamAssassin = %{version}-%{release}
111Requires: rc-scripts
112Suggests: perl-Apache-Test
113Suggests: perl-IO-Socket-SSL
114Suggests: perl-Net-Ident
115
116%description spamd
117The purpose of this program is to provide a daemonized version of the
118spamassassin executable. The goal is improving throughput performance
119for automated mail checking.
120
121This is intended to be used alongside "spamc", a fast, low-overhead C
122client program.
123
124%description spamd -l pl.UTF-8
125Spamd jest "demoniczną" wersją spamassassina. Jego zadaniem jest
126poprawa wydajności automatycznego sprawdzania poczty.
127
128Spamd powinien być używany wespół ze "spamc", który jest szybkim i
129wydajnym programem klienckim.
130
131%package spamc
132Summary: spamc - client for spamd
133Summary(pl.UTF-8): spamc - klient dla spamd
134Group: Applications/Mail
135Suggests: perl-Compress-Zlib
136
137%description spamc
138Spamc is the client half of the spamc/spamd pair. It should be used in
139place of "spamassassin" in scripts to process mail. It will read the
140mail from STDIN, and spool it to its connection to spamd, then read
141the result back and print it to STDOUT. Spamc has extremely low
142overhead in loading, so it should be much faster to load than the
143whole spamassassin program.
144
145To enable spamassassin, if you are receiving mail locally, simply add
146this line to your ~/.procmailrc:
147INCLUDERC=/etc/mail/spamassassin/spamassassin-spamc.rc
148
149To filter spam for all users, add that line to /etc/procmailrc
150(creating if necessary).
151
152%description spamc -l pl.UTF-8
153Spamc powinien być używany zamiast "spamassassina" w skryptach
154przetwarzających pocztę. Zczytuje pocztę ze STDIN, kolejkuje ją a
155następnie przekazuje spamdowi, odczytuje wynik i podaje go na STDOUT.
156Spamc stara się nie obciążać zbytnio procesora podczas ładowania,
157dzięki czemu powinien działać szybciej niż sam spamassassin.
158
159Aby uruchomić spamassassina dla lokalnie przychodzącej poczty,
160wystarczy dodać do własnego ~/.procmailrc linię:
161INCLUDERC=/etc/mail/spamassassin/spamassassin-spamc.rc
162
163Aby filtrować spam dla wszystkich użytkowników, należy dodać tę linię
164do pliku /etc/procmailrc (tworząc go w razie potrzeby).
165
166%package compile
167Summary: sa-compile - compile SpamAssassin ruleset into native code
168Summary(pl.UTF-8): sa-compile - kompilowanie reguł SpamAssasina do kodu natywnego
169Group: Applications/Mail
170Requires: gcc
171Requires: glibc-devel
172Requires: make
173Requires: perl(ExtUtils::MakeMaker)
174Requires: perl-Mail-SpamAssassin = %{version}-%{release}
175Requires: perl-devel
176Requires: re2c >= 0.10
177
178%description compile
179sa-compile uses "re2c" to compile the SpamAssassin ruleset. This is
180then used by the "Mail::SpamAssassin::Plugin::Rule2XSBody" plugin to
181speed up SpamAssassin's operation, where possible, and when that
182plugin is loaded.
183
184%description compile -l pl.UTF-8
185sa-compile wykorzystuje re2c do kompilacji reguł SpamAssassina. Służy
186to do przyspieszenia operacji SpamAssassina w miarę możliwości, kiedy
187ta wtyczka jest wczytana.
188
189%package update
190Summary: sa-update - automate SpamAssassin rule updates
191Summary(pl.UTF-8): sa-update - automatyczne uaktualnianie regułek SpamAssassina
192Group: Applications/Mail
193Requires: gnupg
194Requires: perl-Archive-Tar
195Requires: perl-Mail-SpamAssassin = %{version}-%{release}
196Requires: perl-libwww
197
198%description update
199sa-update automates the process of downloading and installing new
200rules and configuration, based on channels. The default channel is
201updates.spamassassin.org, which has updated rules since the previous
202release.
203
204Update archives are verified by default using SHA1 hashes and GPG
205signatures.
206
207%description update -l pl.UTF-8
208sa-update automatyzuje proces ściągania i instalowania nowych regułek
209i konfiguracji w oparciu o kanały. Domyślny kanał to
210updates.spamassassin.org, który ma uaktualnione regułki od czasu
211poprzedniego wydania.
212
213Archiwa uaktualnień są sprawdzane domyślnie przy użyciu skrótów SHA1 i
214podpisów GPG.
215
216%package -n perl-Mail-SpamAssassin
217Summary: Mail::SpamAssassin - SpamAssassin e-mail filter libraries
218Summary(pl.UTF-8): Mail::SpamAssassin - biblioteki filtra poczty SpamAssassin
219Group: Development/Languages/Perl
220Requires: perl-HTML-Parser >= 3
221# what for this one?
222#Requires: perl-Sys-Hostname-Long
223Suggests: Razor
224Suggests: perl-Cache-DB_File >= 0.2
225Suggests: perl-DBD-mysql
226Suggests: perl-Encode-Detect
227Suggests: perl-IO-Socket-INET6 >= 2.51
228Suggests: perl-IP-Country
229Suggests: perl-Mail-DKIM
230#Suggests: perl-Mail-DomainKeys
231#Suggests: perl-Mail-SPF
232Suggests: perl-Mail-SPF-Query
233Suggests: perl-Net-DNS >= 0.34
234Suggests: spamassassin-compile
235Suggests: spamassassin-plugin-fuzzyocr
236Suggests: spamassassin-update
237
238%description -n perl-Mail-SpamAssassin
239Mail::SpamAssassin is a Mail::Audit plugin to identify spam using text
240analysis and several internet-based realtime blacklists. Using its
241rule base, it uses a wide range of heuristic tests on mail headers and
242body text to identify ``spam'', also known as unsolicited commercial
243email. Once identified, the mail can then be optionally tagged as spam
244for later filtering using the user's own mail user-agent application.
245
246%description -n perl-Mail-SpamAssassin -l pl.UTF-8
247Mail::SpamAssassin jest pluginem dla Mail::Audit, służącym do
248identyfikacji spamu przy użyciu analizy zawartości i/lub internetowych
249czarnych list. Do zidentyfikowania jako ,,spam'' stosuje szeroki
250zakres testów heurystycznych na nagłówkach i treści, posiłkując się
251stworzoną wcześniej bazą reguł. Po zidentyfikowaniu, poczta może być
252oznaczona jako spam w celu późniejszego wyfiltrowania, np. przy użyciu
253aplikacji do czytania poczty.
254
255%prep
256%setup -q -n %{pdir}-%{pnam}-%{version}
257%patch0 -p1
258
259%build
260# for spamc/configure
261export 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
277%{?with_tests:%{__make} test}
278
279%install
280rm -rf $RPM_BUILD_ROOT
281install -d $RPM_BUILD_ROOT{/etc/{cron.d,sysconfig,rc.d/init.d},%{_sysconfdir}/mail/spamassassin}
282
283%{__make} install \
284 DESTDIR=$RPM_BUILD_ROOT
285
286install %{SOURCE1} $RPM_BUILD_ROOT/etc/sysconfig/spamd
287install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/spamd
288install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin
289install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin
290install %{SOURCE5} $RPM_BUILD_ROOT%{_datadir}/spamassassin/sa-update.cron
291install %{SOURCE6} $RPM_BUILD_ROOT/etc/cron.d/sa-update
292
293# sa-update, sa-compile
294install -d $RPM_BUILD_ROOT/var/lib/spamassassin/{%{sa_version},compiled/%{sa_version}}
295install -d $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin/sa-update-keys
296touch $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin/sa-update-keys/{pubring,secring,trustdb}.gpg
297
298rm -f $RPM_BUILD_ROOT{%{perl_archlib}/perllocal.pod,%{perl_vendorarch}/auto/Mail/SpamAssassin/.packlist,%{_mandir}/man3/spamassassin-run.*}
299
300cat > $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin/channels << 'EOF'
301updates.spamassassin.org
302# http://saupdates.openprotect.com/
303# saupdates.openprotect.com
304EOF
305
306%clean
307rm -rf $RPM_BUILD_ROOT
308
309%post spamd
310/sbin/chkconfig --add spamd
311%service spamd restart
312
313%preun spamd
314if [ "$1" = "0" ]; then
315 %service spamd stop
316 /sbin/chkconfig --del spamd
317fi
318
319%triggerpostun spamd -- spamassassin-spamd < 3.1.0-5.3
320# temp hack, should we care of the dead link?
321ln -s spamd /etc/rc.d/init.d/spamassassin
322/sbin/chkconfig --del spamassassin
323rm -f /etc/rc.d/init.d/spamassassin
324if [ -f /etc/sysconfig/spamassassin.rpmsave ]; then
325 mv -f /etc/sysconfig/spamassassin.rpmsave /etc/sysconfig/spamd
326fi
327
328%files
329%defattr(644,root,root,755)
330%doc CREDITS Changes INSTALL README TRADEMARK UPGRADE USAGE
331%doc procmailrc.example sql/ ldap/
332%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/spamassassin/spamassassin-default.rc
333%attr(755,root,root) %{_bindir}/sa-learn
334%attr(755,root,root) %{_bindir}/sa-awl
335%attr(755,root,root) %{_bindir}/spamassassin
336%attr(755,root,root) %{_bindir}/sa-check_spamd
337
338# It's needed for help of spamassassin command.
339%{perl_vendorlib}/spamassassin-run.pod
340%{_mandir}/man1/sa-learn.1*
341%{_mandir}/man1/spamassassin.1*
342%{_mandir}/man1/spamassassin-run.1*
343%{_mandir}/man1/sa-awl.1*
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.1*
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.1*
358
359%files compile
360%defattr(644,root,root,755)
361%attr(755,root,root) %{_bindir}/sa-compile
362%{_mandir}/man1/sa-compile.1*
363%dir /var/lib/spamassassin/compiled
364%dir /var/lib/spamassassin/compiled/%{sa_version}
365
366%files update
367%defattr(644,root,root,755)
368%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/spamassassin/channels
369%attr(700,root,root) %dir %{_sysconfdir}/mail/spamassassin/sa-update-keys
370%attr(700,root,root) %ghost %{_sysconfdir}/mail/spamassassin/sa-update-keys/*
371%config(noreplace) %verify(not md5 mtime size) /etc/cron.d/sa-update
372%attr(755,root,root) %{_bindir}/sa-update
373%attr(755,root,root) %{_datadir}/spamassassin/sa-update.cron
374%{_datadir}/spamassassin/sa-update-pubkey.txt
375%dir /var/lib/spamassassin/%{sa_version}
376%{_mandir}/man1/sa-update.1*
377
378%files -n perl-Mail-SpamAssassin
379%defattr(644,root,root,755)
380%doc sample-nonspam.txt sample-spam.txt
381%dir %{_sysconfdir}/mail/spamassassin
382%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/spamassassin/*.pre
383%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/spamassassin/*.cf
384%exclude %{_sysconfdir}/mail/spamassassin/sa-update-keys
385%dir %{_datadir}/spamassassin
386%config(noreplace) %{_datadir}/spamassassin/languages
387%config(noreplace) %{_datadir}/spamassassin/user_prefs.template
388%exclude %{_datadir}/spamassassin/sa-update-pubkey.txt
389
390%dir /var/lib/spamassassin
391
392%{perl_vendorlib}/Mail/*
393%{_mandir}/man3/*.3*
This page took 0.039485 seconds and 4 git commands to generate.