3 # - support for libdclassify
7 %bcond_without mysql # enable MySQL storage driver
8 %bcond_without pgsql # enable PostgreSQL storage driver
9 %bcond_without sqlite # enable SQLite3 storage driver
13 Summary: A library and Mail Delivery Agent for Bayesian spam filtering
14 Summary(pl): Biblioteka i MDA do bayesowskiego filtrowania spamu
19 Group: Applications/Mail
20 Source0: http://www.nuclearelephant.com/projects/dspam/sources/%{name}-%{version}.tar.gz
21 # Source0-md5: d9ee63a8cf67ea933d711b00851ce916
23 URL: http://www.nuclearelephant.com/projects/dspam/
24 BuildRequires: autoconf
25 BuildRequires: automake
26 BuildRequires: libtool
27 BuildRequires: clamav-devel
28 BuildRequires: openldap-devel
29 %{?with_db:BuildRequires: db-devel}
30 %{?with_mysql:BuildRequires: mysql-devel}
31 %{?with_pgsql:BuildRequires: postgresql-devel}
32 %{?with_sqlite:BuildRequires: sqlite3-devel}
33 BuildRequires: zlib-devel
34 BuildRequires: sed >= 4.0
35 Buildroot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38 DSPAM (as in De-Spam) is an open-source project to create a new kind
39 of anti-spam mechanism, and is currently effective as both a
40 server-side agent for UNIX email servers and a developer's library for
41 mail clients, other anti-spam tools, and similar projects requiring
42 drop-in spam filtering.
44 The DSPAM agent masquerades as the email server's local delivery agent
45 and filters/learns spams using an advanced Bayesian statistical
46 approach (based on Bayes's theorem of combined probabilities) which
47 provides an administratively maintenance-free, easy-learning Anti-Spam
48 service custom tailored to each individual user's behavior. Advanced
49 because on top of standard Bayesian filtering is also incorporated the
50 use of Chained Tokens, de-obfuscation, and other enhancements. DSPAM
51 works great with Sendmail and Exim, and should work well with any
52 other MTA that supports an external local delivery agent (postfix,
56 DSPAM (czyli De-Spam) to projekt o otwartych ¼ród³ach maj±cy na celu
57 stworzenie nowego rodzaju mechanizmu antyspamowego. Aktualnie jest
58 efektywny zarówno jako dzia³aj±cy po stronie serwera agent dla
59 uniksowych serwerów pocztowych jak i biblioteka dla programistów
60 klientów pocztowych, innych narzêdzi antyspamowych i innych projektów
61 wymagaj±cych filtrowania spamu w locie.
63 Agent DSPAM zachowuje siê jak lokalny agent dostarczania poczty (MDA)
64 i filtruje/uczy siê spamu przy u¿yciu zaawansowanego bayesowskiego
65 przybli¿enia statystycznego (opartego na twierdzeniu Bayesa o
66 po³±czonych prawdopodobieñstwach), daj±c nie wymagaj±c± obs³ugi
67 administracyjnej, ³atwo ucz±c± siê us³ugê antyspamow± dostosowan± do
68 zachowania ka¿dego u¿ytkownika. Metoda jest zaawansowana poniewa¿ na
69 podstawie standardowego filtrowania bayesowskiego wprowadzono u¿ycie
70 tokenów ³añcuchowych, eliminowanie ukrywanie i inne rozszerzenia.
71 DSPAM dzia³a wspaniale z Sendmailem i Eximem, powinien dzia³aæ dobrze
72 z ka¿dym innym MTA obs³uguj±cym zewnêtrznego agenta MDA (postfiksem,
77 Summary(pl): Klient dspam
78 Group: Applications/Mail
79 # to get the same dspam.conf when both installed
80 Conflicts: dspam > %{version}-%{release}
81 Conflicts: dspam < %{version}-%{release}
86 %description client -l pl
90 Summary: A library for Bayesian spam filtering
91 Summary(pl): Biblioteka do bayesowskiego filtrowania spamu
93 Requires: %{name}-driver = %{version}-%{release}
96 DSPAM (as in De-Spam) is an open-source project to create a new kind
97 of anti-spam mechanism, and is currently effective as both a
98 server-side agent for UNIX email servers and a developer's library for
99 mail clients, other anti-spam tools, and similar projects requiring
100 drop-in spam filtering.
102 This package contains the library.
104 %description libs -l pl
105 DSPAM (czyli De-Spam) to projekt o otwartych ¼ród³ach maj±cy na celu
106 stworzenie nowego rodzaju mechanizmu antyspamowego. Aktualnie jest
107 efektywny zarówno jako dzia³aj±cy po stronie serwera agent dla
108 uniksowych serwerów pocztowych jak i biblioteka dla programistów
109 klientów pocztowych, innych narzêdzi antyspamowych i innych projektów
110 wymagaj±cych filtrowania spamu w locie.
112 Ten pakiet zawiera wspomnian± bibliotekê.
115 Summary: Header files for the DSPAM library
116 Summary(pl): Pliki nag³ówkowe biblioteki DSPAM
117 Group: Development/Libraries
118 Requires: %{name}-libs = %{version}-%{release}
121 DSPAM has had its core engine moved into a separate library, libdspam.
122 This library can be used by developers to provide 'drop-in' spam
123 filtering for their mail client applications, other anti-spam tools,
126 %description devel -l pl
127 G³ówny silnik DSPAM zosta³ przeniesiony do oddzielnej biblioteki
128 libdspam, która mo¿e byæ u¿ywana przez programistów do zapewnienia
129 filtrowania spamu w locie dla aplikacji klientów pocztowych, innych
130 narzêdzi antyspamowych i podobnych projektów.
133 Summary: Static DSPAM library
134 Summary(pl): Statyczna biblioteka DSPAM
135 Group: Development/Libraries
136 Requires: %{name}-devel = %{version}-%{release}
139 Static DSPAM library.
141 %description static -l pl
142 Statyczna biblioteka DSPAM.
145 Summary: HASH driver for DSPAM
147 Requires: %{name}-libs = %{version}-%{release}
148 Provides: %{name}-driver = %{version}-%{release}
150 %description driver-hash
151 HASH driver for DSPAM.
154 Summary: DB driver for DSPAM
156 Requires: %{name}-libs = %{version}-%{release}
157 Provides: %{name}-driver = %{version}-%{release}
159 %description driver-db
162 %package driver-mysql
163 Summary: MySQL driver for DSPAM
165 Requires: %{name}-libs = %{version}-%{release}
166 Provides: %{name}-driver = %{version}-%{release}
168 %description driver-mysql
169 MySQL driver for DSPAM.
171 %package driver-pgsql
172 Summary: PostgreSQL driver for DSPAM
174 Requires: %{name}-libs = %{version}-%{release}
175 Provides: %{name}-driver = %{version}-%{release}
177 %description driver-pgsql
178 PostgreSQL driver for DSPAM.
180 %package driver-sqlite
181 Summary: SQLite driver for DSPAM
183 Requires: %{name}-libs = %{version}-%{release}
184 Provides: %{name}-driver = %{version}-%{release}
186 %description driver-sqlite
187 SQLite driver for DSPAM.
191 sed -i -e 's#\-static##g' src/Makefile* src/*/Makefile*
199 %{?debug: --enable-debug --enable-bnr-debug --enable-verbose-debug} \
200 --enable-trusted-user-security \
202 --enable-large-scale \
203 --with-userdir=/var/lib/%{name} \
204 --with-dspam-home=/var/lib/%{name} \
205 --with-userdir-owner=none \
206 --with-userdir-group=none \
207 --with-dspam-owner=none \
208 --with-dspam-group=none \
209 --with-signature-life=14 \
210 --disable-dependency-tracking \
213 --enable-preferences-extension \
214 --enable-long-usernames \
215 --enable-neural-networking \
216 --enable-virtual-users \
217 --with-storage-driver=hash_drv%{?with_db:,libdb4_drv}%{?with_mysql:,mysql_drv}%{?with_pgsql:,pgsql_drv}%{?with_sqlite:,sqlite_drv} \
219 --with-mysql-includes=%{_includedir}/mysql \
220 --with-mysql-libraries=%{_libdir} \
223 --with-pgsql-includes=%{_includedir}/postgresql \
224 --with-pgsql-libraries=%{_libdir} \
227 --with-sqlite3-includes=%{_includedir} \
228 --with-sqlite3-libraries=%{_libdir} \
232 # --enable-dclassify-extension needs libdclassify
237 rm -rf $RPM_BUILD_ROOT
240 DESTDIR=$RPM_BUILD_ROOT
242 install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig}
243 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/dspam
245 # install devel files
246 install -d $RPM_BUILD_ROOT{%{_includedir}/%{name},/var/lib/%{name}}
247 install src/*.h $RPM_BUILD_ROOT%{_includedir}/%{name}
249 # provide maintenance scripts
250 install -d $RPM_BUILD_ROOT/etc/cron.daily
251 install -d $RPM_BUILD_ROOT/etc/cron.weekly
253 cat > $RPM_BUILD_ROOT/etc/cron.daily/%{name} <<EOF
255 exec %{_bindir}/%{name}_clean -s -p
258 chmod 755 $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily/%{name}
261 sed -i -e "s|%{_prefix}/local|%{_prefix}|g" $RPM_BUILD_ROOT%{_bindir}/%{name}_corpus
262 sed -i -e "s|%{_prefix}/local|%{_prefix}|g" webui/cgi-bin/dspam.cgi
265 #install dspam-cron.weekly $RPM_BUILD_ROOT%{_sysconfdir}/cron.weekly/%{name}
269 install -d $RPM_BUILD_ROOT/var/lib/%{name}
270 cat > $RPM_BUILD_ROOT/var/lib/%{name}/mysql.data <<EOF
275 This file can only contain 5 lines with the following values:
287 install -d $RPM_BUILD_ROOT/var/lib/%{name}
288 cat > $RPM_BUILD_ROOT/var/lib/%{name}/pgsql.data <<EOF
293 This file can only contain 5 lines with the following values:
304 /sbin/chkconfig --add dspam
305 if [ -f /var/lock/subsys/dspam ]; then
306 /etc/rc.d/init.d/dspam restart 1>&2
308 echo "Run \"/etc/rc.d/init.d/dspam start\" to start dspam daemon."
312 if [ "$1" = "0" ]; then
313 if [ -f /var/lock/subsys/dspam ]; then
314 /etc/rc.d/init.d/dspam stop 1>&2
316 /sbin/chkconfig --del dspam
320 rm -rf $RPM_BUILD_ROOT
322 %post libs -p /sbin/ldconfig
323 %postun libs -p /sbin/ldconfig
326 %defattr(644,root,root,755)
327 %doc README CHANGELOG RELEASE.NOTES UPGRADING
328 %doc webui/*/*.{cgi,prefs,txt} webui/*/*.txt webui/*/templates/*.html
329 %doc doc/{courier,exim,markov,pop3filter,postfix,qmail,relay,sendmail}.txt
330 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dspam.conf
331 %dir %attr(750,root,mail) /var/lib/%{name}
332 %attr(755,root,root) %config(noreplace) /etc/cron.daily/%{name}
333 %attr(755,root,mail) %{_bindir}/%{name}
334 %attr(755,root,mail) %{_bindir}/%{name}_logrotate
335 %attr(755,root,root) %{_bindir}/%{name}_clean
336 %attr(755,root,root) %{_bindir}/%{name}_corpus
337 %attr(755,root,root) %{_bindir}/%{name}_crc
338 %attr(755,root,root) %{_bindir}/%{name}_dump
339 %attr(755,root,root) %{_bindir}/%{name}_genaliases
340 %attr(755,root,root) %{_bindir}/%{name}_stats
341 %attr(755,root,root) %{_bindir}/%{name}_merge
342 %attr(755,root,root) %{_bindir}/%{name}_2sql
343 %attr(755,root,root) %{_bindir}/%{name}_admin
344 %{_mandir}/man?/%{name}*
347 %attr(754,root,root) /etc/rc.d/init.d/dspam
349 %defattr(644,root,root,755)
350 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dspam.conf
352 %attr(755,root,mail) %{_bindir}/%{name}c
355 %defattr(644,root,root,755)
356 %doc README CHANGELOG
357 %attr(755,root,root) %{_libdir}/lib*.so.*.*.*
358 %attr(755,root,root) %exclude %{_libdir}/lib*_drv*.so*
361 %defattr(644,root,root,755)
362 %attr(755,root,root) %{_libdir}/lib*.so
363 %attr(755,root,root) %exclude %{_libdir}/lib*_drv*.so*
365 %{_includedir}/%{name}
366 %{_mandir}/man3/libdspam*
367 %{_pkgconfigdir}/*.pc
370 %defattr(644,root,root,755)
374 %defattr(644,root,root,755)
375 %attr(755,root,root) %{_bindir}/css*
376 %attr(755,root,root) %{_libdir}/libhash_drv*.so*
380 %defattr(644,root,root,755)
381 %attr(755,root,root) %{_libdir}/libdb4_drv*.so*
386 %defattr(644,root,root,755)
387 %doc doc/mysql_drv.txt src/tools.mysql_drv/*.sql
388 %attr(640,root,mail) %config(noreplace) /var/lib/%{name}/mysql.data
389 %attr(755,root,root) %{_libdir}/libmysql_drv*.so*
394 %defattr(644,root,root,755)
395 %doc doc/pgsql_drv.txt src/tools.pgsql_drv/*.sql
396 %attr(640,root,mail) %config(noreplace) /var/lib/%{name}/pgsql.data
397 %attr(755,root,root) %{_bindir}/%{name}_pg2int8
398 %attr(755,root,root) %{_libdir}/libpgsql_drv*.so*
403 %defattr(644,root,root,755)
404 %doc doc/sqlite_drv.txt
405 %attr(755,root,root) %{_libdir}/libsqlite_drv*.so*