]> git.pld-linux.org Git - packages/dspam.git/blob - dspam.spec
- added TODO line: it does not build with new autotools
[packages/dspam.git] / dspam.spec
1 # TODO:
2 # - it does not build with new autotools. Workaround: use configure provided
3 #   by dspam sources
4 # - support for libdclassify
5 # - oracle driver
6 # - messages from default install of cron with mysql driver Memory fault
7 # - installing dspam and dspam-client on same host causes
8 #   /etc/dspam.conf being owned by both packages and .rpmnew files being
9 #   created. move the config to -libs? -common? patch code to use
10 #   different config for client?
11 #
12 # Conditional build:
13 %bcond_without  mysql   # disable MySQL storage driver
14 %bcond_without  pgsql   # disable PostgreSQL storage driver
15 %bcond_without  sqlite  # disable SQLite3 storage driver
16 %bcond_with     mysql40 # use with mysql 4.0
17 #
18 %include        /usr/lib/rpm/macros.perl
19 Summary:        A library and Mail Delivery Agent for Bayesian spam filtering
20 Summary(pl.UTF-8):      Biblioteka i MDA do bayesowskiego filtrowania spamu
21 Name:           dspam
22 Version:        3.8.0
23 Release:        0.1
24 License:        GPL
25 Group:          Applications/Mail
26 Source0:        http://dspam.nuclearelephant.com/sources/%{name}-%{version}.tar.gz
27 # Source0-md5:  056b8c8b3ad9415a52c01b22ff1e64cf
28 Patch0:         %{name}-webui.patch
29 Patch1:         %{name}-config.patch
30 Patch2:         %{name}-speedup.patch
31 Source1:        %{name}.init
32 Source2:        %{name}-apache.conf
33 URL:            http://dspam.nuclearelephant.com/
34 BuildRequires:  autoconf
35 BuildRequires:  automake
36 BuildRequires:  clamav-devel
37 BuildRequires:  libtool
38 %{?with_mysql:BuildRequires:    mysql-devel}
39 BuildRequires:  openldap-devel >= 2.4.6
40 %{?with_pgsql:BuildRequires:    postgresql-devel}
41 BuildRequires:  rpm-perlprov >= 4.1-13
42 BuildRequires:  rpmbuild(macros) >= 1.268
43 BuildRequires:  sed >= 4.0
44 %{?with_sqlite:BuildRequires:   sqlite3-devel}
45 BuildRequires:  zlib-devel
46 Requires(post,preun):   /sbin/chkconfig
47 Requires:       %{name}-driver = %{version}-%{release}
48 Requires:       rc-scripts
49 Buildroot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
50
51 %define         _webapps        /etc/webapps
52 %define         _webapp         %{name}
53
54 %description
55 DSPAM (as in De-Spam) is an open-source project to create a new kind
56 of anti-spam mechanism, and is currently effective as both a
57 server-side agent for UNIX email servers and a developer's library for
58 mail clients, other anti-spam tools, and similar projects requiring
59 drop-in spam filtering.
60
61 The DSPAM agent masquerades as the email server's local delivery agent
62 and filters/learns spams using an advanced Bayesian statistical
63 approach (based on Bayes's theorem of combined probabilities) which
64 provides an administratively maintenance-free, easy-learning Anti-Spam
65 service custom tailored to each individual user's behavior. Advanced
66 because on top of standard Bayesian filtering is also incorporated the
67 use of Chained Tokens, de-obfuscation, and other enhancements. DSPAM
68 works great with Sendmail and Exim, and should work well with any
69 other MTA that supports an external local delivery agent (postfix,
70 qmail, etc.)
71
72 %description -l pl.UTF-8
73 DSPAM (czyli De-Spam) to projekt o otwartych źródłach mający na celu
74 stworzenie nowego rodzaju mechanizmu antyspamowego. Aktualnie jest
75 efektywny zarówno jako działający po stronie serwera agent dla
76 uniksowych serwerów pocztowych jak i biblioteka dla programistów
77 klientów pocztowych, innych narzędzi antyspamowych i innych projektów
78 wymagających filtrowania spamu w locie.
79
80 Agent DSPAM zachowuje się jak lokalny agent dostarczania poczty (MDA)
81 i filtruje/uczy się spamu przy użyciu zaawansowanego bayesowskiego
82 przybliżenia statystycznego (opartego na twierdzeniu Bayesa o
83 połączonych prawdopodobieństwach), dając nie wymagającą obsługi
84 administracyjnej, łatwo uczącą się usługę antyspamową dostosowaną do
85 zachowania każdego użytkownika. Metoda jest zaawansowana ponieważ na
86 podstawie standardowego filtrowania bayesowskiego wprowadzono użycie
87 tokenów łańcuchowych, eliminowanie ukrywanie i inne rozszerzenia.
88 DSPAM działa wspaniale z Sendmailem i Eximem, powinien działać dobrze
89 z każdym innym MTA obsługującym zewnętrznego agenta MDA (postfiksem,
90 qmailem itd.).
91
92 %package client
93 Summary:        dspam client
94 Summary(pl.UTF-8):      Klient dspam
95 Group:          Applications/Mail
96 # to get the same dspam.conf when both installed
97 Conflicts:      dspam < %{version}-%{release}
98 Conflicts:      dspam > %{version}-%{release}
99
100 %description client
101 dspam client.
102
103 %description client -l pl.UTF-8
104 Klient dspam.
105
106 %package libs
107 Summary:        A library for Bayesian spam filtering
108 Summary(pl.UTF-8):      Biblioteka do bayesowskiego filtrowania spamu
109 Group:          Libraries
110 Obsoletes:      dspam-driver-db
111
112 %description libs
113 DSPAM (as in De-Spam) is an open-source project to create a new kind
114 of anti-spam mechanism, and is currently effective as both a
115 server-side agent for UNIX email servers and a developer's library for
116 mail clients, other anti-spam tools, and similar projects requiring
117 drop-in spam filtering.
118
119 This package contains the library.
120
121 %description libs -l pl.UTF-8
122 DSPAM (czyli De-Spam) to projekt o otwartych źródłach mający na celu
123 stworzenie nowego rodzaju mechanizmu antyspamowego. Aktualnie jest
124 efektywny zarówno jako działający po stronie serwera agent dla
125 uniksowych serwerów pocztowych jak i biblioteka dla programistów
126 klientów pocztowych, innych narzędzi antyspamowych i innych projektów
127 wymagających filtrowania spamu w locie.
128
129 Ten pakiet zawiera wspomnianą bibliotekę.
130
131 %package devel
132 Summary:        Header files for the DSPAM library
133 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki DSPAM
134 Group:          Development/Libraries
135 Requires:       %{name}-libs = %{version}-%{release}
136
137 %description devel
138 DSPAM has had its core engine moved into a separate library, libdspam.
139 This library can be used by developers to provide 'drop-in' spam
140 filtering for their mail client applications, other anti-spam tools,
141 or similar projects.
142
143 %description devel -l pl.UTF-8
144 Główny silnik DSPAM został przeniesiony do oddzielnej biblioteki
145 libdspam, która może być używana przez programistów do zapewnienia
146 filtrowania spamu w locie dla aplikacji klientów pocztowych, innych
147 narzędzi antyspamowych i podobnych projektów.
148
149 %package static
150 Summary:        Static DSPAM library
151 Summary(pl.UTF-8):      Statyczna biblioteka DSPAM
152 Group:          Development/Libraries
153 Requires:       %{name}-devel = %{version}-%{release}
154
155 %description static
156 Static DSPAM library.
157
158 %description static -l pl.UTF-8
159 Statyczna biblioteka DSPAM.
160
161 %package driver-hash
162 Summary:        HASH driver for DSPAM
163 Summary(pl.UTF-8):      Sterownik HASH dla DSPAM-a
164 Group:          Libraries
165 Requires(post): sed >= 4.0
166 Requires:       %{name} = %{version}-%{release}
167 Provides:       %{name}-driver = %{version}-%{release}
168
169 %description driver-hash
170 HASH driver for DSPAM.
171
172 %description driver-hash -l pl.UTF-8
173 Sterownik HASH dla DSPAM-a.
174
175 %package driver-mysql
176 Summary:        MySQL driver for DSPAM
177 Summary(pl.UTF-8):      Sterownik MySQL dla DSPAM-a
178 Group:          Libraries
179 Requires(post): sed >= 4.0
180 Requires:       %{name} = %{version}-%{release}
181 Provides:       %{name}-driver = %{version}-%{release}
182
183 %description driver-mysql
184 MySQL driver for DSPAM.
185
186 %description driver-mysql -l pl.UTF-8
187 Sterownik MySQL dla DSPAM-a.
188
189 %package driver-pgsql
190 Summary:        PostgreSQL driver for DSPAM
191 Summary(pl.UTF-8):      Sterownik PostgreSQL dla DSPAM-a
192 Group:          Libraries
193 Requires(post): sed >= 4.0
194 Requires:       %{name} = %{version}-%{release}
195 Provides:       %{name}-driver = %{version}-%{release}
196
197 %description driver-pgsql
198 PostgreSQL driver for DSPAM.
199
200 %description driver-pgsql -l pl.UTF-8
201 Sterownik PostgreSQL dla DSPAM-a.
202
203 %package driver-sqlite
204 Summary:        SQLite driver for DSPAM
205 Summary(pl.UTF-8):      Sterownik SQLite dla DSPAM-a
206 Group:          Libraries
207 Requires(post): sed >= 4.0
208 Requires:       %{name} = %{version}-%{release}
209 Provides:       %{name}-driver = %{version}-%{release}
210
211 %description driver-sqlite
212 SQLite driver for DSPAM.
213
214 %description driver-sqlite -l pl.UTF-8
215 Sterownik SQLite dla DSPAM-a.
216
217 %package webui
218 Summary:        DSPAM Web UI
219 Summary(pl.UTF-8):      Interfejs WWW do programu DSPAM
220 Group:          Applications/WWW
221 Requires:       webapps
222 # needs dspam binary
223 Requires:       %{name} = %{version}-%{release}
224
225 %description webui
226 The Web UI (CGI client) can be run from any executable location on a
227 web server, and detects its user's identity from the REMOTE_USER
228 environment variable. This means you'll need to use HTTP password
229 authentication to access the CGI (Any type of authentication will
230 work, so long as Apache supports the module). This is also convenient
231 in that you can set up authentication using almost any existing system
232 you have. The only catch is that you'll need the usernames to match
233 the actual DSPAM usernames used the system. A copy of the shadow
234 password file will suffice for most common installs.
235
236 %description webui -l pl.UTF-8
237 Interfejs użytkownika WWW (klient CGI) może być uruchamiany z
238 dowolnego wykonywalnego miejsca na serwerze WWW i rozpoznaje tożsamość
239 użytkownika ze zmiennej środowiskowej REMOTE_USER. Oznacza to, że
240 trzeba użyć uwietrzytelnienia HTTP z hasłem do dostępu do CGI (działać
241 będzie dowolny rodzaj uwierzytelnienia obsługiwany przez moduły
242 Apache'a). Jest to o tyle wygodne, że można skonfigurować
243 uwierzytelnianie dla prawie każdego istniejącego systemu. Jedynym
244 wymogiem jest, żeby nazwy użytkowników pokrywały się z nazwami
245 użytkowników DSPAM-a używanymi w systemie. Kopia pliku shadow
246 wystarczy dla większości popularnych instalacji.
247
248 %prep
249 %setup -q
250 %patch0 -p1
251 %patch1 -p1
252 %patch2 -p1
253 sed -i -e 's#\-static##g' src/Makefile* src/*/Makefile*
254 %{?with_mysql40:sed -i -e 's#40100#99999#g' src/mysql_drv.c}
255 sed -i -e 's,/usr/local/dspam/bin,/usr/bin,' ./scripts/train.pl
256
257 %build
258 %{__libtoolize}
259 %{__aclocal} -I m4
260 %{__autoconf}
261 %{__automake}
262
263 DRIVERS="
264 hash_drv
265 %{?with_mysql:mysql_drv}
266 %{?with_pgsql:pgsql_drv}
267 %{?with_sqlite:sqlite_drv}
268 "
269 %configure \
270         --disable-dependency-tracking \
271         %{?debug: --enable-debug --enable-bnr-debug --enable-verbose-debug} \
272         --enable-trusted-user-security \
273         --enable-bias \
274         --enable-large-scale \
275         --with-userdir=/var/lib/%{name} \
276         --with-userdir-owner=none \
277         --with-userdir-group=none \
278         --with-dspam-home=/var/lib/%{name} \
279         --with-dspam-home-owner=none \
280         --with-dspam-home-group=none \
281         --with-dspam-owner=none \
282         --with-dspam-group=none \
283         --with-signature-life=14 \
284         --enable-ldap \
285         --enable-clamav \
286         --enable-preferences-extension \
287         --enable-long-usernames \
288         --enable-neural-networking \
289         --enable-virtual-users \
290         --with-storage-driver=$(echo $DRIVERS | tr ' ' ',') \
291 %if %{with mysql}
292         --with-mysql-includes=%{_includedir}/mysql \
293         --with-mysql-libraries=%{_libdir} \
294 %endif
295 %if %{with pgsql}
296         --with-pgsql-includes=%{_includedir}/postgresql \
297         --with-pgsql-libraries=%{_libdir} \
298 %endif
299 %if %{with sqlite}
300         --with-sqlite3-includes=%{_includedir} \
301         --with-sqlite3-libraries=%{_libdir} \
302 %endif
303         --enable-daemon
304
305 # --enable-dclassify-extension needs libdclassify
306
307 %{__make}
308
309 %install
310 rm -rf $RPM_BUILD_ROOT
311 install -d $RPM_BUILD_ROOT{/var/run/dspam,/etc/{rc.d/init.d,sysconfig}} \
312         $RPM_BUILD_ROOT/var/lib/%{name}/{txt,data}
313
314 %{__make} install \
315         DESTDIR=$RPM_BUILD_ROOT
316
317 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/dspam
318
319 cp -a txt/*.txt $RPM_BUILD_ROOT/var/lib/%{name}/txt
320
321 # install devel files
322 install -d $RPM_BUILD_ROOT{%{_includedir}/%{name},/var/{log,lib}/%{name}}
323 install src/*.h $RPM_BUILD_ROOT%{_includedir}/%{name}
324
325 # provide maintenance scripts
326 install -d $RPM_BUILD_ROOT/etc/cron.{daily,weekly}
327 cat > $RPM_BUILD_ROOT/etc/cron.daily/%{name} <<EOF
328 #!/bin/sh
329 exec %{_bindir}/%{name}_clean -s -p
330 EOF
331
332 chmod 755 $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily/%{name}
333
334 # fix purge stuff
335 #install dspam-cron.weekly $RPM_BUILD_ROOT%{_sysconfdir}/cron.weekly/%{name}
336
337 %if %{with mysql}
338 cat > $RPM_BUILD_ROOT/var/lib/%{name}/mysql.data <<EOF
339 _UNCONFIGURED_
340
341 Note!
342
343 This file can only contain 5 lines with the following values:
344
345 HOSTNAME
346 PORT
347 USERNAME
348 PASSWORD
349 DATABASE
350 EOF
351 %endif
352
353 %if %{with pgsql}
354 cat > $RPM_BUILD_ROOT/var/lib/%{name}/pgsql.data <<EOF
355 _UNCONFIGURED_
356
357 Note!
358
359 This file can only contain 5 lines with the following values:
360
361 HOSTNAME
362 PORT
363 USERNAME
364 PASSWORD
365 DATABASE
366 EOF
367 %endif
368
369 install -d $RPM_BUILD_ROOT%{_webapps}/%{_webapp}
370 install %{SOURCE2} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf
371 install %{SOURCE2} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf
372 touch $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/htpasswd
373
374 %post
375 /sbin/chkconfig --add dspam
376 %service dspam restart "dspam daemon"
377
378 %preun
379 if [ "$1" = "0" ]; then
380         %service dspam stop
381         /sbin/chkconfig --del dspam
382 fi
383
384 %clean
385 rm -rf $RPM_BUILD_ROOT
386
387 %post   libs -p /sbin/ldconfig
388 %postun libs -p /sbin/ldconfig
389
390 %post driver-hash
391 %{__sed} -i -e '/^StorageDriver/s,/.*\.so,%{_libdir}/libhash_drv.so,' /etc/dspam.conf
392
393 %post driver-mysql
394 %{__sed} -i -e '/^StorageDriver/s,/.*\.so,%{_libdir}/libmysql_drv.so,' /etc/dspam.conf
395
396 %post driver-pgsql
397 %{__sed} -i -e '/^StorageDriver/s,/.*\.so,%{_libdir}/libpgsql_drv.so,' /etc/dspam.conf
398
399 %post driver-sqlite
400 %{__sed} -i -e '/^StorageDriver/s,/.*\.so,%{_libdir}/libsqlite_drv.so,' /etc/dspam.conf
401
402 %triggerin webui -- apache1 < 1.3.37-3, apache1-base
403 %webapp_register apache %{_webapp}
404
405 %triggerun webui -- apache1 < 1.3.37-3, apache1-base
406 %webapp_unregister apache %{_webapp}
407
408 %triggerin webui -- apache < 2.2.0, apache-base
409 %webapp_register httpd %{_webapp}
410
411 %triggerun webui -- apache < 2.2.0, apache-base
412 %webapp_unregister httpd %{_webapp}
413
414 %files
415 %defattr(644,root,root,755)
416 %doc README CHANGELOG RELEASE.NOTES UPGRADING
417 %doc doc/{courier,exim,markov,pop3filter,postfix,qmail,relay,sendmail}.txt
418 %doc scripts/train.pl
419 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dspam.conf
420 %dir %attr(775,root,mail) /var/run/dspam
421 %dir %attr(750,root,mail) /var/lib/%{name}
422 %dir %attr(770,root,mail) /var/lib/%{name}/data
423 %dir /var/lib/%{name}/txt
424 %config(noreplace) %verify(not md5 mtime size) /var/lib/%{name}/txt/*.txt
425 %dir %attr(770,root,mail) /var/log/dspam
426 %attr(754,root,root) /etc/rc.d/init.d/dspam
427 %attr(755,root,root) %config(noreplace) /etc/cron.daily/%{name}
428 %attr(755,root,root) %{_bindir}/%{name}
429 %attr(755,root,root) %{_bindir}/%{name}_logrotate
430 %attr(755,root,root) %{_bindir}/%{name}_clean
431 %attr(755,root,root) %{_bindir}/%{name}_crc
432 %attr(755,root,root) %{_bindir}/%{name}_dump
433 %attr(755,root,root) %{_bindir}/%{name}_stats
434 %attr(755,root,root) %{_bindir}/%{name}_merge
435 %attr(755,root,root) %{_bindir}/%{name}_2sql
436 %attr(755,root,root) %{_bindir}/%{name}_admin
437 %attr(755,root,root) %{_bindir}/%{name}_train
438 %{_mandir}/man?/%{name}*
439
440 %files client
441 %defattr(644,root,root,755)
442 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dspam.conf
443 %attr(755,root,root) %{_bindir}/%{name}c
444
445 %files libs
446 %defattr(644,root,root,755)
447 %doc README CHANGELOG
448 %attr(755,root,root) %{_libdir}/lib*.so.*.*.*
449 %attr(755,root,root) %exclude %{_libdir}/lib*_drv*.so*
450
451 %files devel
452 %defattr(644,root,root,755)
453 %attr(755,root,root) %{_libdir}/lib*.so
454 %attr(755,root,root) %exclude %{_libdir}/lib*_drv*.so*
455 %{_libdir}/lib*.la
456 %{_includedir}/%{name}
457 %{_mandir}/man3/libdspam*
458 %{_pkgconfigdir}/*.pc
459
460 %files static
461 %defattr(644,root,root,755)
462 %{_libdir}/lib*.a
463
464 %files driver-hash
465 %defattr(644,root,root,755)
466 %attr(755,root,root) %{_bindir}/css*
467 %attr(755,root,root) %{_libdir}/libhash_drv*.so*
468
469 %if %{with mysql}
470 %files driver-mysql
471 %defattr(644,root,root,755)
472 %doc doc/mysql_drv.txt src/tools.mysql_drv/*.sql
473 %attr(640,root,mail) %config(noreplace) /var/lib/%{name}/mysql.data
474 %attr(755,root,root) %{_libdir}/libmysql_drv*.so*
475 %endif
476
477 %if %{with pgsql}
478 %files driver-pgsql
479 %defattr(644,root,root,755)
480 %doc doc/pgsql_drv.txt src/tools.pgsql_drv/*.sql
481 %attr(640,root,mail) %config(noreplace) /var/lib/%{name}/pgsql.data
482 %attr(755,root,root) %{_bindir}/%{name}_pg2int8
483 %attr(755,root,root) %{_libdir}/libpgsql_drv*.so*
484 %endif
485
486 %if %{with sqlite}
487 %files driver-sqlite
488 %defattr(644,root,root,755)
489 %doc doc/sqlite_drv.txt
490 %attr(755,root,root) %{_libdir}/libsqlite_drv*.so*
491 %endif
492
493 %files webui
494 %defattr(644,root,root,755)
495 %dir %attr(750,root,http) %{_webapps}/%{_webapp}
496 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/apache.conf
497 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/httpd.conf
498 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/htpasswd
499 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/admins
500 %attr(660,root,http) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/default.prefs
501 %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/configure.pl
502
503 %dir %{_datadir}/dspam
504 %dir %{_datadir}/dspam/cgi
505 %attr(755,root,root) %{_datadir}/dspam/cgi/*.cgi
506 %{_datadir}/dspam/cgi/templates
507 %{_datadir}/dspam/htdocs
This page took 0.114204 seconds and 3 git commands to generate.