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
15 Summary: A library and Mail Delivery Agent for Bayesian spam filtering
16 Summary(pl): Biblioteka i MDA do bayesowskiego filtrowania spamu
21 Group: Applications/Mail
22 Source0: http://www.nuclearelephant.com/projects/dspam/sources/%{name}-%{version}.tar.gz
23 # Source0-md5: db1aedb9677e6bf5c7a47a72d4f130e5
25 URL: http://www.nuclearelephant.com/projects/dspam/
26 BuildRequires: autoconf
27 BuildRequires: automake
28 BuildRequires: libtool
29 BuildRequires: clamav-devel
30 %{?with_db:BuildRequires: db-devel}
31 %{?with_mysql:BuildRequires: mysql-devel}
32 BuildRequires: openldap-devel
33 %{?with_pgsql:BuildRequires: postgresql-devel}
34 BuildRequires: sed >= 4.0
35 %{?with_sqlite:BuildRequires: sqlite3-devel}
36 BuildRequires: zlib-devel
37 Buildroot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
40 DSPAM (as in De-Spam) is an open-source project to create a new kind
41 of anti-spam mechanism, and is currently effective as both a
42 server-side agent for UNIX email servers and a developer's library for
43 mail clients, other anti-spam tools, and similar projects requiring
44 drop-in spam filtering.
46 The DSPAM agent masquerades as the email server's local delivery agent
47 and filters/learns spams using an advanced Bayesian statistical
48 approach (based on Bayes's theorem of combined probabilities) which
49 provides an administratively maintenance-free, easy-learning Anti-Spam
50 service custom tailored to each individual user's behavior. Advanced
51 because on top of standard Bayesian filtering is also incorporated the
52 use of Chained Tokens, de-obfuscation, and other enhancements. DSPAM
53 works great with Sendmail and Exim, and should work well with any
54 other MTA that supports an external local delivery agent (postfix,
58 DSPAM (czyli De-Spam) to projekt o otwartych ¼ród³ach maj±cy na celu
59 stworzenie nowego rodzaju mechanizmu antyspamowego. Aktualnie jest
60 efektywny zarówno jako dzia³aj±cy po stronie serwera agent dla
61 uniksowych serwerów pocztowych jak i biblioteka dla programistów
62 klientów pocztowych, innych narzêdzi antyspamowych i innych projektów
63 wymagaj±cych filtrowania spamu w locie.
65 Agent DSPAM zachowuje siê jak lokalny agent dostarczania poczty (MDA)
66 i filtruje/uczy siê spamu przy u¿yciu zaawansowanego bayesowskiego
67 przybli¿enia statystycznego (opartego na twierdzeniu Bayesa o
68 po³±czonych prawdopodobieñstwach), daj±c nie wymagaj±c± obs³ugi
69 administracyjnej, ³atwo ucz±c± siê us³ugê antyspamow± dostosowan± do
70 zachowania ka¿dego u¿ytkownika. Metoda jest zaawansowana poniewa¿ na
71 podstawie standardowego filtrowania bayesowskiego wprowadzono u¿ycie
72 tokenów ³añcuchowych, eliminowanie ukrywanie i inne rozszerzenia.
73 DSPAM dzia³a wspaniale z Sendmailem i Eximem, powinien dzia³aæ dobrze
74 z ka¿dym innym MTA obs³uguj±cym zewnêtrznego agenta MDA (postfiksem,
79 Summary(pl): Klient dspam
80 Group: Applications/Mail
81 # to get the same dspam.conf when both installed
82 Conflicts: dspam > %{version}-%{release}
83 Conflicts: dspam < %{version}-%{release}
88 %description client -l pl
92 Summary: A library for Bayesian spam filtering
93 Summary(pl): Biblioteka do bayesowskiego filtrowania spamu
95 Requires: %{name}-driver = %{version}-%{release}
98 DSPAM (as in De-Spam) is an open-source project to create a new kind
99 of anti-spam mechanism, and is currently effective as both a
100 server-side agent for UNIX email servers and a developer's library for
101 mail clients, other anti-spam tools, and similar projects requiring
102 drop-in spam filtering.
104 This package contains the library.
106 %description libs -l pl
107 DSPAM (czyli De-Spam) to projekt o otwartych ¼ród³ach maj±cy na celu
108 stworzenie nowego rodzaju mechanizmu antyspamowego. Aktualnie jest
109 efektywny zarówno jako dzia³aj±cy po stronie serwera agent dla
110 uniksowych serwerów pocztowych jak i biblioteka dla programistów
111 klientów pocztowych, innych narzêdzi antyspamowych i innych projektów
112 wymagaj±cych filtrowania spamu w locie.
114 Ten pakiet zawiera wspomnian± bibliotekê.
117 Summary: Header files for the DSPAM library
118 Summary(pl): Pliki nag³ówkowe biblioteki DSPAM
119 Group: Development/Libraries
120 Requires: %{name}-libs = %{version}-%{release}
123 DSPAM has had its core engine moved into a separate library, libdspam.
124 This library can be used by developers to provide 'drop-in' spam
125 filtering for their mail client applications, other anti-spam tools,
128 %description devel -l pl
129 G³ówny silnik DSPAM zosta³ przeniesiony do oddzielnej biblioteki
130 libdspam, która mo¿e byæ u¿ywana przez programistów do zapewnienia
131 filtrowania spamu w locie dla aplikacji klientów pocztowych, innych
132 narzêdzi antyspamowych i podobnych projektów.
135 Summary: Static DSPAM library
136 Summary(pl): Statyczna biblioteka DSPAM
137 Group: Development/Libraries
138 Requires: %{name}-devel = %{version}-%{release}
141 Static DSPAM library.
143 %description static -l pl
144 Statyczna biblioteka DSPAM.
147 Summary: HASH driver for DSPAM
148 Summary(pl): Sterownik HASH dla DSPAM-a
150 Requires: %{name}-libs = %{version}-%{release}
151 Requires(post): sed >= 4.0
152 Provides: %{name}-driver = %{version}-%{release}
154 %description driver-hash
155 HASH driver for DSPAM.
157 %description driver-hash -l pl
158 Sterownik HASH dla DSPAM-a.
161 Summary: DB driver for DSPAM
162 Summary(pl): Sterownik DB dla DSPAM-a
164 Requires: %{name}-libs = %{version}-%{release}
165 Requires(post): sed >= 4.0
166 Provides: %{name}-driver = %{version}-%{release}
168 %description driver-db
171 %description driver-db -l pl
172 Sterownik DB dla DSPAM-a.
174 %package driver-mysql
175 Summary: MySQL driver for DSPAM
176 Summary(pl): Sterownik MySQL dla DSPAM-a
178 Requires: %{name}-libs = %{version}-%{release}
179 Requires(post): sed >= 4.0
180 Provides: %{name}-driver = %{version}-%{release}
182 %description driver-mysql
183 MySQL driver for DSPAM.
185 %description driver-mysql -l pl
186 Sterownik MySQL dla DSPAM-a.
188 %package driver-pgsql
189 Summary: PostgreSQL driver for DSPAM
190 Summary(pl): Sterownik PostgreSQL dla DSPAM-a
192 Requires: %{name}-libs = %{version}-%{release}
193 Requires(post): sed >= 4.0
194 Provides: %{name}-driver = %{version}-%{release}
196 %description driver-pgsql
197 PostgreSQL driver for DSPAM.
199 %description driver-pgsql -l pl
200 Sterownik PostgreSQL dla DSPAM-a.
202 %package driver-sqlite
203 Summary: SQLite driver for DSPAM
204 Summary(pl): Sterownik SQLite dla DSPAM-a
206 Requires: %{name}-libs = %{version}-%{release}
207 Requires(post): sed >= 4.0
208 Provides: %{name}-driver = %{version}-%{release}
210 %description driver-sqlite
211 SQLite driver for DSPAM.
213 %description driver-sqlite -l pl
214 Sterownik SQLite dla DSPAM-a.
218 sed -i -e 's#\-static##g' src/Makefile* src/*/Makefile*
228 %{?with_db:libdb4_drv}
229 %{?with_mysql:mysql_drv}
230 %{?with_pgsql:pgsql_drv}
231 %{?with_sqlite:sqlite_drv}
234 %{?debug: --enable-debug --enable-bnr-debug --enable-verbose-debug} \
235 --enable-trusted-user-security \
237 --enable-large-scale \
238 --with-userdir=/var/lib/%{name} \
239 --with-userdir-owner=none \
240 --with-userdir-group=none \
241 --with-dspam-home=/var/lib/%{name} \
242 --with-dspam-home-owner=none \
243 --with-dspam-home-group=none \
244 --with-dspam-owner=none \
245 --with-dspam-group=none \
246 --with-signature-life=14 \
247 --disable-dependency-tracking \
250 --enable-preferences-extension \
251 --enable-long-usernames \
252 --enable-neural-networking \
253 --enable-virtual-users \
254 --with-storage-driver=$(echo $DRIVERS | tr ' ' ',') \
256 --with-mysql-includes=%{_includedir}/mysql \
257 --with-mysql-libraries=%{_libdir} \
260 --with-pgsql-includes=%{_includedir}/postgresql \
261 --with-pgsql-libraries=%{_libdir} \
264 --with-sqlite3-includes=%{_includedir} \
265 --with-sqlite3-libraries=%{_libdir} \
269 # --enable-dclassify-extension needs libdclassify
274 rm -rf $RPM_BUILD_ROOT
277 DESTDIR=$RPM_BUILD_ROOT
279 install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig}
280 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/dspam
282 # install devel files
283 install -d $RPM_BUILD_ROOT{%{_includedir}/%{name},/var/lib/%{name}}
284 install src/*.h $RPM_BUILD_ROOT%{_includedir}/%{name}
286 # provide maintenance scripts
287 install -d $RPM_BUILD_ROOT/etc/cron.daily
288 install -d $RPM_BUILD_ROOT/etc/cron.weekly
290 cat > $RPM_BUILD_ROOT/etc/cron.daily/%{name} <<EOF
292 exec %{_bindir}/%{name}_clean -s -p
295 chmod 755 $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily/%{name}
298 sed -i -e "s|%{_prefix}/local|%{_prefix}|g" $RPM_BUILD_ROOT%{_bindir}/%{name}_corpus
299 sed -i -e "s|%{_prefix}/local|%{_prefix}|g" webui/cgi-bin/dspam.cgi
302 #install dspam-cron.weekly $RPM_BUILD_ROOT%{_sysconfdir}/cron.weekly/%{name}
306 install -d $RPM_BUILD_ROOT/var/lib/%{name}
307 cat > $RPM_BUILD_ROOT/var/lib/%{name}/mysql.data <<EOF
312 This file can only contain 5 lines with the following values:
324 install -d $RPM_BUILD_ROOT/var/lib/%{name}
325 cat > $RPM_BUILD_ROOT/var/lib/%{name}/pgsql.data <<EOF
330 This file can only contain 5 lines with the following values:
341 /sbin/chkconfig --add dspam
342 if [ -f /var/lock/subsys/dspam ]; then
343 /etc/rc.d/init.d/dspam restart 1>&2
345 echo "Run \"/etc/rc.d/init.d/dspam start\" to start dspam daemon."
349 if [ "$1" = "0" ]; then
350 if [ -f /var/lock/subsys/dspam ]; then
351 /etc/rc.d/init.d/dspam stop 1>&2
353 /sbin/chkconfig --del dspam
357 rm -rf $RPM_BUILD_ROOT
359 %post libs -p /sbin/ldconfig
360 %postun libs -p /sbin/ldconfig
363 if [ "$1" = "1" ]; then
364 sed -i -e '/^StorageDriver/s,/.*.so,%{_libdir}/libdb4_drv.so,' /etc/dspam.conf
368 if [ "$1" = "1" ]; then
369 sed -i -e '/^StorageDriver/s,/.*\.so,%{_libdir}/libhash_drv.so,' /etc/dspam.conf
373 if [ "$1" = "1" ]; then
374 sed -i -e '/^StorageDriver/s,/.*\.so,%{_libdir}/libmysql_drv.so,' /etc/dspam.conf
378 if [ "$1" = "1" ]; then
379 sed -i -e '/^StorageDriver/s,/.*\.so,%{_libdir}/libpgsql_drv.so,' /etc/dspam.conf
383 if [ "$1" = "1" ]; then
384 sed -i -e '/^StorageDriver/s,/.*\.so,%{_libdir}/libsqlite_drv.so,' /etc/dspam.conf
388 %defattr(644,root,root,755)
389 %doc README CHANGELOG RELEASE.NOTES UPGRADING
390 %doc webui/*/*.{cgi,prefs,txt} webui/*/*.txt webui/*/templates/*.html
391 %doc doc/{courier,exim,markov,pop3filter,postfix,qmail,relay,sendmail}.txt
392 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dspam.conf
393 %dir %attr(750,root,mail) /var/lib/%{name}
394 %attr(755,root,root) %config(noreplace) /etc/cron.daily/%{name}
395 %attr(755,root,mail) %{_bindir}/%{name}
396 %attr(755,root,mail) %{_bindir}/%{name}_logrotate
397 %attr(755,root,root) %{_bindir}/%{name}_clean
398 %attr(755,root,root) %{_bindir}/%{name}_corpus
399 %attr(755,root,root) %{_bindir}/%{name}_crc
400 %attr(755,root,root) %{_bindir}/%{name}_dump
401 %attr(755,root,root) %{_bindir}/%{name}_genaliases
402 %attr(755,root,root) %{_bindir}/%{name}_stats
403 %attr(755,root,root) %{_bindir}/%{name}_merge
404 %attr(755,root,root) %{_bindir}/%{name}_2sql
405 %attr(755,root,root) %{_bindir}/%{name}_admin
406 %{_mandir}/man?/%{name}*
409 %attr(754,root,root) /etc/rc.d/init.d/dspam
411 %defattr(644,root,root,755)
412 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dspam.conf
414 %attr(755,root,mail) %{_bindir}/%{name}c
417 %defattr(644,root,root,755)
418 %doc README CHANGELOG
419 %attr(755,root,root) %{_libdir}/lib*.so.*.*.*
420 %attr(755,root,root) %exclude %{_libdir}/lib*_drv*.so*
423 %defattr(644,root,root,755)
424 %attr(755,root,root) %{_libdir}/lib*.so
425 %attr(755,root,root) %exclude %{_libdir}/lib*_drv*.so*
427 %{_includedir}/%{name}
428 %{_mandir}/man3/libdspam*
429 %{_pkgconfigdir}/*.pc
432 %defattr(644,root,root,755)
436 %defattr(644,root,root,755)
437 %attr(755,root,root) %{_bindir}/css*
438 %attr(755,root,root) %{_libdir}/libhash_drv*.so*
442 %defattr(644,root,root,755)
443 %attr(755,root,root) %{_libdir}/libdb4_drv*.so*
448 %defattr(644,root,root,755)
449 %doc doc/mysql_drv.txt src/tools.mysql_drv/*.sql
450 %attr(640,root,mail) %config(noreplace) /var/lib/%{name}/mysql.data
451 %attr(755,root,root) %{_libdir}/libmysql_drv*.so*
456 %defattr(644,root,root,755)
457 %doc doc/pgsql_drv.txt src/tools.pgsql_drv/*.sql
458 %attr(640,root,mail) %config(noreplace) /var/lib/%{name}/pgsql.data
459 %attr(755,root,root) %{_bindir}/%{name}_pg2int8
460 %attr(755,root,root) %{_libdir}/libpgsql_drv*.so*
465 %defattr(644,root,root,755)
466 %doc doc/sqlite_drv.txt
467 %attr(755,root,root) %{_libdir}/libsqlite_drv*.so*