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