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