3 # - support for libdclassify
5 # - messages from default install of cron with mysql driver
9 %bcond_without mysql # disable MySQL storage driver
10 %bcond_without pgsql # disable PostgreSQL storage driver
11 %bcond_without sqlite # disable SQLite3 storage driver
12 %bcond_without db # disable BerkeleyDB storage driver
13 %bcond_without daemon # disable daemon mode
14 %bcond_with mysql40 # use with mysql 4.0
16 Summary: A library and Mail Delivery Agent for Bayesian spam filtering
17 Summary(pl): Biblioteka i MDA do bayesowskiego filtrowania spamu
22 Group: Applications/Mail
23 Source0: http://www.nuclearelephant.com/projects/dspam/sources/%{name}-%{version}.tar.gz
24 # Source0-md5: e9fdb00a23a99e05c9e4c22aa8aa3655
26 URL: http://www.nuclearelephant.com/projects/dspam/
27 BuildRequires: autoconf
28 BuildRequires: automake
29 BuildRequires: clamav-devel
30 %{?with_db:BuildRequires: db-devel}
31 BuildRequires: libtool
32 %{?with_mysql:BuildRequires: mysql-devel}
33 BuildRequires: openldap-devel
34 %{?with_pgsql:BuildRequires: postgresql-devel}
35 BuildRequires: rpmbuild(macros) >= 1.268
36 BuildRequires: sed >= 4.0
37 %{?with_sqlite:BuildRequires: sqlite3-devel}
38 BuildRequires: zlib-devel
39 Requires(post,preun): /sbin/chkconfig
41 Buildroot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
44 DSPAM (as in De-Spam) is an open-source project to create a new kind
45 of anti-spam mechanism, and is currently effective as both a
46 server-side agent for UNIX email servers and a developer's library for
47 mail clients, other anti-spam tools, and similar projects requiring
48 drop-in spam filtering.
50 The DSPAM agent masquerades as the email server's local delivery agent
51 and filters/learns spams using an advanced Bayesian statistical
52 approach (based on Bayes's theorem of combined probabilities) which
53 provides an administratively maintenance-free, easy-learning Anti-Spam
54 service custom tailored to each individual user's behavior. Advanced
55 because on top of standard Bayesian filtering is also incorporated the
56 use of Chained Tokens, de-obfuscation, and other enhancements. DSPAM
57 works great with Sendmail and Exim, and should work well with any
58 other MTA that supports an external local delivery agent (postfix,
62 DSPAM (czyli De-Spam) to projekt o otwartych ¼ród³ach maj±cy na celu
63 stworzenie nowego rodzaju mechanizmu antyspamowego. Aktualnie jest
64 efektywny zarówno jako dzia³aj±cy po stronie serwera agent dla
65 uniksowych serwerów pocztowych jak i biblioteka dla programistów
66 klientów pocztowych, innych narzêdzi antyspamowych i innych projektów
67 wymagaj±cych filtrowania spamu w locie.
69 Agent DSPAM zachowuje siê jak lokalny agent dostarczania poczty (MDA)
70 i filtruje/uczy siê spamu przy u¿yciu zaawansowanego bayesowskiego
71 przybli¿enia statystycznego (opartego na twierdzeniu Bayesa o
72 po³±czonych prawdopodobieñstwach), daj±c nie wymagaj±c± obs³ugi
73 administracyjnej, ³atwo ucz±c± siê us³ugê antyspamow± dostosowan± do
74 zachowania ka¿dego u¿ytkownika. Metoda jest zaawansowana poniewa¿ na
75 podstawie standardowego filtrowania bayesowskiego wprowadzono u¿ycie
76 tokenów ³añcuchowych, eliminowanie ukrywanie i inne rozszerzenia.
77 DSPAM dzia³a wspaniale z Sendmailem i Eximem, powinien dzia³aæ dobrze
78 z ka¿dym innym MTA obs³uguj±cym zewnêtrznego agenta MDA (postfiksem,
83 Summary(pl): Klient dspam
84 Group: Applications/Mail
85 # to get the same dspam.conf when both installed
86 Conflicts: dspam < %{version}-%{release}
87 Conflicts: dspam > %{version}-%{release}
92 %description client -l pl
96 Summary: A library for Bayesian spam filtering
97 Summary(pl): Biblioteka do bayesowskiego filtrowania spamu
99 Requires: %{name}-driver = %{version}-%{release}
102 DSPAM (as in De-Spam) is an open-source project to create a new kind
103 of anti-spam mechanism, and is currently effective as both a
104 server-side agent for UNIX email servers and a developer's library for
105 mail clients, other anti-spam tools, and similar projects requiring
106 drop-in spam filtering.
108 This package contains the library.
110 %description libs -l pl
111 DSPAM (czyli De-Spam) to projekt o otwartych ¼ród³ach maj±cy na celu
112 stworzenie nowego rodzaju mechanizmu antyspamowego. Aktualnie jest
113 efektywny zarówno jako dzia³aj±cy po stronie serwera agent dla
114 uniksowych serwerów pocztowych jak i biblioteka dla programistów
115 klientów pocztowych, innych narzêdzi antyspamowych i innych projektów
116 wymagaj±cych filtrowania spamu w locie.
118 Ten pakiet zawiera wspomnian± bibliotekê.
121 Summary: Header files for the DSPAM library
122 Summary(pl): Pliki nag³ówkowe biblioteki DSPAM
123 Group: Development/Libraries
124 Requires: %{name}-libs = %{version}-%{release}
127 DSPAM has had its core engine moved into a separate library, libdspam.
128 This library can be used by developers to provide 'drop-in' spam
129 filtering for their mail client applications, other anti-spam tools,
132 %description devel -l pl
133 G³ówny silnik DSPAM zosta³ przeniesiony do oddzielnej biblioteki
134 libdspam, która mo¿e byæ u¿ywana przez programistów do zapewnienia
135 filtrowania spamu w locie dla aplikacji klientów pocztowych, innych
136 narzêdzi antyspamowych i podobnych projektów.
139 Summary: Static DSPAM library
140 Summary(pl): Statyczna biblioteka DSPAM
141 Group: Development/Libraries
142 Requires: %{name}-devel = %{version}-%{release}
145 Static DSPAM library.
147 %description static -l pl
148 Statyczna biblioteka DSPAM.
151 Summary: HASH driver for DSPAM
152 Summary(pl): Sterownik HASH dla DSPAM-a
154 Requires(post): sed >= 4.0
155 Requires: %{name}-libs = %{version}-%{release}
156 Provides: %{name}-driver = %{version}-%{release}
158 %description driver-hash
159 HASH driver for DSPAM.
161 %description driver-hash -l pl
162 Sterownik HASH dla DSPAM-a.
165 Summary: DB driver for DSPAM
166 Summary(pl): Sterownik DB dla DSPAM-a
168 Requires(post): sed >= 4.0
169 Requires: %{name}-libs = %{version}-%{release}
170 Provides: %{name}-driver = %{version}-%{release}
172 %description driver-db
175 %description driver-db -l pl
176 Sterownik DB dla DSPAM-a.
178 %package driver-mysql
179 Summary: MySQL driver for DSPAM
180 Summary(pl): Sterownik MySQL dla DSPAM-a
182 Requires(post): sed >= 4.0
183 Requires: %{name}-libs = %{version}-%{release}
184 Provides: %{name}-driver = %{version}-%{release}
186 %description driver-mysql
187 MySQL driver for DSPAM.
189 %description driver-mysql -l pl
190 Sterownik MySQL dla DSPAM-a.
192 %package driver-pgsql
193 Summary: PostgreSQL driver for DSPAM
194 Summary(pl): Sterownik PostgreSQL dla DSPAM-a
196 Requires(post): sed >= 4.0
197 Requires: %{name}-libs = %{version}-%{release}
198 Provides: %{name}-driver = %{version}-%{release}
200 %description driver-pgsql
201 PostgreSQL driver for DSPAM.
203 %description driver-pgsql -l pl
204 Sterownik PostgreSQL dla DSPAM-a.
206 %package driver-sqlite
207 Summary: SQLite driver for DSPAM
208 Summary(pl): Sterownik SQLite dla DSPAM-a
210 Requires(post): sed >= 4.0
211 Requires: %{name}-libs = %{version}-%{release}
212 Provides: %{name}-driver = %{version}-%{release}
214 %description driver-sqlite
215 SQLite driver for DSPAM.
217 %description driver-sqlite -l pl
218 Sterownik SQLite dla DSPAM-a.
222 sed -i -e 's#\-static##g' src/Makefile* src/*/Makefile*
223 %{?with_mysql40:sed -i -e 's#40100#99999#g' src/mysql_drv.c}
233 %{?with_db:libdb4_drv}
234 %{?with_mysql:mysql_drv}
235 %{?with_pgsql:pgsql_drv}
236 %{?with_sqlite:sqlite_drv}
239 %{?debug: --enable-debug --enable-bnr-debug --enable-verbose-debug} \
240 --enable-trusted-user-security \
242 --enable-large-scale \
243 --with-userdir=/var/lib/%{name} \
244 --with-userdir-owner=none \
245 --with-userdir-group=none \
246 --with-dspam-home=/var/lib/%{name} \
247 --with-dspam-home-owner=none \
248 --with-dspam-home-group=none \
249 --with-dspam-owner=none \
250 --with-dspam-group=none \
251 --with-signature-life=14 \
252 --disable-dependency-tracking \
255 --enable-preferences-extension \
256 --enable-long-usernames \
257 --enable-neural-networking \
258 --enable-virtual-users \
259 --with-storage-driver=$(echo $DRIVERS | tr ' ' ',') \
261 --with-mysql-includes=%{_includedir}/mysql \
262 --with-mysql-libraries=%{_libdir} \
265 --with-pgsql-includes=%{_includedir}/postgresql \
266 --with-pgsql-libraries=%{_libdir} \
269 --with-sqlite3-includes=%{_includedir} \
270 --with-sqlite3-libraries=%{_libdir} \
274 # --enable-dclassify-extension needs libdclassify
279 rm -rf $RPM_BUILD_ROOT
282 DESTDIR=$RPM_BUILD_ROOT
284 install -d $RPM_BUILD_ROOT/{var/run/dspam,/etc/{rc.d/init.d,sysconfig}}
285 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/dspam
288 ln -s /var/log/dspam $RPM_BUILD_ROOT/var/lib/%{name}/log
290 # install devel files
291 install -d $RPM_BUILD_ROOT{%{_includedir}/%{name},/var/{log,lib}/%{name}}
292 install src/*.h $RPM_BUILD_ROOT%{_includedir}/%{name}
294 # provide maintenance scripts
295 install -d $RPM_BUILD_ROOT/etc/cron.daily
296 install -d $RPM_BUILD_ROOT/etc/cron.weekly
298 cat > $RPM_BUILD_ROOT/etc/cron.daily/%{name} <<EOF
300 exec %{_bindir}/%{name}_clean -s -p
303 chmod 755 $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily/%{name}
306 sed -i -e "s|%{_prefix}/local|%{_prefix}|g" $RPM_BUILD_ROOT%{_bindir}/%{name}_corpus
307 sed -i -e "s|%{_prefix}/local|%{_prefix}|g" webui/cgi-bin/dspam.cgi
310 #install dspam-cron.weekly $RPM_BUILD_ROOT%{_sysconfdir}/cron.weekly/%{name}
314 install -d $RPM_BUILD_ROOT/var/lib/%{name}
315 cat > $RPM_BUILD_ROOT/var/lib/%{name}/mysql.data <<EOF
320 This file can only contain 5 lines with the following values:
332 install -d $RPM_BUILD_ROOT/var/lib/%{name}
333 cat > $RPM_BUILD_ROOT/var/lib/%{name}/pgsql.data <<EOF
338 This file can only contain 5 lines with the following values:
349 /sbin/chkconfig --add dspam
350 %service dspam restart "dspam daemon"
353 if [ "$1" = "0" ]; then
355 /sbin/chkconfig --del dspam
359 rm -rf $RPM_BUILD_ROOT
361 %post libs -p /sbin/ldconfig
362 %postun libs -p /sbin/ldconfig
365 if [ "$1" = "1" ]; then
366 sed -i -e '/^StorageDriver/s,/.*.so,%{_libdir}/libdb4_drv.so,' /etc/dspam.conf
370 if [ "$1" = "1" ]; then
371 sed -i -e '/^StorageDriver/s,/.*\.so,%{_libdir}/libhash_drv.so,' /etc/dspam.conf
375 if [ "$1" = "1" ]; then
376 sed -i -e '/^StorageDriver/s,/.*\.so,%{_libdir}/libmysql_drv.so,' /etc/dspam.conf
380 if [ "$1" = "1" ]; then
381 sed -i -e '/^StorageDriver/s,/.*\.so,%{_libdir}/libpgsql_drv.so,' /etc/dspam.conf
385 if [ "$1" = "1" ]; then
386 sed -i -e '/^StorageDriver/s,/.*\.so,%{_libdir}/libsqlite_drv.so,' /etc/dspam.conf
390 %defattr(644,root,root,755)
391 %doc README CHANGELOG RELEASE.NOTES UPGRADING
392 %doc webui/*/*.{cgi,prefs,txt} webui/*/*.txt webui/*/templates/*.html
393 %doc doc/{courier,exim,markov,pop3filter,postfix,qmail,relay,sendmail}.txt
394 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dspam.conf
395 %dir %attr(750,root,mail) /var/lib/%{name}
396 %dir %attr(770,root,mail) /var/log/dspam
397 %attr(755,root,root) %config(noreplace) /etc/cron.daily/%{name}
398 %attr(755,root,root) %{_bindir}/%{name}
399 %attr(755,root,root) %{_bindir}/%{name}_logrotate
400 %attr(755,root,root) %{_bindir}/%{name}_clean
401 %attr(755,root,root) %{_bindir}/%{name}_corpus
402 %attr(755,root,root) %{_bindir}/%{name}_crc
403 %attr(755,root,root) %{_bindir}/%{name}_dump
404 %attr(755,root,root) %{_bindir}/%{name}_genaliases
405 %attr(755,root,root) %{_bindir}/%{name}_stats
406 %attr(755,root,root) %{_bindir}/%{name}_merge
407 %attr(755,root,root) %{_bindir}/%{name}_2sql
408 %attr(755,root,root) %{_bindir}/%{name}_admin
409 %{_mandir}/man?/%{name}*
412 %attr(754,root,root) /etc/rc.d/init.d/dspam
414 %defattr(644,root,root,755)
415 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dspam.conf
416 %attr(770,root,mail) /var/run/dspam
418 %attr(755,root,root) %{_bindir}/%{name}c
421 %defattr(644,root,root,755)
422 %doc README CHANGELOG
423 %attr(755,root,root) %{_libdir}/lib*.so.*.*.*
424 %attr(755,root,root) %exclude %{_libdir}/lib*_drv*.so*
427 %defattr(644,root,root,755)
428 %attr(755,root,root) %{_libdir}/lib*.so
429 %attr(755,root,root) %exclude %{_libdir}/lib*_drv*.so*
431 %{_includedir}/%{name}
432 %{_mandir}/man3/libdspam*
433 %{_pkgconfigdir}/*.pc
436 %defattr(644,root,root,755)
440 %defattr(644,root,root,755)
441 %attr(755,root,root) %{_bindir}/css*
442 %attr(755,root,root) %{_libdir}/libhash_drv*.so*
446 %defattr(644,root,root,755)
447 %attr(755,root,root) %{_libdir}/libdb4_drv*.so*
452 %defattr(644,root,root,755)
453 %doc doc/mysql_drv.txt src/tools.mysql_drv/*.sql
454 %attr(640,root,mail) %config(noreplace) /var/lib/%{name}/mysql.data
455 %attr(755,root,root) %{_libdir}/libmysql_drv*.so*
460 %defattr(644,root,root,755)
461 %doc doc/pgsql_drv.txt src/tools.pgsql_drv/*.sql
462 %attr(640,root,mail) %config(noreplace) /var/lib/%{name}/pgsql.data
463 %attr(755,root,root) %{_bindir}/%{name}_pg2int8
464 %attr(755,root,root) %{_libdir}/libpgsql_drv*.so*
469 %defattr(644,root,root,755)
470 %doc doc/sqlite_drv.txt
471 %attr(755,root,root) %{_libdir}/libsqlite_drv*.so*