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
21 %if %{with mysql} && %{with pgsql}
23 %{warn:disabled mysql as mysql and pgsql aren't supported together (yet)
27 %if %{with mysql} && %{with sqlite}
29 %{warn:disabled mysql as mysql and sqlite aren't supported together (yet)
33 %if %{with pgsql} && %{with sqlite}
35 %{warn:disabled sqlite as pgsql and sqlite aren't supported together (yet)
40 %if %{with mysql} || %{with pgsql}
44 Summary: A library and Mail Delivery Agent for Bayesian spam filtering
45 Summary(pl): Biblioteka i MDA do bayesowskiego filtrowania spamu
50 Group: Applications/Mail
51 Source0: http://www.nuclearelephant.com/projects/dspam/sources/%{name}-%{version}.tar.gz
52 # Source0-md5: ef7ceba47e63edb02a59be3c36cf0f6f
54 URL: http://www.nuclearelephant.com/projects/dspam/
55 BuildRequires: autoconf
56 BuildRequires: automake
57 BuildRequires: libtool
58 %{?with_mysql:BuildRequires: mysql-devel}
59 %{?with_pgsql:BuildRequires: postgresql-devel}
60 %{?with_sqlite:BuildRequires: sqlite3-devel}
61 BuildRequires: sed >= 4.0
62 Buildroot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
65 DSPAM (as in De-Spam) is an open-source project to create a new kind
66 of anti-spam mechanism, and is currently effective as both a
67 server-side agent for UNIX email servers and a developer's library for
68 mail clients, other anti-spam tools, and similar projects requiring
69 drop-in spam filtering.
71 The DSPAM agent masquerades as the email server's local delivery agent
72 and filters/learns spams using an advanced Bayesian statistical
73 approach (based on Bayes's theorem of combined probabilities) which
74 provides an administratively maintenance-free, easy-learning Anti-Spam
75 service custom tailored to each individual user's behavior. Advanced
76 because on top of standard Bayesian filtering is also incorporated the
77 use of Chained Tokens, de-obfuscation, and other enhancements. DSPAM
78 works great with Sendmail and Exim, and should work well with any
79 other MTA that supports an external local delivery agent (postfix,
83 DSPAM (czyli De-Spam) to projekt o otwartych ¼ród³ach maj±cy na celu
84 stworzenie nowego rodzaju mechanizmu antyspamowego. Aktualnie jest
85 efektywny zarówno jako dzia³aj±cy po stronie serwera agent dla
86 uniksowych serwerów pocztowych jak i biblioteka dla programistów
87 klientów pocztowych, innych narzêdzi antyspamowych i innych projektów
88 wymagaj±cych filtrowania spamu w locie.
90 Agent DSPAM zachowuje siê jak lokalny agent dostarczania poczty (MDA)
91 i filtruje/uczy siê spamu przy u¿yciu zaawansowanego bayesowskiego
92 przybli¿enia statystycznego (opartego na twierdzeniu Bayesa o
93 po³±czonych prawdopodobieñstwach), daj±c nie wymagaj±c± obs³ugi
94 administracyjnej, ³atwo ucz±c± siê us³ugê antyspamow± dostosowan± do
95 zachowania ka¿dego u¿ytkownika. Metoda jest zaawansowana poniewa¿ na
96 podstawie standardowego filtrowania bayesowskiego wprowadzono u¿ycie
97 tokenów ³añcuchowych, eliminowanie ukrywanie i inne rozszerzenia.
98 DSPAM dzia³a wspaniale z Sendmailem i Eximem, powinien dzia³aæ dobrze
99 z ka¿dym innym MTA obs³uguj±cym zewnêtrznego agenta MDA (postfiksem,
103 Summary: dspam client
104 Summary(pl): Klient dspam
105 Group: Applications/Mail
106 # to get the same dspam.conf when both installed
107 Conflicts: dspam > %{version}-%{release}
108 Conflicts: dspam < %{version}-%{release}
113 %description -l pl client
117 Summary: A library for Bayesian spam filtering
118 Summary(pl): Biblioteka do bayesowskiego filtrowania spamu
122 DSPAM (as in De-Spam) is an open-source project to create a new kind
123 of anti-spam mechanism, and is currently effective as both a
124 server-side agent for UNIX email servers and a developer's library for
125 mail clients, other anti-spam tools, and similar projects requiring
126 drop-in spam filtering.
128 This package contains the library.
130 %description libs -l pl
131 DSPAM (czyli De-Spam) to projekt o otwartych ¼ród³ach maj±cy na celu
132 stworzenie nowego rodzaju mechanizmu antyspamowego. Aktualnie jest
133 efektywny zarówno jako dzia³aj±cy po stronie serwera agent dla
134 uniksowych serwerów pocztowych jak i biblioteka dla programistów
135 klientów pocztowych, innych narzêdzi antyspamowych i innych projektów
136 wymagaj±cych filtrowania spamu w locie.
138 Ten pakiet zawiera wspomnian± bibliotekê.
141 Summary: Header files for the DSPAM library
142 Summary(pl): Pliki nag³ówkowe biblioteki DSPAM
143 Group: Development/Libraries
144 Requires: %{name}-libs = %{version}-%{release}
147 DSPAM has had its core engine moved into a separate library, libdspam.
148 This library can be used by developers to provide 'drop-in' spam
149 filtering for their mail client applications, other anti-spam tools,
152 %description devel -l pl
153 G³ówny silnik DSPAM zosta³ przeniesiony do oddzielnej biblioteki
154 libdspam, która mo¿e byæ u¿ywana przez programistów do zapewnienia
155 filtrowania spamu w locie dla aplikacji klientów pocztowych, innych
156 narzêdzi antyspamowych i podobnych projektów.
159 Summary: Static DSPAM library
160 Summary(pl): Statyczna biblioteka DSPAM
161 Group: Development/Libraries
162 Requires: %{name}-devel = %{version}-%{release}
165 Static DSPAM library.
167 %description static -l pl
168 Statyczna biblioteka DSPAM.
172 sed -i -e 's#\-static##g' src/Makefile* src/*/Makefile*
180 %{?debug: --enable-debug --enable-bnr-debug --enable-verbose-debug} \
181 --enable-trusted-user-security \
182 --enable-chi-square \
184 --enable-large-scale \
185 --with-userdir=/var/lib/%{name} \
186 --with-dspam-home=/var/lib/%{name} \
187 --with-userdir-owner=none \
188 --with-userdir-group=none \
189 --with-dspam-owner=none \
190 --with-dspam-group=none \
191 --with-signature-life=14 \
192 --disable-dependency-tracking \
194 --enable-neural-networking \
196 --enable-virtual-users \
197 --with-storage-driver=mysql_drv \
198 --with-mysql-includes=%{_includedir}/mysql \
199 --with-mysql-libraries=%{_libdir}
202 --enable-neural-networking \
204 --enable-virtual-users \
205 --with-storage-driver=pgsql_drv \
206 --with-pgsql-includes=%{_includedir}/postgresql \
207 --with-pgsql-libraries=%{_libdir}
210 --with-storage-driver=sqlite3_drv \
211 --with-sqlite3-includes=%{_includedir} \
212 --with-sqlite3-libraries=%{_libdir}
217 rm -rf $RPM_BUILD_ROOT
220 DESTDIR=$RPM_BUILD_ROOT
222 install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig}
223 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/dspam
225 # install devel files
226 install -d $RPM_BUILD_ROOT{%{_includedir}/%{name},/var/lib/%{name}}
227 install src/*.h $RPM_BUILD_ROOT%{_includedir}/%{name}
229 # provide maintenance scripts
230 install -d $RPM_BUILD_ROOT/etc/cron.daily
231 install -d $RPM_BUILD_ROOT/etc/cron.weekly
233 cat > $RPM_BUILD_ROOT/etc/cron.daily/%{name} <<EOF
235 exec %{_bindir}/%{name}_clean -s -p
238 chmod 755 $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily/%{name}
241 sed -i -e "s|%{_prefix}/local|%{_prefix}|g" $RPM_BUILD_ROOT%{_bindir}/%{name}_corpus
242 sed -i -e "s|%{_prefix}/local|%{_prefix}|g" cgi/dspam.cgi
245 #install dspam-cron.weekly $RPM_BUILD_ROOT%{_sysconfdir}/cron.weekly/%{name}
249 install -d $RPM_BUILD_ROOT/var/lib/%{name}
250 cat > $RPM_BUILD_ROOT/var/lib/%{name}/mysql.data <<EOF
255 This file can only contain 5 lines with the following values:
267 install -d $RPM_BUILD_ROOT/var/lib/%{name}
268 cat > $RPM_BUILD_ROOT/var/lib/%{name}/pgsql.data <<EOF
273 This file can only contain 5 lines with the following values:
284 /sbin/chkconfig --add dspam
285 if [ -f /var/lock/subsys/dspam ]; then
286 /etc/rc.d/init.d/dspam restart 1>&2
288 echo "Run \"/etc/rc.d/init.d/dspam start\" to start dspam daemon."
292 if [ "$1" = "0" ]; then
293 if [ -f /var/lock/subsys/dspam ]; then
294 /etc/rc.d/init.d/dspam stop 1>&2
296 /sbin/chkconfig --del dspam
300 rm -rf $RPM_BUILD_ROOT
302 %post libs -p /sbin/ldconfig
303 %postun libs -p /sbin/ldconfig
306 %defattr(644,root,root,755)
307 %doc README CHANGELOG RELEASE.NOTES UPGRADING
308 %doc cgi/base.css cgi/dspam.cgi
310 %doc doc/mysql_drv.txt
311 %doc src/tools.mysql_drv/*.sql
314 %doc doc/pgsql_drv.txt
315 %doc src/tools.pgsql_drv/*.sql
317 %if %{without mysql} && %{without pgsql}
318 %doc doc/sqlite_drv.txt
320 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dspam.conf
321 %dir %attr(750,root,mail) /var/lib/%{name}
322 %{?with_mysql:%attr(640,root,mail) %config(noreplace) /var/lib/%{name}/mysql.data}
323 %{?with_pgsql:%attr(640,root,mail) %config(noreplace) /var/lib/%{name}/pgsql.data}
324 %attr(755,root,root) %config(noreplace) /etc/cron.daily/%{name}
325 %attr(755,root,mail) %{_bindir}/%{name}
326 %attr(755,root,mail) %{_bindir}/%{name}_logrotate
327 %attr(755,root,root) %{_bindir}/%{name}_clean
328 %attr(755,root,root) %{_bindir}/%{name}_corpus
329 %attr(755,root,root) %{_bindir}/%{name}_crc
330 %attr(755,root,root) %{_bindir}/%{name}_dump
331 %attr(755,root,root) %{_bindir}/%{name}_genaliases
332 %attr(755,root,root) %{_bindir}/%{name}_stats
333 %attr(755,root,root) %{_bindir}/%{name}_merge
334 %attr(755,root,root) %{_bindir}/%{name}_2sql
335 %attr(755,root,root) %{_bindir}/%{name}_admin
336 %{?with_pgsql:%attr(755,root,root) %{_bindir}/%{name}_pg2int8}
337 %{_mandir}/man?/%{name}*
340 %attr(754,root,root) /etc/rc.d/init.d/dspam
342 %defattr(644,root,root,755)
343 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dspam.conf
345 %attr(755,root,mail) %{_bindir}/%{name}c
348 %defattr(644,root,root,755)
349 %doc README CHANGELOG
350 %attr(755,root,root) %{_libdir}/lib*.so.*.*.*
353 %defattr(644,root,root,755)
354 %attr(755,root,root) %{_libdir}/lib*.so
356 %{_includedir}/%{name}
357 %{_mandir}/man3/libdspam*
358 %{_pkgconfigdir}/*.pc
361 %defattr(644,root,root,755)