1 # NOTE about versioning:
2 # Stable Releases: 3.4.x, Development Releases: 3.5.x
3 # All odd-versioned minor releases are considered development
4 # releases, and all even-versioned minor releases are stable releases
5 # - from http://www.nuclearelephant.com/projects/dspam/download.shtml
10 # - missing /etc/dspam.conf for cron:
11 # /etc/cron.daily/dspam:
12 # 2430: [6/28/2005 1:2:1] Unable to open file for reading: /etc/dspam.conf: No such file or directory
13 # 2430: [6/28/2005 1:2:1] Unable to read dspam.conf
16 %bcond_without mysql # enable MySQL storage driver (disable sqlite/pgsql driver)
17 %bcond_with pgsql # enable PostgreSQL storage driver (disable sqlite/mysql driver)
18 %bcond_with sqlite # enable SQLite3 storage driver
22 %if %{with mysql} && %{with pgsql}
24 %{warn:disabled pgsql as mysql and pgsql aren't supported together (yet)
28 %if %{with mysql} && %{with sqlite}
30 %{warn:disabled sqlite as mysql and sqlite aren't supported together (yet)
34 %if %{with pgsql} && %{with sqlite}
36 %{warn:disabled sqlite as pgsql and sqlite aren't supported together (yet)
41 %if %{with mysql} || %{with pgsql}
45 Summary: A library and Mail Delivery Agent for Bayesian spam filtering
46 Summary(pl): Biblioteka i MDA do bayesowskiego filtrowania spamu
51 Group: Applications/Mail
52 Source0: http://www.nuclearelephant.com/projects/dspam/sources/%{name}-%{version}.tar.gz
53 # Source0-md5: ef7ceba47e63edb02a59be3c36cf0f6f
55 URL: http://www.nuclearelephant.com/projects/dspam/
56 BuildRequires: autoconf
57 BuildRequires: automake
58 BuildRequires: libtool
59 %{?with_mysql:BuildRequires: mysql-devel}
60 %{?with_pgsql:BuildRequires: postgresql-devel}
61 %{?with_sqlite:BuildRequires: sqlite3-devel}
62 BuildRequires: sed >= 4.0
63 Buildroot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
66 DSPAM (as in De-Spam) is an open-source project to create a new kind
67 of anti-spam mechanism, and is currently effective as both a
68 server-side agent for UNIX email servers and a developer's library for
69 mail clients, other anti-spam tools, and similar projects requiring
70 drop-in spam filtering.
72 The DSPAM agent masquerades as the email server's local delivery agent
73 and filters/learns spams using an advanced Bayesian statistical
74 approach (based on Bayes's theorem of combined probabilities) which
75 provides an administratively maintenance-free, easy-learning Anti-Spam
76 service custom tailored to each individual user's behavior. Advanced
77 because on top of standard Bayesian filtering is also incorporated the
78 use of Chained Tokens, de-obfuscation, and other enhancements. DSPAM
79 works great with Sendmail and Exim, and should work well with any
80 other MTA that supports an external local delivery agent (postfix,
84 DSPAM (czyli De-Spam) to projekt o otwartych ¼ród³ach maj±cy na celu
85 stworzenie nowego rodzaju mechanizmu antyspamowego. Aktualnie jest
86 efektywny zarówno jako dzia³aj±cy po stronie serwera agent dla
87 uniksowych serwerów pocztowych jak i biblioteka dla programistów
88 klientów pocztowych, innych narzêdzi antyspamowych i innych projektów
89 wymagaj±cych filtrowania spamu w locie.
91 Agent DSPAM zachowuje siê jak lokalny agent dostarczania poczty (MDA)
92 i filtruje/uczy siê spamu przy u¿yciu zaawansowanego bayesowskiego
93 przybli¿enia statystycznego (opartego na twierdzeniu Bayesa o
94 po³±czonych prawdopodobieñstwach), daj±c nie wymagaj±c± obs³ugi
95 administracyjnej, ³atwo ucz±c± siê us³ugê antyspamow± dostosowan± do
96 zachowania ka¿dego u¿ytkownika. Metoda jest zaawansowana poniewa¿ na
97 podstawie standardowego filtrowania bayesowskiego wprowadzono u¿ycie
98 tokenów ³añcuchowych, eliminowanie ukrywanie i inne rozszerzenia.
99 DSPAM dzia³a wspaniale z Sendmailem i Eximem, powinien dzia³aæ dobrze
100 z ka¿dym innym MTA obs³uguj±cym zewnêtrznego agenta MDA (postfiksem,
104 Summary: dspam client
105 Summary(pl): Klient dspam
106 Group: Applications/Mail
107 # to get the same dspam.conf when both installed
108 Conflicts: dspam > %{version}-%{release}
109 Conflicts: dspam < %{version}-%{release}
114 %description -l pl client
118 Summary: A library for Bayesian spam filtering
119 Summary(pl): Biblioteka do bayesowskiego filtrowania spamu
123 DSPAM (as in De-Spam) is an open-source project to create a new kind
124 of anti-spam mechanism, and is currently effective as both a
125 server-side agent for UNIX email servers and a developer's library for
126 mail clients, other anti-spam tools, and similar projects requiring
127 drop-in spam filtering.
129 This package contains the library.
131 %description libs -l pl
132 DSPAM (czyli De-Spam) to projekt o otwartych ¼ród³ach maj±cy na celu
133 stworzenie nowego rodzaju mechanizmu antyspamowego. Aktualnie jest
134 efektywny zarówno jako dzia³aj±cy po stronie serwera agent dla
135 uniksowych serwerów pocztowych jak i biblioteka dla programistów
136 klientów pocztowych, innych narzêdzi antyspamowych i innych projektów
137 wymagaj±cych filtrowania spamu w locie.
139 Ten pakiet zawiera wspomnian± bibliotekê.
142 Summary: Header files for the DSPAM library
143 Summary(pl): Pliki nag³ówkowe biblioteki DSPAM
144 Group: Development/Libraries
145 Requires: %{name}-libs = %{version}-%{release}
148 DSPAM has had its core engine moved into a separate library, libdspam.
149 This library can be used by developers to provide 'drop-in' spam
150 filtering for their mail client applications, other anti-spam tools,
153 %description devel -l pl
154 G³ówny silnik DSPAM zosta³ przeniesiony do oddzielnej biblioteki
155 libdspam, która mo¿e byæ u¿ywana przez programistów do zapewnienia
156 filtrowania spamu w locie dla aplikacji klientów pocztowych, innych
157 narzêdzi antyspamowych i podobnych projektów.
160 Summary: Static DSPAM library
161 Summary(pl): Statyczna biblioteka DSPAM
162 Group: Development/Libraries
163 Requires: %{name}-devel = %{version}-%{release}
166 Static DSPAM library.
168 %description static -l pl
169 Statyczna biblioteka DSPAM.
173 sed -i -e 's#\-static##g' src/Makefile* src/*/Makefile*
181 %{?with_verbose: --enable-debug --enable-verbose-debug} \
182 --enable-trusted-user-security \
183 --enable-bayesian-dobly \
184 --enable-chained-tokens \
185 --enable-experimental \
187 --enable-large-scale \
188 --enable-delivery-to-stdout \
189 --with-userdir=/var/lib/%{name} \
190 --with-dspam-home=/var/lib/%{name} \
191 --with-userdir-owner=none \
192 --with-userdir-group=none \
193 --with-dspam-owner=none \
194 --with-dspam-group=none \
195 --with-signature-life=14 \
196 --disable-dependency-tracking \
199 --enable-virtual-users \
200 --with-storage-driver=mysql_drv \
201 --with-mysql-includes=%{_includedir}/mysql \
202 --with-mysql-libraries=%{_libdir}
206 --enable-virtual-users \
207 --with-storage-driver=pgsql_drv \
208 --with-pgsql-includes=%{_includedir}/postgresql \
209 --with-pgsql-libraries=%{_libdir}
212 --with-storage-driver=sqlite3_drv \
213 --with-sqlite3-includes=%{_includedir} \
214 --with-sqlite3-libraries=%{_libdir}
219 rm -rf $RPM_BUILD_ROOT
222 DESTDIR=$RPM_BUILD_ROOT
224 install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig}
225 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/dspam
227 # install devel files
228 install -d $RPM_BUILD_ROOT{%{_includedir}/%{name},/var/lib/%{name}}
229 install src/*.h $RPM_BUILD_ROOT%{_includedir}/%{name}
231 # provide maintenance scripts
232 install -d $RPM_BUILD_ROOT/etc/cron.daily
233 install -d $RPM_BUILD_ROOT/etc/cron.weekly
235 cat > $RPM_BUILD_ROOT/etc/cron.daily/%{name} <<EOF
237 exec %{_bindir}/%{name}_clean -s -p
240 chmod 755 $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily/%{name}
243 sed -i -e "s|%{_prefix}/local|%{_prefix}|g" $RPM_BUILD_ROOT%{_bindir}/%{name}_corpus
244 sed -i -e "s|%{_prefix}/local|%{_prefix}|g" cgi/dspam.cgi
247 #install dspam-cron.weekly $RPM_BUILD_ROOT%{_sysconfdir}/cron.weekly/%{name}
251 install -d $RPM_BUILD_ROOT/var/lib/%{name}
252 cat > $RPM_BUILD_ROOT/var/lib/%{name}/mysql.data <<EOF
257 This file can only contain 5 lines with the following values:
269 install -d $RPM_BUILD_ROOT/var/lib/%{name}
270 cat > $RPM_BUILD_ROOT/var/lib/%{name}/pgsql.data <<EOF
275 This file can only contain 5 lines with the following values:
286 /sbin/chkconfig --add dspam
287 if [ -f /var/lock/subsys/dspam ]; then
288 /etc/rc.d/init.d/dspam restart 1>&2
290 echo "Run \"/etc/rc.d/init.d/dspam start\" to start dspam daemon."
294 if [ "$1" = "0" ]; then
295 if [ -f /var/lock/subsys/dspam ]; then
296 /etc/rc.d/init.d/dspam stop 1>&2
298 /sbin/chkconfig --del dspam
302 rm -rf $RPM_BUILD_ROOT
304 %post libs -p /sbin/ldconfig
305 %postun libs -p /sbin/ldconfig
308 %defattr(644,root,root,755)
309 %doc README CHANGELOG RELEASE.NOTES UPGRADING
310 %doc cgi/base.css cgi/dspam.cgi
312 %doc doc/mysql_drv.txt
313 %doc src/tools.mysql_drv/*.sql
316 %doc doc/pgsql_drv.txt
317 %doc src/tools.pgsql_drv/*.sql
319 %if %{without mysql} && %{without pgsql}
320 %doc doc/sqlite_drv.txt
322 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dspam.conf
323 %dir %attr(750,root,mail) /var/lib/%{name}
324 %{?with_mysql:%attr(640,root,mail) %config(noreplace) /var/lib/%{name}/mysql.data}
325 %{?with_pgsql:%attr(640,root,mail) %config(noreplace) /var/lib/%{name}/pgsql.data}
326 %attr(755,root,root) %config(noreplace) /etc/cron.daily/%{name}
327 %attr(755,root,mail) %{_bindir}/%{name}
328 %attr(755,root,mail) %{_bindir}/%{name}_logrotate
329 %attr(755,root,root) %{_bindir}/%{name}_clean
330 %attr(755,root,root) %{_bindir}/%{name}_corpus
331 %attr(755,root,root) %{_bindir}/%{name}_crc
332 %attr(755,root,root) %{_bindir}/%{name}_dump
333 %attr(755,root,root) %{_bindir}/%{name}_genaliases
334 %attr(755,root,root) %{_bindir}/%{name}_stats
335 %attr(755,root,root) %{_bindir}/%{name}_merge
336 %attr(755,root,root) %{_bindir}/%{name}_2sql
337 %attr(755,root,root) %{_bindir}/%{name}_admin
338 %{?with_pgsql:%attr(755,root,root) %{_bindir}/%{name}_pg2int8}
339 %{_mandir}/man?/%{name}*
342 %attr(754,root,root) /etc/rc.d/init.d/dspam
344 %defattr(644,root,root,755)
345 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dspam.conf
347 %attr(755,root,mail) %{_bindir}/%{name}c
350 %defattr(644,root,root,755)
351 %doc README CHANGELOG
352 %attr(755,root,root) %{_libdir}/lib*.so.*.*.*
355 %defattr(644,root,root,755)
356 %attr(755,root,root) %{_libdir}/lib*.so
358 %{_includedir}/%{name}
359 %{_mandir}/man3/libdspam*
360 %{_pkgconfigdir}/*.pc
363 %defattr(644,root,root,755)