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