]> git.pld-linux.org Git - packages/dspam.git/blob - dspam.spec
b5b1ecd794daef2f7c3c07b42024f48c6c2edfa7
[packages/dspam.git] / dspam.spec
1 #
2 # TODO:
3 # - support for libdclassify
4 # - oracle driver
5 # - messages from default install of cron with mysql driver
6 # Memory fault
7 #
8 # Conditional build:
9 %bcond_without  mysql   # disable MySQL storage driver
10 %bcond_without  pgsql   # disable PostgreSQL storage driver
11 %bcond_without  sqlite  # disable SQLite3 storage driver
12 %bcond_without  db      # disable BerkeleyDB storage driver
13 %bcond_without  daemon  # disable daemon mode
14 %bcond_with     mysql40 # use with mysql 4.0
15 #
16 Summary:        A library and Mail Delivery Agent for Bayesian spam filtering
17 Summary(pl):    Biblioteka i MDA do bayesowskiego filtrowania spamu
18 Name:           dspam
19 Version:        3.6.5
20 Release:        0.1
21 License:        GPL
22 Group:          Applications/Mail
23 Source0:        http://www.nuclearelephant.com/projects/dspam/sources/%{name}-%{version}.tar.gz
24 # Source0-md5:  da4f0e00633bff49d71fde418caaf14b
25 Source1:        %{name}.init
26 URL:            http://www.nuclearelephant.com/projects/dspam/
27 BuildRequires:  autoconf
28 BuildRequires:  automake
29 BuildRequires:  clamav-devel
30 %{?with_db:BuildRequires:       db-devel}
31 BuildRequires:  libtool
32 %{?with_mysql:BuildRequires:    mysql-devel}
33 BuildRequires:  openldap-devel
34 %{?with_pgsql:BuildRequires:    postgresql-devel}
35 BuildRequires:  rpmbuild(macros) >= 1.268
36 BuildRequires:  sed >= 4.0
37 %{?with_sqlite:BuildRequires:   sqlite3-devel}
38 BuildRequires:  zlib-devel
39 Requires(post,preun):   /sbin/chkconfig
40 Requires:       rc-scripts
41 Buildroot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
42
43 %description
44 DSPAM (as in De-Spam) is an open-source project to create a new kind
45 of anti-spam mechanism, and is currently effective as both a
46 server-side agent for UNIX email servers and a developer's library for
47 mail clients, other anti-spam tools, and similar projects requiring
48 drop-in spam filtering.
49
50 The DSPAM agent masquerades as the email server's local delivery agent
51 and filters/learns spams using an advanced Bayesian statistical
52 approach (based on Bayes's theorem of combined probabilities) which
53 provides an administratively maintenance-free, easy-learning Anti-Spam
54 service custom tailored to each individual user's behavior. Advanced
55 because on top of standard Bayesian filtering is also incorporated the
56 use of Chained Tokens, de-obfuscation, and other enhancements. DSPAM
57 works great with Sendmail and Exim, and should work well with any
58 other MTA that supports an external local delivery agent (postfix,
59 qmail, etc.)
60
61 %description -l pl
62 DSPAM (czyli De-Spam) to projekt o otwartych ¼ród³ach maj±cy na celu
63 stworzenie nowego rodzaju mechanizmu antyspamowego. Aktualnie jest
64 efektywny zarówno jako dzia³aj±cy po stronie serwera agent dla
65 uniksowych serwerów pocztowych jak i biblioteka dla programistów
66 klientów pocztowych, innych narzêdzi antyspamowych i innych projektów
67 wymagaj±cych filtrowania spamu w locie.
68
69 Agent DSPAM zachowuje siê jak lokalny agent dostarczania poczty (MDA)
70 i filtruje/uczy siê spamu przy u¿yciu zaawansowanego bayesowskiego
71 przybli¿enia statystycznego (opartego na twierdzeniu Bayesa o
72 po³±czonych prawdopodobieñstwach), daj±c nie wymagaj±c± obs³ugi
73 administracyjnej, ³atwo ucz±c± siê us³ugê antyspamow± dostosowan± do
74 zachowania ka¿dego u¿ytkownika. Metoda jest zaawansowana poniewa¿ na
75 podstawie standardowego filtrowania bayesowskiego wprowadzono u¿ycie
76 tokenów ³añcuchowych, eliminowanie ukrywanie i inne rozszerzenia.
77 DSPAM dzia³a wspaniale z Sendmailem i Eximem, powinien dzia³aæ dobrze
78 z ka¿dym innym MTA obs³uguj±cym zewnêtrznego agenta MDA (postfiksem,
79 qmailem itd.).
80
81 %package client
82 Summary:        dspam client
83 Summary(pl):    Klient dspam
84 Group:          Applications/Mail
85 # to get the same dspam.conf when both installed
86 Conflicts:      dspam < %{version}-%{release}
87 Conflicts:      dspam > %{version}-%{release}
88
89 %description client
90 dspam client.
91
92 %description client -l pl
93 Klient dspam.
94
95 %package libs
96 Summary:        A library for Bayesian spam filtering
97 Summary(pl):    Biblioteka do bayesowskiego filtrowania spamu
98 Group:          Libraries
99 Requires:       %{name}-driver = %{version}-%{release}
100
101 %description libs
102 DSPAM (as in De-Spam) is an open-source project to create a new kind
103 of anti-spam mechanism, and is currently effective as both a
104 server-side agent for UNIX email servers and a developer's library for
105 mail clients, other anti-spam tools, and similar projects requiring
106 drop-in spam filtering.
107
108 This package contains the library.
109
110 %description libs -l pl
111 DSPAM (czyli De-Spam) to projekt o otwartych ¼ród³ach maj±cy na celu
112 stworzenie nowego rodzaju mechanizmu antyspamowego. Aktualnie jest
113 efektywny zarówno jako dzia³aj±cy po stronie serwera agent dla
114 uniksowych serwerów pocztowych jak i biblioteka dla programistów
115 klientów pocztowych, innych narzêdzi antyspamowych i innych projektów
116 wymagaj±cych filtrowania spamu w locie.
117
118 Ten pakiet zawiera wspomnian± bibliotekê.
119
120 %package devel
121 Summary:        Header files for the DSPAM library
122 Summary(pl):    Pliki nag³ówkowe biblioteki DSPAM
123 Group:          Development/Libraries
124 Requires:       %{name}-libs = %{version}-%{release}
125
126 %description devel
127 DSPAM has had its core engine moved into a separate library, libdspam.
128 This library can be used by developers to provide 'drop-in' spam
129 filtering for their mail client applications, other anti-spam tools,
130 or similar projects.
131
132 %description devel -l pl
133 G³ówny silnik DSPAM zosta³ przeniesiony do oddzielnej biblioteki
134 libdspam, która mo¿e byæ u¿ywana przez programistów do zapewnienia
135 filtrowania spamu w locie dla aplikacji klientów pocztowych, innych
136 narzêdzi antyspamowych i podobnych projektów.
137
138 %package static
139 Summary:        Static DSPAM library
140 Summary(pl):    Statyczna biblioteka DSPAM
141 Group:          Development/Libraries
142 Requires:       %{name}-devel = %{version}-%{release}
143
144 %description static
145 Static DSPAM library.
146
147 %description static -l pl
148 Statyczna biblioteka DSPAM.
149
150 %package driver-hash
151 Summary:        HASH driver for DSPAM
152 Summary(pl):    Sterownik HASH dla DSPAM-a
153 Group:          Libraries
154 Requires(post): sed >= 4.0
155 Requires:       %{name}-libs = %{version}-%{release}
156 Provides:       %{name}-driver = %{version}-%{release}
157
158 %description driver-hash
159 HASH driver for DSPAM.
160
161 %description driver-hash -l pl
162 Sterownik HASH dla DSPAM-a.
163
164 %package driver-db
165 Summary:        DB driver for DSPAM
166 Summary(pl):    Sterownik DB dla DSPAM-a
167 Group:          Libraries
168 Requires(post): sed >= 4.0
169 Requires:       %{name}-libs = %{version}-%{release}
170 Provides:       %{name}-driver = %{version}-%{release}
171
172 %description driver-db
173 DB driver for DSPAM.
174
175 %description driver-db -l pl
176 Sterownik DB dla DSPAM-a.
177
178 %package driver-mysql
179 Summary:        MySQL driver for DSPAM
180 Summary(pl):    Sterownik MySQL dla DSPAM-a
181 Group:          Libraries
182 Requires(post): sed >= 4.0
183 Requires:       %{name}-libs = %{version}-%{release}
184 Provides:       %{name}-driver = %{version}-%{release}
185
186 %description driver-mysql
187 MySQL driver for DSPAM.
188
189 %description driver-mysql -l pl
190 Sterownik MySQL dla DSPAM-a.
191
192 %package driver-pgsql
193 Summary:        PostgreSQL driver for DSPAM
194 Summary(pl):    Sterownik PostgreSQL dla DSPAM-a
195 Group:          Libraries
196 Requires(post): sed >= 4.0
197 Requires:       %{name}-libs = %{version}-%{release}
198 Provides:       %{name}-driver = %{version}-%{release}
199
200 %description driver-pgsql
201 PostgreSQL driver for DSPAM.
202
203 %description driver-pgsql -l pl
204 Sterownik PostgreSQL dla DSPAM-a.
205
206 %package driver-sqlite
207 Summary:        SQLite driver for DSPAM
208 Summary(pl):    Sterownik SQLite dla DSPAM-a
209 Group:          Libraries
210 Requires(post): sed >= 4.0
211 Requires:       %{name}-libs = %{version}-%{release}
212 Provides:       %{name}-driver = %{version}-%{release}
213
214 %description driver-sqlite
215 SQLite driver for DSPAM.
216
217 %description driver-sqlite -l pl
218 Sterownik SQLite dla DSPAM-a.
219
220 %prep
221 %setup -q
222 sed -i -e 's#\-static##g' src/Makefile* src/*/Makefile*
223 %{?with_mysql40:sed -i -e 's#40100#99999#g' src/mysql_drv.c}
224
225 %build
226 %{__libtoolize}
227 %{__aclocal} -I m4
228 %{__autoconf}
229 %{__automake}
230
231 DRIVERS="
232 hash_drv
233 %{?with_db:libdb4_drv}
234 %{?with_mysql:mysql_drv}
235 %{?with_pgsql:pgsql_drv}
236 %{?with_sqlite:sqlite_drv}
237 "
238 %configure \
239         %{?debug: --enable-debug --enable-bnr-debug --enable-verbose-debug} \
240         --enable-trusted-user-security \
241         --enable-bias \
242         --enable-large-scale \
243         --with-userdir=/var/lib/%{name} \
244         --with-userdir-owner=none \
245         --with-userdir-group=none \
246         --with-dspam-home=/var/lib/%{name} \
247         --with-dspam-home-owner=none \
248         --with-dspam-home-group=none \
249         --with-dspam-owner=none \
250         --with-dspam-group=none \
251         --with-signature-life=14 \
252         --disable-dependency-tracking \
253         --enable-ldap \
254         --enable-clamav \
255         --enable-preferences-extension \
256         --enable-long-usernames \
257         --enable-neural-networking \
258         --enable-virtual-users \
259         --with-storage-driver=$(echo $DRIVERS | tr ' ' ',') \
260 %if %{with mysql}
261         --with-mysql-includes=%{_includedir}/mysql \
262         --with-mysql-libraries=%{_libdir} \
263 %endif
264 %if %{with pgsql}
265         --with-pgsql-includes=%{_includedir}/postgresql \
266         --with-pgsql-libraries=%{_libdir} \
267 %endif
268 %if %{with sqlite}
269         --with-sqlite3-includes=%{_includedir} \
270         --with-sqlite3-libraries=%{_libdir} \
271 %endif
272         --enable-daemon
273
274 # --enable-dclassify-extension needs libdclassify
275
276 %{__make}
277
278 %install
279 rm -rf $RPM_BUILD_ROOT
280
281 %{__make} install \
282         DESTDIR=$RPM_BUILD_ROOT
283
284 install -d $RPM_BUILD_ROOT/{var/run/dspam,/etc/{rc.d/init.d,sysconfig}}
285 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/dspam
286
287 #
288 ln -s /var/log/dspam $RPM_BUILD_ROOT/var/lib/%{name}/log
289
290 # install devel files
291 install -d $RPM_BUILD_ROOT{%{_includedir}/%{name},/var/{log,lib}/%{name}}
292 install src/*.h $RPM_BUILD_ROOT%{_includedir}/%{name}
293
294 # provide maintenance scripts
295 install -d $RPM_BUILD_ROOT/etc/cron.daily
296 install -d $RPM_BUILD_ROOT/etc/cron.weekly
297
298 cat > $RPM_BUILD_ROOT/etc/cron.daily/%{name} <<EOF
299 #!/bin/sh
300 exec %{_bindir}/%{name}_clean -s -p
301 EOF
302
303 chmod 755 $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily/%{name}
304
305 # fix prefix
306 sed -i -e "s|%{_prefix}/local|%{_prefix}|g" $RPM_BUILD_ROOT%{_bindir}/%{name}_corpus
307 sed -i -e "s|%{_prefix}/local|%{_prefix}|g" webui/cgi-bin/dspam.cgi
308
309 # fix purge stuff
310 #install dspam-cron.weekly $RPM_BUILD_ROOT%{_sysconfdir}/cron.weekly/%{name}
311
312 %if %{with mysql}
313 # fix missing file
314 install -d $RPM_BUILD_ROOT/var/lib/%{name}
315 cat > $RPM_BUILD_ROOT/var/lib/%{name}/mysql.data <<EOF
316 _UNCONFIGURED_
317
318 Note!
319
320 This file can only contain 5 lines with the following values:
321
322 HOSTNAME
323 PORT
324 USERNAME
325 PASSWORD
326 DATABASE
327 EOF
328 %endif
329
330 %if %{with pgsql}
331 # fix missing file
332 install -d $RPM_BUILD_ROOT/var/lib/%{name}
333 cat > $RPM_BUILD_ROOT/var/lib/%{name}/pgsql.data <<EOF
334 _UNCONFIGURED_
335
336 Note!
337
338 This file can only contain 5 lines with the following values:
339
340 HOSTNAME
341 PORT
342 USERNAME
343 PASSWORD
344 DATABASE
345 EOF
346 %endif
347
348 %post
349 /sbin/chkconfig --add dspam
350 %service dspam restart "dspam daemon"
351
352 %preun
353 if [ "$1" = "0" ]; then
354         %service dspam stop
355         /sbin/chkconfig --del dspam
356 fi
357
358 %clean
359 rm -rf $RPM_BUILD_ROOT
360
361 %post   libs -p /sbin/ldconfig
362 %postun libs -p /sbin/ldconfig
363
364 %post driver-db
365 if [ "$1" = "1" ]; then
366         sed -i -e '/^StorageDriver/s,/.*.so,%{_libdir}/libdb4_drv.so,' /etc/dspam.conf
367 fi
368
369 %post driver-hash
370 if [ "$1" = "1" ]; then
371         sed -i -e '/^StorageDriver/s,/.*\.so,%{_libdir}/libhash_drv.so,' /etc/dspam.conf
372 fi
373
374 %post driver-mysql
375 if [ "$1" = "1" ]; then
376         sed -i -e '/^StorageDriver/s,/.*\.so,%{_libdir}/libmysql_drv.so,' /etc/dspam.conf
377 fi
378
379 %post driver-pgsql
380 if [ "$1" = "1" ]; then
381         sed -i -e '/^StorageDriver/s,/.*\.so,%{_libdir}/libpgsql_drv.so,' /etc/dspam.conf
382 fi
383
384 %post driver-sqlite
385 if [ "$1" = "1" ]; then
386         sed -i -e '/^StorageDriver/s,/.*\.so,%{_libdir}/libsqlite_drv.so,' /etc/dspam.conf
387 fi
388
389 %files
390 %defattr(644,root,root,755)
391 %doc README CHANGELOG RELEASE.NOTES UPGRADING
392 %doc webui/*/*.{cgi,prefs,txt} webui/*/*.txt webui/*/templates/*.html
393 %doc doc/{courier,exim,markov,pop3filter,postfix,qmail,relay,sendmail}.txt
394 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dspam.conf
395 %dir %attr(750,root,mail) /var/lib/%{name}
396 %dir %attr(770,root,mail) /var/log/dspam
397 %attr(755,root,root) %config(noreplace) /etc/cron.daily/%{name}
398 %attr(755,root,root) %{_bindir}/%{name}
399 %attr(755,root,root) %{_bindir}/%{name}_logrotate
400 %attr(755,root,root) %{_bindir}/%{name}_clean
401 %attr(755,root,root) %{_bindir}/%{name}_corpus
402 %attr(755,root,root) %{_bindir}/%{name}_crc
403 %attr(755,root,root) %{_bindir}/%{name}_dump
404 %attr(755,root,root) %{_bindir}/%{name}_genaliases
405 %attr(755,root,root) %{_bindir}/%{name}_stats
406 %attr(755,root,root) %{_bindir}/%{name}_merge
407 %attr(755,root,root) %{_bindir}/%{name}_2sql
408 %attr(755,root,root) %{_bindir}/%{name}_admin
409 %attr(755,root,root) %{_bindir}/%{name}_train
410 %{_mandir}/man?/%{name}*
411
412 %if %{with daemon}
413 %attr(754,root,root) /etc/rc.d/init.d/dspam
414 %files client
415 %defattr(644,root,root,755)
416 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dspam.conf
417 %attr(770,root,mail) /var/run/dspam
418 %endif
419 %attr(755,root,root) %{_bindir}/%{name}c
420
421 %files libs
422 %defattr(644,root,root,755)
423 %doc README CHANGELOG
424 %attr(755,root,root) %{_libdir}/lib*.so.*.*.*
425 %attr(755,root,root) %exclude %{_libdir}/lib*_drv*.so*
426
427 %files devel
428 %defattr(644,root,root,755)
429 %attr(755,root,root) %{_libdir}/lib*.so
430 %attr(755,root,root) %exclude %{_libdir}/lib*_drv*.so*
431 %{_libdir}/lib*.la
432 %{_includedir}/%{name}
433 %{_mandir}/man3/libdspam*
434 %{_pkgconfigdir}/*.pc
435
436 %files static
437 %defattr(644,root,root,755)
438 %{_libdir}/lib*.a
439
440 %files driver-hash
441 %defattr(644,root,root,755)
442 %attr(755,root,root) %{_bindir}/css*
443 %attr(755,root,root) %{_libdir}/libhash_drv*.so*
444
445 %if %{with db}
446 %files driver-db
447 %defattr(644,root,root,755)
448 %attr(755,root,root) %{_libdir}/libdb4_drv*.so*
449 %endif
450
451 %if %{with mysql}
452 %files driver-mysql
453 %defattr(644,root,root,755)
454 %doc doc/mysql_drv.txt src/tools.mysql_drv/*.sql
455 %attr(640,root,mail) %config(noreplace) /var/lib/%{name}/mysql.data
456 %attr(755,root,root) %{_libdir}/libmysql_drv*.so*
457 %endif
458
459 %if %{with pgsql}
460 %files driver-pgsql
461 %defattr(644,root,root,755)
462 %doc doc/pgsql_drv.txt src/tools.pgsql_drv/*.sql
463 %attr(640,root,mail) %config(noreplace) /var/lib/%{name}/pgsql.data
464 %attr(755,root,root) %{_bindir}/%{name}_pg2int8
465 %attr(755,root,root) %{_libdir}/libpgsql_drv*.so*
466 %endif
467
468 %if %{with sqlite}
469 %files driver-sqlite
470 %defattr(644,root,root,755)
471 %doc doc/sqlite_drv.txt
472 %attr(755,root,root) %{_libdir}/libsqlite_drv*.so*
473 %endif
This page took 0.22174 seconds and 2 git commands to generate.