4 %bcond_with mysql # enable MySQL storage driver (disable sqlite driver)
5 %bcond_with pgsql # enable PostgreSQL storage driver (disable sqlite driver)
6 %bcond_with sqlite2 # enable SQLite2 storage driver (disable sqlite3 driver)
8 Summary: A library and Mail Delivery Agent for Bayesian spam filtering
9 Summary(pl): Biblioteka i MDA do bayesowskiego filtrowania spamu
14 Group: Applications/Mail
15 Source0: http://www.nuclearelephant.com/projects/dspam/sources/%{name}-%{version}.tar.gz
16 # Source0-md5: b6930c31fe0940b8ad6d27324f8bab3e
17 URL: http://www.nuclearelephant.com/projects/dspam/
19 BuildRequires: mysql-devel
22 BuildRequires: postgresql-devel
25 BuildRequires: sqlite-devel
26 BuildRequires: sqlite-static
28 BuildRequires: sqlite3-devel
29 BuildRequires: sqlite3-static
33 BuildRequires: sed >= 4.0
34 Buildroot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37 DSPAM (as in De-Spam) is an open-source project to create a new kind
38 of anti-spam mechanism, and is currently effective as both a
39 server-side agent for UNIX email servers and a developer's library for
40 mail clients, other anti-spam tools, and similar projects requiring
41 drop-in spam filtering.
43 The DSPAM agent masquerades as the email server's local delivery agent
44 and filters/learns spams using an advanced Bayesian statistical
45 approach (based on Bayes's theorem of combined probabilities) which
46 provides an administratively maintenance-free, easy-learning Anti-Spam
47 service custom tailored to each individual user's behavior. Advanced
48 because on top of standard Bayesian filtering is also incorporated the
49 use of Chained Tokens, de-obfuscation, and other enhancements. DSPAM
50 works great with Sendmail and Exim, and should work well with any
51 other MTA that supports an external local delivery agent (postfix,
55 DSPAM (czyli De-Spam) to projekt o otwartych ¼ród³ach maj±cy na celu
56 stworzenie nowego rodzaju mechanizmu antyspamowego. Aktualnie jest
57 efektywny zarówno jako dzia³aj±cy po stronie serwera agent dla
58 uniksowych serwerów pocztowych jak i biblioteka dla programistów
59 klientów pocztowych, innych narzêdzi antyspamowych i innych projektów
60 wymagaj±cych filtrowania spamu w locie.
62 Agent DSPAM zachowuje siê jak lokalny agent dostarczania poczty (MDA)
63 i filtruje/uczy siê spamu przy u¿yciu zaawansowanego bayesowskiego
64 przybli¿enia statystycznego (opartego na twierdzeniu Bayesa o
65 po³±czonych prawdopodobieñstwach), daj±c nie wymagaj±c± obs³ugi
66 administracyjnej, ³atwo ucz±c± siê us³ugê antyspamow± dostosowan± do
67 zachowania ka¿dego u¿ytkownika. Metoda jest zaawansowana poniewa¿ na
68 podstawie standardowego filtrowania bayesowskiego wprowadzono u¿ycie
69 tokenów ³añcuchowych, eliminowanie ukrywanie i inne rozszerzenia.
70 DSPAM dzia³a wspaniale z Sendmailem i Eximem, powinien dzia³aæ dobrze
71 z ka¿dym innym MTA obs³uguj±cym zewnêtrznego agenta MDA (postfiksem,
75 Summary: A library for Bayesian spam filtering
76 Summary(pl): Biblioteka do bayesowskiego filtrowania spamu
80 DSPAM (as in De-Spam) is an open-source project to create a new kind
81 of anti-spam mechanism, and is currently effective as both a
82 server-side agent for UNIX email servers and a developer's library for
83 mail clients, other anti-spam tools, and similar projects requiring
84 drop-in spam filtering.
86 This package contains the library.
88 %description libs -l pl
89 DSPAM (czyli De-Spam) to projekt o otwartych ¼ród³ach maj±cy na celu
90 stworzenie nowego rodzaju mechanizmu antyspamowego. Aktualnie jest
91 efektywny zarówno jako dzia³aj±cy po stronie serwera agent dla
92 uniksowych serwerów pocztowych jak i biblioteka dla programistów
93 klientów pocztowych, innych narzêdzi antyspamowych i innych projektów
94 wymagaj±cych filtrowania spamu w locie.
96 Ten pakiet zawiera wspomnian± bibliotekê.
99 Summary: Header files for the DSPAM library
100 Summary(pl): Pliki nag³ówkowe biblioteki DSPAM
101 Group: Development/Libraries
102 Requires: %{name}-libs = %{version}-%{release}
105 DSPAM has had its core engine moved into a separate library, libdspam.
106 This library can be used by developers to provide 'drop-in' spam
107 filtering for their mail client applications, other anti-spam tools,
110 %description devel -l pl
111 G³ówny silnik DSPAM zosta³ przeniesiony do oddzielnej biblioteki
112 libdspam, która mo¿e byæ u¿ywana przez programistów do zapewnienia
113 filtrowania spamu w locie dla aplikacji klientów pocztowych, innych
114 narzêdzi antyspamowych i podobnych projektów.
117 Summary: Static DSPAM library
118 Summary(pl): Statyczna biblioteka DSPAM
119 Group: Development/Libraries
120 Requires: %{name}-devel = %{version}-%{release}
123 Static DSPAM library.
125 %description static -l pl
126 Statyczna biblioteka DSPAM.
130 sed -i -e 's#-static##g' src/tools/Makefile*
134 --enable-trusted-user-security \
135 --enable-bayesian-dobly \
136 --enable-chained-tokens \
137 --enable-experimental \
139 --enable-large-scale \
140 --enable-delivery-to-stdout \
141 --with-userdir=/var/lib/%{name} \
142 --with-dspam-home=/var/lib/%{name} \
143 --with-userdir-owner=none \
144 --with-userdir-group=none \
145 --with-dspam-owner=none \
146 --with-dspam-group=none \
147 --with-signature-life=14 \
148 --disable-dependency-tracking \
150 --enable-virtual-users \
151 --with-storage-driver=mysql_drv \
152 --with-mysql-includes=%{_includedir}/mysql \
153 --with-mysql-libraries=%{_libdir}
156 --enable-virtual-users \
157 --with-storage-driver=pgsql_drv \
158 --with-pgsql-includes=%{_includedir}/postgresql \
159 --with-pgsql-libraries=%{_libdir}
162 --with-storage-driver=sqlite_drv \
163 --with-sqlite-includes=%{_includedir} \
164 --with-sqlite-libraries=%{_libdir}
166 --with-storage-driver=sqlite3_drv \
167 --with-sqlite3-includes=%{_includedir} \
168 --with-sqlite3-libraries=%{_libdir}
175 rm -rf $RPM_BUILD_ROOT
178 DESTDIR=$RPM_BUILD_ROOT
180 # install devel files
181 install -d $RPM_BUILD_ROOT{%{_includedir}/%{name},/var/lib/%{name}}
182 install src/*.h $RPM_BUILD_ROOT%{_includedir}/%{name}
184 # provide maintenance scripts
185 install -d $RPM_BUILD_ROOT/etc/cron.daily
186 install -d $RPM_BUILD_ROOT/etc/cron.weekly
188 cat > $RPM_BUILD_ROOT/etc/cron.daily/%{name} <<EOF
190 exec %{_bindir}/%{name}_clean -s -p
193 chmod 755 $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily/%{name}
196 sed -i -e "s|%{_prefix}/local|%{_prefix}|g" $RPM_BUILD_ROOT%{_bindir}/%{name}_corpus
197 sed -i -e "s|%{_prefix}/local|%{_prefix}|g" cgi/dspam.cgi
200 #install dspam-cron.weekly $RPM_BUILD_ROOT%{_sysconfdir}/cron.weekly/%{name}
204 install -d $RPM_BUILD_ROOT/var/lib/%{name}
205 cat > $RPM_BUILD_ROOT/var/lib/%{name}/mysql.data <<EOF
210 This file can only contain 5 lines with the following values:
222 install -d $RPM_BUILD_ROOT/var/lib/%{name}
223 cat > $RPM_BUILD_ROOT/var/lib/%{name}/pgsql.data <<EOF
228 This file can only contain 5 lines with the following values:
239 rm -rf $RPM_BUILD_ROOT
241 %post libs -p /sbin/ldconfig
242 %postun libs -p /sbin/ldconfig
245 %defattr(644,root,root,755)
246 %doc README CHANGELOG RELEASE.NOTES UPGRADING
247 %doc cgi/base.css cgi/dspam.cgi
249 %doc doc/mysql_drv.txt
250 %doc src/tools.mysql_drv/*.sql
253 %doc doc/pgsql_drv.txt
254 %doc src/tools.pgsql_drv/*.sql
256 %if %{!with mysql} && %{!with pgsql}
257 %doc doc/sqlite_drv.txt
259 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dspam.conf
260 %dir %attr(750,root,mail) /var/lib/%{name}
261 %{?with_mysql:%attr(640,root,mail) %config(noreplace) /var/lib/%{name}/mysql.data}
262 %{?with_pgsql:%attr(640,root,mail) %config(noreplace) /var/lib/%{name}/pgsql.data}
263 %attr(755,root,root) %config(noreplace) /etc/cron.daily/%{name}
264 %attr(755,root,mail) %{_bindir}/%{name}
265 %attr(755,root,mail) %{_bindir}/%{name}c
266 %attr(755,root,mail) %{_bindir}/%{name}_logrotate
267 %attr(755,root,root) %{_bindir}/%{name}_clean
268 %attr(755,root,root) %{_bindir}/%{name}_corpus
269 %attr(755,root,root) %{_bindir}/%{name}_crc
270 %attr(755,root,root) %{_bindir}/%{name}_dump
271 %attr(755,root,root) %{_bindir}/%{name}_genaliases
272 %attr(755,root,root) %{_bindir}/%{name}_stats
273 %attr(755,root,root) %{_bindir}/%{name}_merge
274 %attr(755,root,root) %{_bindir}/%{name}_2sql
275 %attr(755,root,root) %{_bindir}/%{name}_admin
276 %{?with_pgsql:%attr(755,root,root) %{_bindir}/%{name}_pg2int8}
277 %{_mandir}/man?/%{name}*
280 %defattr(644,root,root,755)
281 %doc README CHANGELOG
282 %attr(755,root,root) %{_libdir}/lib*.so.*.*.*
285 %defattr(644,root,root,755)
286 %attr(755,root,root) %{_libdir}/lib*.so
288 %{_includedir}/%{name}
289 %{_mandir}/man3/libdspam*
290 %{_pkgconfigdir}/*.pc
293 %defattr(644,root,root,755)