]> git.pld-linux.org Git - packages/spamassassin.git/blame - spamassassin.spec
- release 7
[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
594ff707 14Version: 3.2.5
b5ed5c9c 15Release: 7
7af7d259 16License: Apache v2.0
fa76a43e 17Group: Applications/Mail
b7088b72 18Source0: http://www.apache.net.pl/spamassassin/source/%{pdir}-%{pnam}-%{version}.tar.bz2
594ff707 19# Source0-md5: 695f9107b240383e48df8938f2de334e
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
23b7edab 26Patch0: %{name}-bug-6269.patch
8f650133 27Patch1: %{name}-bug-6131.patch
de5df8a6 28URL: http://spamassassin.apache.org/
90b02eb3 29BuildRequires: dos2unix
f2678ed9 30BuildRequires: openssl-devel >= 0.9.7d
3f0816bd 31BuildRequires: perl(ExtUtils::MakeMaker) >= 6.16
7f9e5d09 32BuildRequires: perl-Archive-Tar
3f0816bd 33BuildRequires: perl-DBI
7f9e5d09 34BuildRequires: perl-DB_File
3f0816bd
ER
35BuildRequires: perl-Digest-SHA1 >= 2.10
36BuildRequires: perl-HTML-Parser >= 3
4275eac7 37BuildRequires: perl-IO-Socket-INET6 >= 2.51
7f9e5d09
AM
38BuildRequires: perl-IO-Socket-SSL
39BuildRequires: perl-IO-Zlib
3f0816bd
ER
40BuildRequires: perl-IP-Country
41BuildRequires: perl-Mail-SPF-Query
603b34d2 42BuildRequires: perl-Net-DNS >= 0.65-3
3f0816bd 43BuildRequires: perl-Net-Ident
7f9e5d09 44#BuildRequires: perl-Razor2
3f0816bd 45BuildRequires: perl-devel >= 1:5.8.0
7f9e5d09 46BuildRequires: perl-libwww
eb732412 47BuildRequires: re2c
436d6ad1
ER
48BuildRequires: rpm-perlprov >= 4.1-13
49BuildRequires: rpmbuild(macros) >= 1.453
adedddbe 50%if %{with tests}
e456b7b8 51# are these really needed?
436d6ad1 52BuildRequires: perl-Compress-Zlib
b8732e1a 53BuildRequires: perl-Encode-Detect
e456b7b8 54BuildRequires: perl-MIME-Base64
55BuildRequires: perl-MIME-tools
b8732e1a
AG
56BuildRequires: perl-Mail-DKIM
57BuildRequires: perl-Mail-DomainKeys
58BuildRequires: perl-Mail-SPF
3f0816bd 59BuildRequires: perl-MailTools
b8732e1a 60BuildRequires: perl-Razor > 2.61
e456b7b8 61%endif
c7aac5f9 62Requires: perl-Mail-SpamAssassin = %{version}-%{release}
fa76a43e 63Obsoletes: SpamAssassin
3013bda7 64Obsoletes: spamassassin-tools
2c6e800d 65BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
b5d22b53 66
3ea21dc6 67%define _noautoreq 'perl(Razor2::Client::Agent)' 'perl(Razor::Agent)' 'perl(Razor::Client)' 'perl(DBI)' 'perl(Net::Ident)'
b5d22b53 68
69%description
436d6ad1
ER
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.
b5d22b53 79
f2fac83b
ER
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
b860031c 87%description -l pl.UTF-8
029cfa99 88Apache SpamAssassin daje możliwość zredukowania, jeśli nie kompletnego
a23eb9ca 89wyeliminowania niezamawianej komercyjnej poczty (Unsolicited
b860031c
JR
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
a23eb9ca 96przyspieszy proces przetwarzania poczty.
b5d22b53 97
39455225
JB
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
803ff704 105%package spamd
106Summary: spamd - daemonized version of spamassassin
7ad542fe 107Summary(pl.UTF-8): spamd - spamassassin w postaci demona
803ff704 108Group: Applications/Mail
7e93445b 109Requires(post,preun): /sbin/chkconfig
c7aac5f9 110Requires: perl-Mail-SpamAssassin = %{version}-%{release}
3f0816bd 111Requires: rc-scripts
59ae54a3 112Suggests: perl-Apache-Test
d27489ef 113Suggests: perl-IO-Socket-SSL
59ae54a3 114Suggests: perl-Net-Ident
803ff704 115
116%description spamd
117The purpose of this program is to provide a daemonized version of the
fa76a43e 118spamassassin executable. The goal is improving throughput performance
803ff704 119for automated mail checking.
120
121This is intended to be used alongside "spamc", a fast, low-overhead C
122client program.
123
b860031c
JR
124%description spamd -l pl.UTF-8
125Spamd jest "demoniczną" wersją spamassassina. Jego zadaniem jest
126poprawa wydajności automatycznego sprawdzania poczty.
e2c4c33b 127
b860031c 128Spamd powinien być używany wespół ze "spamc", który jest szybkim i
e2c4c33b 129wydajnym programem klienckim.
803ff704 130
131%package spamc
132Summary: spamc - client for spamd
7ad542fe 133Summary(pl.UTF-8): spamc - klient dla spamd
803ff704 134Group: Applications/Mail
59ae54a3 135Suggests: perl-Compress-Zlib
803ff704 136
137%description spamc
fa76a43e 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.
803ff704 144
f2fac83b
ER
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
b860031c
JR
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.
803ff704 158
39455225
JB
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
f2fac83b
ER
166%package compile
167Summary: sa-compile - compile SpamAssassin ruleset into native code
39455225 168Summary(pl.UTF-8): sa-compile - kompilowanie reguł SpamAssasina do kodu natywnego
f2fac83b
ER
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
39455225
JB
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
6d64d68b
ER
189%package update
190Summary: sa-update - automate SpamAssassin rule updates
7ad542fe 191Summary(pl.UTF-8): sa-update - automatyczne uaktualnianie regułek SpamAssassina
6d64d68b
ER
192Group: Applications/Mail
193Requires: gnupg
194Requires: perl-Archive-Tar
195Requires: perl-Mail-SpamAssassin = %{version}-%{release}
b8732e1a 196Requires: perl-libwww
6d64d68b
ER
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
b860031c
JR
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
a150579c
JB
211poprzedniego wydania.
212
b860031c
JR
213Archiwa uaktualnień są sprawdzane domyślnie przy użyciu skrótów SHA1 i
214podpisów GPG.
a150579c 215
20981d36 216%package -n perl-Mail-SpamAssassin
82445dd1 217Summary: Mail::SpamAssassin - SpamAssassin e-mail filter libraries
7ad542fe 218Summary(pl.UTF-8): Mail::SpamAssassin - biblioteki filtra poczty SpamAssassin
20981d36 219Group: Development/Languages/Perl
3f0816bd 220Requires: perl-HTML-Parser >= 3
59ae54a3
TP
221# what for this one?
222#Requires: perl-Sys-Hostname-Long
436d6ad1 223Suggests: Razor
59ae54a3
TP
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
59ae54a3
TP
234Suggests: spamassassin-compile
235Suggests: spamassassin-plugin-fuzzyocr
236Suggests: spamassassin-update
20981d36 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
b860031c
JR
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
20981d36 249czarnych list. Do zidentyfikowania jako ,,spam'' stosuje szeroki
b860031c
JR
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
20981d36 253aplikacji do czytania poczty.
254
28e6d943 255%prep
b5d22b53 256%setup -q -n %{pdir}-%{pnam}-%{version}
90b02eb3 257dos2unix rules/72_active.cf
23b7edab 258%patch0 -p1
8f650133 259%patch1 -p1
b5d22b53 260
261%build
d7ceafc2
JB
262# for spamc/configure
263export CFLAGS="%{rpmcflags}"
1edf89a9 264%{__perl} Makefile.PL \
265 INSTALLDIRS=vendor \
6f48e7fd 266 PREFIX=%{_prefix} \
267 SYSCONFDIR=%{_sysconfdir} \
e07d551d 268 DATADIR=%{_datadir}/spamassassin \
6f48e7fd 269 ENABLE_SSL=yes \
d99675dc
ER
270 CONTACT_ADDRESS="postmaster@localhost" \
271 PERL_BIN=%{__perl} < /dev/null
eb997c3b 272%{__make} \
de5df8a6 273 CC="%{__cc}" \
eb997c3b 274 OPTIMIZE="%{rpmcflags}"
e456b7b8 275
f2fac83b
ER
276%{__sed} -e "s,@@LOCAL_STATE_DIR@@,$(pwd)," sa-compile.raw > sa-compile.pl
277%{__perl} -T sa-compile.pl --siteconfigpath=rules
278rm -f compiled/%{sa_version}/auto/Mail/SpamAssassin/CompiledRegexps/body_0/.packlist
279
2ed6bec4 280%{?with_tests:%{__make} test}
b5d22b53 281
282%install
283rm -rf $RPM_BUILD_ROOT
3013bda7 284install -d $RPM_BUILD_ROOT{/etc/{cron.d,sysconfig,rc.d/init.d},%{_sysconfdir}/mail/spamassassin}
725104c9 285
286%{__make} install \
6f48e7fd 287 DESTDIR=$RPM_BUILD_ROOT
2b2f332d 288
6124422b
ER
289install %{SOURCE1} $RPM_BUILD_ROOT/etc/sysconfig/spamd
290install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/spamd
f2fac83b
ER
291install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin
292install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin
3013bda7
ER
293install %{SOURCE5} $RPM_BUILD_ROOT%{_datadir}/spamassassin/sa-update.cron
294install %{SOURCE6} $RPM_BUILD_ROOT/etc/cron.d/sa-update
b5d22b53 295
f2fac83b
ER
296# sa-update, sa-compile
297install -d $RPM_BUILD_ROOT/var/lib/spamassassin/{%{sa_version},compiled/%{sa_version}}
f565cfbf
ER
298install -d $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin/sa-update-keys
299touch $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin/sa-update-keys/{pubring,secring,trustdb}.gpg
594ff707 300cp -a compiled/*/%{sa_version} $RPM_BUILD_ROOT/var/lib/spamassassin/compiled
7b5b84a2 301
5f72744e 302rm -f $RPM_BUILD_ROOT{%{perl_archlib}/perllocal.pod,%{perl_vendorarch}/auto/Mail/SpamAssassin/.packlist,%{_mandir}/man3/spamassassin-run.*}
b5d22b53 303
16220090
AM
304cat > $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin/channels << 'EOF'
305updates.spamassassin.org
306# http://saupdates.openprotect.com/
307# saupdates.openprotect.com
308EOF
309
7e93445b
JB
310%clean
311rm -rf $RPM_BUILD_ROOT
312
803ff704 313%post spamd
6124422b
ER
314/sbin/chkconfig --add spamd
315%service spamd restart
6f054f0d 316
803ff704 317%preun spamd
fa76a43e 318if [ "$1" = "0" ]; then
6124422b
ER
319 %service spamd stop
320 /sbin/chkconfig --del spamd
321fi
322
323%triggerpostun spamd -- spamassassin-spamd < 3.1.0-5.3
324# temp hack, should we care of the dead link?
325ln -s spamd /etc/rc.d/init.d/spamassassin
326/sbin/chkconfig --del spamassassin
327rm -f /etc/rc.d/init.d/spamassassin
328if [ -f /etc/sysconfig/spamassassin.rpmsave ]; then
329 mv -f /etc/sysconfig/spamassassin.rpmsave /etc/sysconfig/spamd
6f054f0d 330fi
331
b5d22b53 332%files
333%defattr(644,root,root,755)
17648f67 334%doc CREDITS Changes INSTALL README TRADEMARK UPGRADE USAGE
3013bda7 335%doc procmailrc.example sql/ ldap/
f2fac83b 336%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/spamassassin/spamassassin-default.rc
bfb0661a 337%attr(755,root,root) %{_bindir}/sa-learn
803ff704 338%attr(755,root,root) %{_bindir}/spamassassin
f2fac83b 339
06cb7bf9
PG
340# It's needed for help of spamassassin command.
341%{perl_vendorlib}/spamassassin-run.pod
bfb0661a 342%{_mandir}/man1/sa-learn*
803ff704 343%{_mandir}/man1/spamassassin*
b5d22b53 344
803ff704 345%files spamd
346%defattr(644,root,root,755)
c0010691 347%doc spamd/README*
6124422b
ER
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
803ff704 350%attr(755,root,root) %{_bindir}/spamd
351%{_mandir}/man1/spamd*
352
353%files spamc
354%defattr(644,root,root,755)
f2fac83b 355%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/spamassassin/spamassassin-spamc.rc
803ff704 356%attr(755,root,root) %{_bindir}/spamc
357%{_mandir}/man1/spamc*
358
f2fac83b
ER
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
c0c33805 369%dir /var/lib/spamassassin/compiled/%{sa_version}/auto/Mail/SpamAssassin
f2fac83b
ER
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
6d64d68b
ER
380%files update
381%defattr(644,root,root,755)
16220090 382%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/spamassassin/channels
f565cfbf
ER
383%attr(700,root,root) %dir %{_sysconfdir}/mail/spamassassin/sa-update-keys
384%attr(700,root,root) %ghost %{_sysconfdir}/mail/spamassassin/sa-update-keys/*
3013bda7 385%config(noreplace) %verify(not md5 mtime size) /etc/cron.d/sa-update
6d64d68b 386%attr(755,root,root) %{_bindir}/sa-update
16e10112 387%attr(755,root,root) %{_datadir}/spamassassin/sa-update.cron
f565cfbf 388%{_datadir}/spamassassin/sa-update-pubkey.txt
f2fac83b 389%dir /var/lib/spamassassin/%{sa_version}
f565cfbf 390%{_mandir}/man1/sa-update*
6d64d68b 391
20981d36 392%files -n perl-Mail-SpamAssassin
393%defattr(644,root,root,755)
803ff704 394%doc sample-nonspam.txt sample-spam.txt
0f5debbd 395%dir %{_sysconfdir}/mail/spamassassin
980ad428
ER
396%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/spamassassin/*.pre
397%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/spamassassin/*.cf
f565cfbf 398%exclude %{_sysconfdir}/mail/spamassassin/sa-update-keys
980ad428 399
0f5debbd
JR
400%dir %{_datadir}/spamassassin
401%config(noreplace) %{_datadir}/spamassassin/*
f565cfbf 402%exclude %{_datadir}/spamassassin/sa-update-pubkey.txt
980ad428 403
f2fac83b
ER
404%dir /var/lib/spamassassin
405
1edf89a9 406%{perl_vendorlib}/Mail/*
20981d36 407%{_mandir}/man3/*
This page took 0.096654 seconds and 4 git commands to generate.