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