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 sqlite3 # enable SQLite3 storage driver (disable sqlite2 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: befcaee35a69efe559471367b2249ea3
17 URL: http://www.nuclearelephant.com/projects/dspam/
19 BuildRequires: mysql-devel
22 BuildRequires: postgresql-devel
25 BuildRequires: sqlite3-devel
27 BuildRequires: sqlite-devel
28 BuildRequires: sqlite-static
32 BuildRequires: sed >= 4.0
33 Buildroot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36 DSPAM (as in De-Spam) is an open-source project to create a new kind
37 of anti-spam mechanism, and is currently effective as both a
38 server-side agent for UNIX email servers and a developer's library for
39 mail clients, other anti-spam tools, and similar projects requiring
40 drop-in spam filtering.
42 The DSPAM agent masquerades as the email server's local delivery agent
43 and filters/learns spams using an advanced Bayesian statistical
44 approach (based on Bayes's theorem of combined probabilities) which
45 provides an administratively maintenance-free, easy-learning Anti-Spam
46 service custom tailored to each individual user's behavior. Advanced
47 because on top of standard Bayesian filtering is also incorporated the
48 use of Chained Tokens, de-obfuscation, and other enhancements. DSPAM
49 works great with Sendmail and Exim, and should work well with any
50 other MTA that supports an external local delivery agent (postfix,
54 DSPAM (czyli De-Spam) to projekt o otwartych ¼ród³ach maj±cy na celu
55 stworzenie nowego rodzaju mechanizmu antyspamowego. Aktualnie jest
56 efektywny zarówno jako dzia³aj±cy po stronie serwera agent dla
57 uniksowych serwerów pocztowych jak i biblioteka dla programistów
58 klientów pocztowych, innych narzêdzi antyspamowych i innych projektów
59 wymagaj±cych filtrowania spamu w locie.
61 Agent DSPAM zachowuje siê jak lokalny agent dostarczania poczty (MDA)
62 i filtruje/uczy siê spamu przy u¿yciu zaawansowanego bayesowskiego
63 przybli¿enia statystycznego (opartego na twierdzeniu Bayesa o
64 po³±czonych prawdopodobieñstwach), daj±c nie wymagaj±c± obs³ugi
65 administracyjnej, ³atwo ucz±c± siê us³ugê antyspamow± dostosowan± do
66 zachowania ka¿dego u¿ytkownika. Metoda jest zaawansowana poniewa¿ na
67 podstawie standardowego filtrowania bayesowskiego wprowadzono u¿ycie
68 tokenów ³añcuchowych, eliminowanie ukrywanie i inne rozszerzenia.
69 DSPAM dzia³a wspaniale z Sendmailem i Eximem, powinien dzia³aæ dobrze
70 z ka¿dym innym MTA obs³uguj±cym zewnêtrznego agenta MDA (postfiksem,
74 Summary: A library for Bayesian spam filtering
75 Summary(pl): Biblioteka do bayesowskiego filtrowania spamu
79 DSPAM (as in De-Spam) is an open-source project to create a new kind
80 of anti-spam mechanism, and is currently effective as both a
81 server-side agent for UNIX email servers and a developer's library for
82 mail clients, other anti-spam tools, and similar projects requiring
83 drop-in spam filtering.
85 This package contains the library.
87 %description libs -l pl
88 DSPAM (czyli De-Spam) to projekt o otwartych ¼ród³ach maj±cy na celu
89 stworzenie nowego rodzaju mechanizmu antyspamowego. Aktualnie jest
90 efektywny zarówno jako dzia³aj±cy po stronie serwera agent dla
91 uniksowych serwerów pocztowych jak i biblioteka dla programistów
92 klientów pocztowych, innych narzêdzi antyspamowych i innych projektów
93 wymagaj±cych filtrowania spamu w locie.
95 Ten pakiet zawiera wspomnian± bibliotekê.
98 Summary: Header files for the DSPAM library
99 Summary(pl): Pliki nag³ówkowe biblioteki DSPAM
100 Group: Development/Libraries
101 Requires: %{name}-libs = %{version}-%{release}
104 DSPAM has had its core engine moved into a separate library, libdspam.
105 This library can be used by developers to provide 'drop-in' spam
106 filtering for their mail client applications, other anti-spam tools,
109 %description devel -l pl
110 G³ówny silnik DSPAM zosta³ przeniesiony do oddzielnej biblioteki
111 libdspam, która mo¿e byæ u¿ywana przez programistów do zapewnienia
112 filtrowania spamu w locie dla aplikacji klientów pocztowych, innych
113 narzêdzi antyspamowych i podobnych projektów.
116 Summary: Static DSPAM library
117 Summary(pl): Statyczna biblioteka DSPAM
118 Group: Development/Libraries
119 Requires: %{name}-devel = %{version}-%{release}
122 Static DSPAM library.
124 %description static -l pl
125 Statyczna biblioteka DSPAM.
129 sed -i -e 's#-static##g' src/tools/Makefile*
133 --enable-trusted-user-security \
134 --enable-bayesian-dobly \
135 --enable-chained-tokens \
136 --enable-experimental \
138 --enable-large-scale \
139 --enable-delivery-to-stdout \
140 --with-userdir=/var/lib/%{name} \
141 --with-dspam-home=/var/lib/%{name} \
142 --with-userdir-owner=none \
143 --with-userdir-group=none \
144 --with-dspam-owner=none \
145 --with-dspam-group=none \
146 --with-signature-life=14 \
147 --disable-dependency-tracking \
149 --enable-virtual-users \
150 --with-storage-driver=mysql_drv \
151 --with-mysql-includes=%{_includedir}/mysql \
152 --with-mysql-libraries=%{_libdir}
155 --enable-virtual-users \
156 --with-storage-driver=pgsql_drv \
157 --with-pgsql-includes=%{_includedir}/postgresql \
158 --with-pgsql-libraries=%{_libdir}
161 --with-storage-driver=sqlite3_drv \
162 --with-sqlite3-includes=%{_includedir} \
163 --with-sqlite3-libraries=%{_libdir}
165 --with-storage-driver=sqlite_drv \
166 --with-sqlite-includes=%{_includedir} \
167 --with-sqlite-libraries=%{_libdir}
174 rm -rf $RPM_BUILD_ROOT
177 DESTDIR=$RPM_BUILD_ROOT
179 # install devel files
180 install -d $RPM_BUILD_ROOT{%{_includedir}/%{name},/var/lib/%{name}}
181 install -m0644 src/*.h $RPM_BUILD_ROOT%{_includedir}/%{name}
183 # provide maintenance scripts
184 install -d $RPM_BUILD_ROOT/etc/cron.daily
185 install -d $RPM_BUILD_ROOT/etc/cron.weekly
187 cat > $RPM_BUILD_ROOT/etc/cron.daily/%{name} <<EOF
189 exec %{_bindir}/%{name}_clean -s -p
192 chmod 755 $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily/%{name}
195 sed -i -e "s|%{_prefix}/local|%{_prefix}|g" $RPM_BUILD_ROOT%{_bindir}/%{name}_corpus
196 sed -i -e "s|%{_prefix}/local|%{_prefix}|g" cgi/dspam.cgi
199 #install -m0755 dspam-cron.weekly $RPM_BUILD_ROOT%{_sysconfdir}/cron.weekly/%{name}
202 cp tools.mysql_drv/README README.mysql
205 install -d $RPM_BUILD_ROOT/var/lib/%{name}
206 cat > $RPM_BUILD_ROOT/var/lib/%{name}/mysql.data <<EOF
211 This file can only contain 5 lines with the following values:
222 cp tools.pgsql_drv/README README.pgsql
225 install -d $RPM_BUILD_ROOT/var/lib/%{name}
226 cat > $RPM_BUILD_ROOT/var/lib/%{name}/pgsql.data <<EOF
231 This file can only contain 5 lines with the following values:
242 rm -rf $RPM_BUILD_ROOT
244 %post libs -p /sbin/ldconfig
245 %postun libs -p /sbin/ldconfig
248 %defattr(644,root,root,755)
249 %doc README CHANGELOG RELEASE.NOTES UPGRADING
250 %doc cgi/base.css cgi/dspam.cgi
251 %config %{_sysconfdir}/dspam.conf
254 %doc tools.mysql_drv/mysql_objects-space.sql
255 %doc tools.mysql_drv/mysql_objects-speed.sql
256 %doc tools.mysql_drv/purge.sql
257 %doc tools.mysql_drv/virtual_users.sql
261 %doc tools.pgsql_drv/virtual_users.sql
262 %doc tools.pgsql_drv/pgsql_objects.sql
263 %doc tools.pgsql_drv/purge.sql
265 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dspam.conf
266 %dir %attr(750,root,mail) /var/lib/%{name}
267 %{?with_mysql:%attr(640,root,mail) %config(noreplace) /var/lib/%{name}/mysql.data}
268 %{?with_pgsql:%attr(640,root,mail) %config(noreplace) /var/lib/%{name}/pgsql.data}
269 %attr(755,root,root) %config(noreplace) /etc/cron.daily/%{name}
270 %attr(755,root,mail) %{_bindir}/%{name}
271 %attr(755,root,mail) %{_bindir}/%{name}c
272 %attr(755,root,mail) %{_bindir}/%{name}_logrotate
273 %attr(755,root,root) %{_bindir}/%{name}_admin
274 %attr(755,root,root) %{_bindir}/%{name}_clean
275 %attr(755,root,root) %{_bindir}/%{name}_corpus
276 %attr(755,root,root) %{_bindir}/%{name}_crc
277 %attr(755,root,root) %{_bindir}/%{name}_dump
278 %attr(755,root,root) %{_bindir}/%{name}_genaliases
279 %attr(755,root,root) %{_bindir}/%{name}_stats
280 %attr(755,root,root) %{_bindir}/%{name}_merge
281 %attr(755,root,root) %{_bindir}/%{name}_2sql
282 %attr(755,root,root) %{_bindir}/%{name}_stats
283 %attr(755,root,root) %{_bindir}/%{name}_admin
284 #%attr(755,root,root) %{_bindir}/libdb4_purge
288 %defattr(644,root,root,755)
289 %doc README CHANGELOG
290 %attr(755,root,root) %{_libdir}/lib*.so.*.*.*
293 %defattr(644,root,root,755)
294 %{_libdir}/pkgconfig/dspam.pc
295 %attr(755,root,root) %{_libdir}/lib*.so
297 %{_includedir}/%{name}
298 %{_pkgconfigdir}/*.pc
301 %defattr(644,root,root,755)