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