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