3 # - support for libdclassify
7 %bcond_without mysql # disable MySQL storage driver
8 %bcond_without pgsql # disable PostgreSQL storage driver
9 %bcond_without sqlite # disable SQLite3 storage driver
10 %bcond_without db # disable BerkeleyDB storage driver
11 %bcond_without daemon # disable daemon mode
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 %{?with_db:BuildRequires: db-devel}
29 %{?with_mysql:BuildRequires: mysql-devel}
30 BuildRequires: openldap-devel
31 %{?with_pgsql:BuildRequires: postgresql-devel}
32 BuildRequires: sed >= 4.0
33 %{?with_sqlite:BuildRequires: sqlite3-devel}
34 BuildRequires: zlib-devel
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
146 Summary(pl): Sterownik HASH dla DSPAM-a
148 Requires: %{name}-libs = %{version}-%{release}
149 Provides: %{name}-driver = %{version}-%{release}
151 %description driver-hash
152 HASH driver for DSPAM.
154 %description driver-hash -l pl
155 Sterownik HASH dla DSPAM-a.
158 Summary: DB driver for DSPAM
159 Summary(pl): Sterownik DB dla DSPAM-a
161 Requires: %{name}-libs = %{version}-%{release}
162 Provides: %{name}-driver = %{version}-%{release}
164 %description driver-db
167 %description driver-db -l pl
168 Sterownik DB dla DSPAM-a.
170 %package driver-mysql
171 Summary: MySQL driver for DSPAM
172 Summary(pl): Sterownik MySQL dla DSPAM-a
174 Requires: %{name}-libs = %{version}-%{release}
175 Provides: %{name}-driver = %{version}-%{release}
177 %description driver-mysql
178 MySQL driver for DSPAM.
180 %description driver-mysql -l pl
181 Sterownik MySQL dla DSPAM-a.
183 %package driver-pgsql
184 Summary: PostgreSQL driver for DSPAM
185 Summary(pl): Sterownik PostgreSQL dla DSPAM-a
187 Requires: %{name}-libs = %{version}-%{release}
188 Provides: %{name}-driver = %{version}-%{release}
190 %description driver-pgsql
191 PostgreSQL driver for DSPAM.
193 %description driver-pgsql -l pl
194 Sterownik PostgreSQL dla DSPAM-a.
196 %package driver-sqlite
197 Summary: SQLite driver for DSPAM
198 Summary(pl): Sterownik SQLite dla DSPAM-a
200 Requires: %{name}-libs = %{version}-%{release}
201 Provides: %{name}-driver = %{version}-%{release}
203 %description driver-sqlite
204 SQLite driver for DSPAM.
206 %description driver-sqlite -l pl
207 Sterownik SQLite dla DSPAM-a.
211 sed -i -e 's#\-static##g' src/Makefile* src/*/Makefile*
219 %{?debug: --enable-debug --enable-bnr-debug --enable-verbose-debug} \
220 --enable-trusted-user-security \
222 --enable-large-scale \
223 --with-userdir=/var/lib/%{name} \
224 --with-dspam-home=/var/lib/%{name} \
225 --with-userdir-owner=none \
226 --with-userdir-group=none \
227 --with-dspam-owner=none \
228 --with-dspam-group=none \
229 --with-signature-life=14 \
230 --disable-dependency-tracking \
233 --enable-preferences-extension \
234 --enable-long-usernames \
235 --enable-neural-networking \
236 --enable-virtual-users \
237 --with-storage-driver=hash_drv%{?with_db:,libdb4_drv}%{?with_mysql:,mysql_drv}%{?with_pgsql:,pgsql_drv}%{?with_sqlite:,sqlite_drv} \
239 --with-mysql-includes=%{_includedir}/mysql \
240 --with-mysql-libraries=%{_libdir} \
243 --with-pgsql-includes=%{_includedir}/postgresql \
244 --with-pgsql-libraries=%{_libdir} \
247 --with-sqlite3-includes=%{_includedir} \
248 --with-sqlite3-libraries=%{_libdir} \
252 # --enable-dclassify-extension needs libdclassify
257 rm -rf $RPM_BUILD_ROOT
260 DESTDIR=$RPM_BUILD_ROOT
262 install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig}
263 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/dspam
265 # install devel files
266 install -d $RPM_BUILD_ROOT{%{_includedir}/%{name},/var/lib/%{name}}
267 install src/*.h $RPM_BUILD_ROOT%{_includedir}/%{name}
269 # provide maintenance scripts
270 install -d $RPM_BUILD_ROOT/etc/cron.daily
271 install -d $RPM_BUILD_ROOT/etc/cron.weekly
273 cat > $RPM_BUILD_ROOT/etc/cron.daily/%{name} <<EOF
275 exec %{_bindir}/%{name}_clean -s -p
278 chmod 755 $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily/%{name}
281 sed -i -e "s|%{_prefix}/local|%{_prefix}|g" $RPM_BUILD_ROOT%{_bindir}/%{name}_corpus
282 sed -i -e "s|%{_prefix}/local|%{_prefix}|g" webui/cgi-bin/dspam.cgi
285 #install dspam-cron.weekly $RPM_BUILD_ROOT%{_sysconfdir}/cron.weekly/%{name}
289 install -d $RPM_BUILD_ROOT/var/lib/%{name}
290 cat > $RPM_BUILD_ROOT/var/lib/%{name}/mysql.data <<EOF
295 This file can only contain 5 lines with the following values:
307 install -d $RPM_BUILD_ROOT/var/lib/%{name}
308 cat > $RPM_BUILD_ROOT/var/lib/%{name}/pgsql.data <<EOF
313 This file can only contain 5 lines with the following values:
324 /sbin/chkconfig --add dspam
325 if [ -f /var/lock/subsys/dspam ]; then
326 /etc/rc.d/init.d/dspam restart 1>&2
328 echo "Run \"/etc/rc.d/init.d/dspam start\" to start dspam daemon."
332 if [ "$1" = "0" ]; then
333 if [ -f /var/lock/subsys/dspam ]; then
334 /etc/rc.d/init.d/dspam stop 1>&2
336 /sbin/chkconfig --del dspam
340 rm -rf $RPM_BUILD_ROOT
342 %post libs -p /sbin/ldconfig
343 %postun libs -p /sbin/ldconfig
346 %defattr(644,root,root,755)
347 %doc README CHANGELOG RELEASE.NOTES UPGRADING
348 %doc webui/*/*.{cgi,prefs,txt} webui/*/*.txt webui/*/templates/*.html
349 %doc doc/{courier,exim,markov,pop3filter,postfix,qmail,relay,sendmail}.txt
350 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dspam.conf
351 %dir %attr(750,root,mail) /var/lib/%{name}
352 %attr(755,root,root) %config(noreplace) /etc/cron.daily/%{name}
353 %attr(755,root,mail) %{_bindir}/%{name}
354 %attr(755,root,mail) %{_bindir}/%{name}_logrotate
355 %attr(755,root,root) %{_bindir}/%{name}_clean
356 %attr(755,root,root) %{_bindir}/%{name}_corpus
357 %attr(755,root,root) %{_bindir}/%{name}_crc
358 %attr(755,root,root) %{_bindir}/%{name}_dump
359 %attr(755,root,root) %{_bindir}/%{name}_genaliases
360 %attr(755,root,root) %{_bindir}/%{name}_stats
361 %attr(755,root,root) %{_bindir}/%{name}_merge
362 %attr(755,root,root) %{_bindir}/%{name}_2sql
363 %attr(755,root,root) %{_bindir}/%{name}_admin
364 %{_mandir}/man?/%{name}*
367 %attr(754,root,root) /etc/rc.d/init.d/dspam
369 %defattr(644,root,root,755)
370 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dspam.conf
372 %attr(755,root,mail) %{_bindir}/%{name}c
375 %defattr(644,root,root,755)
376 %doc README CHANGELOG
377 %attr(755,root,root) %{_libdir}/lib*.so.*.*.*
378 %attr(755,root,root) %exclude %{_libdir}/lib*_drv*.so*
381 %defattr(644,root,root,755)
382 %attr(755,root,root) %{_libdir}/lib*.so
383 %attr(755,root,root) %exclude %{_libdir}/lib*_drv*.so*
385 %{_includedir}/%{name}
386 %{_mandir}/man3/libdspam*
387 %{_pkgconfigdir}/*.pc
390 %defattr(644,root,root,755)
394 %defattr(644,root,root,755)
395 %attr(755,root,root) %{_bindir}/css*
396 %attr(755,root,root) %{_libdir}/libhash_drv*.so*
400 %defattr(644,root,root,755)
401 %attr(755,root,root) %{_libdir}/libdb4_drv*.so*
406 %defattr(644,root,root,755)
407 %doc doc/mysql_drv.txt src/tools.mysql_drv/*.sql
408 %attr(640,root,mail) %config(noreplace) /var/lib/%{name}/mysql.data
409 %attr(755,root,root) %{_libdir}/libmysql_drv*.so*
414 %defattr(644,root,root,755)
415 %doc doc/pgsql_drv.txt src/tools.pgsql_drv/*.sql
416 %attr(640,root,mail) %config(noreplace) /var/lib/%{name}/pgsql.data
417 %attr(755,root,root) %{_bindir}/%{name}_pg2int8
418 %attr(755,root,root) %{_libdir}/libpgsql_drv*.so*
423 %defattr(644,root,root,755)
424 %doc doc/sqlite_drv.txt
425 %attr(755,root,root) %{_libdir}/libsqlite_drv*.so*