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: sed >= 4.0
36 %{?with_sqlite:BuildRequires: sqlite3-devel}
37 BuildRequires: zlib-devel
38 Requires(post,preun): /sbin/chkconfig
40 Buildroot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43 DSPAM (as in De-Spam) is an open-source project to create a new kind
44 of anti-spam mechanism, and is currently effective as both a
45 server-side agent for UNIX email servers and a developer's library for
46 mail clients, other anti-spam tools, and similar projects requiring
47 drop-in spam filtering.
49 The DSPAM agent masquerades as the email server's local delivery agent
50 and filters/learns spams using an advanced Bayesian statistical
51 approach (based on Bayes's theorem of combined probabilities) which
52 provides an administratively maintenance-free, easy-learning Anti-Spam
53 service custom tailored to each individual user's behavior. Advanced
54 because on top of standard Bayesian filtering is also incorporated the
55 use of Chained Tokens, de-obfuscation, and other enhancements. DSPAM
56 works great with Sendmail and Exim, and should work well with any
57 other MTA that supports an external local delivery agent (postfix,
61 DSPAM (czyli De-Spam) to projekt o otwartych ¼ród³ach maj±cy na celu
62 stworzenie nowego rodzaju mechanizmu antyspamowego. Aktualnie jest
63 efektywny zarówno jako dzia³aj±cy po stronie serwera agent dla
64 uniksowych serwerów pocztowych jak i biblioteka dla programistów
65 klientów pocztowych, innych narzêdzi antyspamowych i innych projektów
66 wymagaj±cych filtrowania spamu w locie.
68 Agent DSPAM zachowuje siê jak lokalny agent dostarczania poczty (MDA)
69 i filtruje/uczy siê spamu przy u¿yciu zaawansowanego bayesowskiego
70 przybli¿enia statystycznego (opartego na twierdzeniu Bayesa o
71 po³±czonych prawdopodobieñstwach), daj±c nie wymagaj±c± obs³ugi
72 administracyjnej, ³atwo ucz±c± siê us³ugê antyspamow± dostosowan± do
73 zachowania ka¿dego u¿ytkownika. Metoda jest zaawansowana poniewa¿ na
74 podstawie standardowego filtrowania bayesowskiego wprowadzono u¿ycie
75 tokenów ³añcuchowych, eliminowanie ukrywanie i inne rozszerzenia.
76 DSPAM dzia³a wspaniale z Sendmailem i Eximem, powinien dzia³aæ dobrze
77 z ka¿dym innym MTA obs³uguj±cym zewnêtrznego agenta MDA (postfiksem,
82 Summary(pl): Klient dspam
83 Group: Applications/Mail
84 # to get the same dspam.conf when both installed
85 Conflicts: dspam < %{version}-%{release}
86 Conflicts: dspam > %{version}-%{release}
91 %description client -l pl
95 Summary: A library for Bayesian spam filtering
96 Summary(pl): Biblioteka do bayesowskiego filtrowania spamu
98 Requires: %{name}-driver = %{version}-%{release}
101 DSPAM (as in De-Spam) is an open-source project to create a new kind
102 of anti-spam mechanism, and is currently effective as both a
103 server-side agent for UNIX email servers and a developer's library for
104 mail clients, other anti-spam tools, and similar projects requiring
105 drop-in spam filtering.
107 This package contains the library.
109 %description libs -l pl
110 DSPAM (czyli De-Spam) to projekt o otwartych ¼ród³ach maj±cy na celu
111 stworzenie nowego rodzaju mechanizmu antyspamowego. Aktualnie jest
112 efektywny zarówno jako dzia³aj±cy po stronie serwera agent dla
113 uniksowych serwerów pocztowych jak i biblioteka dla programistów
114 klientów pocztowych, innych narzêdzi antyspamowych i innych projektów
115 wymagaj±cych filtrowania spamu w locie.
117 Ten pakiet zawiera wspomnian± bibliotekê.
120 Summary: Header files for the DSPAM library
121 Summary(pl): Pliki nag³ówkowe biblioteki DSPAM
122 Group: Development/Libraries
123 Requires: %{name}-libs = %{version}-%{release}
126 DSPAM has had its core engine moved into a separate library, libdspam.
127 This library can be used by developers to provide 'drop-in' spam
128 filtering for their mail client applications, other anti-spam tools,
131 %description devel -l pl
132 G³ówny silnik DSPAM zosta³ przeniesiony do oddzielnej biblioteki
133 libdspam, która mo¿e byæ u¿ywana przez programistów do zapewnienia
134 filtrowania spamu w locie dla aplikacji klientów pocztowych, innych
135 narzêdzi antyspamowych i podobnych projektów.
138 Summary: Static DSPAM library
139 Summary(pl): Statyczna biblioteka DSPAM
140 Group: Development/Libraries
141 Requires: %{name}-devel = %{version}-%{release}
144 Static DSPAM library.
146 %description static -l pl
147 Statyczna biblioteka DSPAM.
150 Summary: HASH driver for DSPAM
151 Summary(pl): Sterownik HASH dla DSPAM-a
153 Requires(post): sed >= 4.0
154 Requires: %{name}-libs = %{version}-%{release}
155 Provides: %{name}-driver = %{version}-%{release}
157 %description driver-hash
158 HASH driver for DSPAM.
160 %description driver-hash -l pl
161 Sterownik HASH dla DSPAM-a.
164 Summary: DB driver for DSPAM
165 Summary(pl): Sterownik DB dla DSPAM-a
167 Requires(post): sed >= 4.0
168 Requires: %{name}-libs = %{version}-%{release}
169 Provides: %{name}-driver = %{version}-%{release}
171 %description driver-db
174 %description driver-db -l pl
175 Sterownik DB dla DSPAM-a.
177 %package driver-mysql
178 Summary: MySQL driver for DSPAM
179 Summary(pl): Sterownik MySQL dla DSPAM-a
181 Requires(post): sed >= 4.0
182 Requires: %{name}-libs = %{version}-%{release}
183 Provides: %{name}-driver = %{version}-%{release}
185 %description driver-mysql
186 MySQL driver for DSPAM.
188 %description driver-mysql -l pl
189 Sterownik MySQL dla DSPAM-a.
191 %package driver-pgsql
192 Summary: PostgreSQL driver for DSPAM
193 Summary(pl): Sterownik PostgreSQL dla DSPAM-a
195 Requires(post): sed >= 4.0
196 Requires: %{name}-libs = %{version}-%{release}
197 Provides: %{name}-driver = %{version}-%{release}
199 %description driver-pgsql
200 PostgreSQL driver for DSPAM.
202 %description driver-pgsql -l pl
203 Sterownik PostgreSQL dla DSPAM-a.
205 %package driver-sqlite
206 Summary: SQLite driver for DSPAM
207 Summary(pl): Sterownik SQLite dla DSPAM-a
209 Requires(post): sed >= 4.0
210 Requires: %{name}-libs = %{version}-%{release}
211 Provides: %{name}-driver = %{version}-%{release}
213 %description driver-sqlite
214 SQLite driver for DSPAM.
216 %description driver-sqlite -l pl
217 Sterownik SQLite dla DSPAM-a.
221 sed -i -e 's#\-static##g' src/Makefile* src/*/Makefile*
222 %{?with_mysql40:sed -i -e 's#40100#99999#g' src/mysql_drv.c}
232 %{?with_db:libdb4_drv}
233 %{?with_mysql:mysql_drv}
234 %{?with_pgsql:pgsql_drv}
235 %{?with_sqlite:sqlite_drv}
238 %{?debug: --enable-debug --enable-bnr-debug --enable-verbose-debug} \
239 --enable-trusted-user-security \
241 --enable-large-scale \
242 --with-userdir=/var/lib/%{name} \
243 --with-userdir-owner=none \
244 --with-userdir-group=none \
245 --with-dspam-home=/var/lib/%{name} \
246 --with-dspam-home-owner=none \
247 --with-dspam-home-group=none \
248 --with-dspam-owner=none \
249 --with-dspam-group=none \
250 --with-signature-life=14 \
251 --disable-dependency-tracking \
254 --enable-preferences-extension \
255 --enable-long-usernames \
256 --enable-neural-networking \
257 --enable-virtual-users \
258 --with-storage-driver=$(echo $DRIVERS | tr ' ' ',') \
260 --with-mysql-includes=%{_includedir}/mysql \
261 --with-mysql-libraries=%{_libdir} \
264 --with-pgsql-includes=%{_includedir}/postgresql \
265 --with-pgsql-libraries=%{_libdir} \
268 --with-sqlite3-includes=%{_includedir} \
269 --with-sqlite3-libraries=%{_libdir} \
273 # --enable-dclassify-extension needs libdclassify
278 rm -rf $RPM_BUILD_ROOT
281 DESTDIR=$RPM_BUILD_ROOT
283 install -d $RPM_BUILD_ROOT/{var/run/dspam,/etc/{rc.d/init.d,sysconfig}}
284 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/dspam
287 ln -s /var/log/dspam $RPM_BUILD_ROOT/var/lib/%{name}/log
289 # install devel files
290 install -d $RPM_BUILD_ROOT{%{_includedir}/%{name},/var/{log,lib}/%{name}}
291 install src/*.h $RPM_BUILD_ROOT%{_includedir}/%{name}
293 # provide maintenance scripts
294 install -d $RPM_BUILD_ROOT/etc/cron.daily
295 install -d $RPM_BUILD_ROOT/etc/cron.weekly
297 cat > $RPM_BUILD_ROOT/etc/cron.daily/%{name} <<EOF
299 exec %{_bindir}/%{name}_clean -s -p
302 chmod 755 $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily/%{name}
305 sed -i -e "s|%{_prefix}/local|%{_prefix}|g" $RPM_BUILD_ROOT%{_bindir}/%{name}_corpus
306 sed -i -e "s|%{_prefix}/local|%{_prefix}|g" webui/cgi-bin/dspam.cgi
309 #install dspam-cron.weekly $RPM_BUILD_ROOT%{_sysconfdir}/cron.weekly/%{name}
313 install -d $RPM_BUILD_ROOT/var/lib/%{name}
314 cat > $RPM_BUILD_ROOT/var/lib/%{name}/mysql.data <<EOF
319 This file can only contain 5 lines with the following values:
331 install -d $RPM_BUILD_ROOT/var/lib/%{name}
332 cat > $RPM_BUILD_ROOT/var/lib/%{name}/pgsql.data <<EOF
337 This file can only contain 5 lines with the following values:
348 /sbin/chkconfig --add dspam
349 if [ -f /var/lock/subsys/dspam ]; then
350 /etc/rc.d/init.d/dspam restart 1>&2
352 echo "Run \"/etc/rc.d/init.d/dspam start\" to start dspam daemon."
356 if [ "$1" = "0" ]; then
357 if [ -f /var/lock/subsys/dspam ]; then
358 /etc/rc.d/init.d/dspam stop 1>&2
360 /sbin/chkconfig --del dspam
364 rm -rf $RPM_BUILD_ROOT
366 %post libs -p /sbin/ldconfig
367 %postun libs -p /sbin/ldconfig
370 if [ "$1" = "1" ]; then
371 sed -i -e '/^StorageDriver/s,/.*.so,%{_libdir}/libdb4_drv.so,' /etc/dspam.conf
375 if [ "$1" = "1" ]; then
376 sed -i -e '/^StorageDriver/s,/.*\.so,%{_libdir}/libhash_drv.so,' /etc/dspam.conf
380 if [ "$1" = "1" ]; then
381 sed -i -e '/^StorageDriver/s,/.*\.so,%{_libdir}/libmysql_drv.so,' /etc/dspam.conf
385 if [ "$1" = "1" ]; then
386 sed -i -e '/^StorageDriver/s,/.*\.so,%{_libdir}/libpgsql_drv.so,' /etc/dspam.conf
390 if [ "$1" = "1" ]; then
391 sed -i -e '/^StorageDriver/s,/.*\.so,%{_libdir}/libsqlite_drv.so,' /etc/dspam.conf
395 %defattr(644,root,root,755)
396 %doc README CHANGELOG RELEASE.NOTES UPGRADING
397 %doc webui/*/*.{cgi,prefs,txt} webui/*/*.txt webui/*/templates/*.html
398 %doc doc/{courier,exim,markov,pop3filter,postfix,qmail,relay,sendmail}.txt
399 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dspam.conf
400 %dir %attr(750,root,mail) /var/lib/%{name}
401 %dir %attr(770,root,mail) /var/log/dspam
402 %attr(755,root,root) %config(noreplace) /etc/cron.daily/%{name}
403 %attr(755,root,root) %{_bindir}/%{name}
404 %attr(755,root,root) %{_bindir}/%{name}_logrotate
405 %attr(755,root,root) %{_bindir}/%{name}_clean
406 %attr(755,root,root) %{_bindir}/%{name}_corpus
407 %attr(755,root,root) %{_bindir}/%{name}_crc
408 %attr(755,root,root) %{_bindir}/%{name}_dump
409 %attr(755,root,root) %{_bindir}/%{name}_genaliases
410 %attr(755,root,root) %{_bindir}/%{name}_stats
411 %attr(755,root,root) %{_bindir}/%{name}_merge
412 %attr(755,root,root) %{_bindir}/%{name}_2sql
413 %attr(755,root,root) %{_bindir}/%{name}_admin
414 %{_mandir}/man?/%{name}*
417 %attr(754,root,root) /etc/rc.d/init.d/dspam
419 %defattr(644,root,root,755)
420 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dspam.conf
421 %attr(770,root,mail) /var/run/dspam
423 %attr(755,root,root) %{_bindir}/%{name}c
426 %defattr(644,root,root,755)
427 %doc README CHANGELOG
428 %attr(755,root,root) %{_libdir}/lib*.so.*.*.*
429 %attr(755,root,root) %exclude %{_libdir}/lib*_drv*.so*
432 %defattr(644,root,root,755)
433 %attr(755,root,root) %{_libdir}/lib*.so
434 %attr(755,root,root) %exclude %{_libdir}/lib*_drv*.so*
436 %{_includedir}/%{name}
437 %{_mandir}/man3/libdspam*
438 %{_pkgconfigdir}/*.pc
441 %defattr(644,root,root,755)
445 %defattr(644,root,root,755)
446 %attr(755,root,root) %{_bindir}/css*
447 %attr(755,root,root) %{_libdir}/libhash_drv*.so*
451 %defattr(644,root,root,755)
452 %attr(755,root,root) %{_libdir}/libdb4_drv*.so*
457 %defattr(644,root,root,755)
458 %doc doc/mysql_drv.txt src/tools.mysql_drv/*.sql
459 %attr(640,root,mail) %config(noreplace) /var/lib/%{name}/mysql.data
460 %attr(755,root,root) %{_libdir}/libmysql_drv*.so*
465 %defattr(644,root,root,755)
466 %doc doc/pgsql_drv.txt src/tools.pgsql_drv/*.sql
467 %attr(640,root,mail) %config(noreplace) /var/lib/%{name}/pgsql.data
468 %attr(755,root,root) %{_bindir}/%{name}_pg2int8
469 %attr(755,root,root) %{_libdir}/libpgsql_drv*.so*
474 %defattr(644,root,root,755)
475 %doc doc/sqlite_drv.txt
476 %attr(755,root,root) %{_libdir}/libsqlite_drv*.so*