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