]> git.pld-linux.org Git - packages/dspam.git/blob - dspam.spec
- update todo
[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 # 3197: [10/25/2005 05:02:01] dlopen() failed: /usr/lib/libhash_drv.so: /usr/lib/libhash_drv.so: cannot open shared object file: No such file or directory
7 # Memory fault
8 #
9 # Conditional build:
10 %bcond_without  mysql   # disable MySQL storage driver
11 %bcond_without  pgsql   # disable PostgreSQL storage driver
12 %bcond_without  sqlite  # disable SQLite3 storage driver
13 %bcond_without  db      # disable BerkeleyDB storage driver
14 %bcond_without  daemon  # disable daemon mode
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.0
20 Release:        0.3
21 License:        GPL
22 Group:          Applications/Mail
23 Source0:        http://www.nuclearelephant.com/projects/dspam/sources/%{name}-%{version}.tar.gz
24 # Source0-md5:  d9ee63a8cf67ea933d711b00851ce916
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 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 Provides:       %{name}-driver = %{version}-%{release}
166
167 %description driver-db
168 DB driver for DSPAM.
169
170 %description driver-db -l pl
171 Sterownik DB dla DSPAM-a.
172
173 %package driver-mysql
174 Summary:        MySQL driver for DSPAM
175 Summary(pl):    Sterownik MySQL dla DSPAM-a
176 Group:          Libraries
177 Requires:       %{name}-libs = %{version}-%{release}
178 Provides:       %{name}-driver = %{version}-%{release}
179
180 %description driver-mysql
181 MySQL driver for DSPAM.
182
183 %description driver-mysql -l pl
184 Sterownik MySQL dla DSPAM-a.
185
186 %package driver-pgsql
187 Summary:        PostgreSQL driver for DSPAM
188 Summary(pl):    Sterownik PostgreSQL dla DSPAM-a
189 Group:          Libraries
190 Requires:       %{name}-libs = %{version}-%{release}
191 Provides:       %{name}-driver = %{version}-%{release}
192
193 %description driver-pgsql
194 PostgreSQL driver for DSPAM.
195
196 %description driver-pgsql -l pl
197 Sterownik PostgreSQL dla DSPAM-a.
198
199 %package driver-sqlite
200 Summary:        SQLite driver for DSPAM
201 Summary(pl):    Sterownik SQLite dla DSPAM-a
202 Group:          Libraries
203 Requires:       %{name}-libs = %{version}-%{release}
204 Provides:       %{name}-driver = %{version}-%{release}
205
206 %description driver-sqlite
207 SQLite driver for DSPAM.
208
209 %description driver-sqlite -l pl
210 Sterownik SQLite dla DSPAM-a.
211
212 %prep
213 %setup -q
214 sed -i -e 's#\-static##g' src/Makefile* src/*/Makefile*
215
216 %build
217 %{__libtoolize}
218 %{__aclocal} -I m4
219 %{__autoconf}
220 %{__automake}
221 %configure \
222         %{?debug: --enable-debug --enable-bnr-debug --enable-verbose-debug} \
223         --enable-trusted-user-security \
224         --enable-bias \
225         --enable-large-scale \
226         --with-userdir=/var/lib/%{name} \
227         --with-dspam-home=/var/lib/%{name} \
228         --with-userdir-owner=none \
229         --with-userdir-group=none \
230         --with-dspam-owner=none \
231         --with-dspam-group=none \
232         --with-signature-life=14 \
233         --disable-dependency-tracking \
234         --enable-ldap \
235         --enable-clamav \
236         --enable-preferences-extension \
237         --enable-long-usernames \
238         --enable-neural-networking \
239         --enable-virtual-users \
240         --with-storage-driver=hash_drv%{?with_db:,libdb4_drv}%{?with_mysql:,mysql_drv}%{?with_pgsql:,pgsql_drv}%{?with_sqlite:,sqlite_drv} \
241 %if %{with mysql}
242         --with-mysql-includes=%{_includedir}/mysql \
243         --with-mysql-libraries=%{_libdir} \
244 %endif
245 %if %{with pgsql}
246         --with-pgsql-includes=%{_includedir}/postgresql \
247         --with-pgsql-libraries=%{_libdir} \
248 %endif
249 %if %{with sqlite}
250         --with-sqlite3-includes=%{_includedir} \
251         --with-sqlite3-libraries=%{_libdir} \
252 %endif
253         --enable-daemon
254
255 # --enable-dclassify-extension needs libdclassify
256
257 %{__make}
258
259 %install
260 rm -rf $RPM_BUILD_ROOT
261
262 %{__make} install \
263         DESTDIR=$RPM_BUILD_ROOT
264
265 install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig}
266 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/dspam
267
268 # install devel files
269 install -d $RPM_BUILD_ROOT{%{_includedir}/%{name},/var/lib/%{name}}
270 install src/*.h $RPM_BUILD_ROOT%{_includedir}/%{name}
271
272 # provide maintenance scripts
273 install -d $RPM_BUILD_ROOT/etc/cron.daily
274 install -d $RPM_BUILD_ROOT/etc/cron.weekly
275
276 cat > $RPM_BUILD_ROOT/etc/cron.daily/%{name} <<EOF
277 #!/bin/sh
278 exec %{_bindir}/%{name}_clean -s -p
279 EOF
280
281 chmod 755 $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily/%{name}
282
283 # fix prefix
284 sed -i -e "s|%{_prefix}/local|%{_prefix}|g" $RPM_BUILD_ROOT%{_bindir}/%{name}_corpus
285 sed -i -e "s|%{_prefix}/local|%{_prefix}|g" webui/cgi-bin/dspam.cgi
286
287 # fix purge stuff
288 #install dspam-cron.weekly $RPM_BUILD_ROOT%{_sysconfdir}/cron.weekly/%{name}
289
290 %if %{with mysql}
291 # fix missing file
292 install -d $RPM_BUILD_ROOT/var/lib/%{name}
293 cat > $RPM_BUILD_ROOT/var/lib/%{name}/mysql.data <<EOF
294 _UNCONFIGURED_
295
296 Note!
297
298 This file can only contain 5 lines with the following values:
299
300 HOSTNAME
301 PORT
302 USERNAME
303 PASSWORD
304 DATABASE
305 EOF
306 %endif
307
308 %if %{with pgsql}
309 # fix missing file
310 install -d $RPM_BUILD_ROOT/var/lib/%{name}
311 cat > $RPM_BUILD_ROOT/var/lib/%{name}/pgsql.data <<EOF
312 _UNCONFIGURED_
313
314 Note!
315
316 This file can only contain 5 lines with the following values:
317
318 HOSTNAME
319 PORT
320 USERNAME
321 PASSWORD
322 DATABASE
323 EOF
324 %endif
325
326 %post
327 /sbin/chkconfig --add dspam
328 if [ -f /var/lock/subsys/dspam ]; then
329         /etc/rc.d/init.d/dspam restart 1>&2
330 else
331         echo "Run \"/etc/rc.d/init.d/dspam start\" to start dspam daemon."
332 fi
333
334 %preun
335 if [ "$1" = "0" ]; then
336         if [ -f /var/lock/subsys/dspam ]; then
337                 /etc/rc.d/init.d/dspam stop 1>&2
338         fi
339         /sbin/chkconfig --del dspam
340 fi
341
342 %clean
343 rm -rf $RPM_BUILD_ROOT
344
345 %post   libs -p /sbin/ldconfig
346 %postun libs -p /sbin/ldconfig
347
348 %files
349 %defattr(644,root,root,755)
350 %doc README CHANGELOG RELEASE.NOTES UPGRADING
351 %doc webui/*/*.{cgi,prefs,txt} webui/*/*.txt webui/*/templates/*.html
352 %doc doc/{courier,exim,markov,pop3filter,postfix,qmail,relay,sendmail}.txt
353 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dspam.conf
354 %dir %attr(750,root,mail) /var/lib/%{name}
355 %attr(755,root,root) %config(noreplace) /etc/cron.daily/%{name}
356 %attr(755,root,mail) %{_bindir}/%{name}
357 %attr(755,root,mail) %{_bindir}/%{name}_logrotate
358 %attr(755,root,root) %{_bindir}/%{name}_clean
359 %attr(755,root,root) %{_bindir}/%{name}_corpus
360 %attr(755,root,root) %{_bindir}/%{name}_crc
361 %attr(755,root,root) %{_bindir}/%{name}_dump
362 %attr(755,root,root) %{_bindir}/%{name}_genaliases
363 %attr(755,root,root) %{_bindir}/%{name}_stats
364 %attr(755,root,root) %{_bindir}/%{name}_merge
365 %attr(755,root,root) %{_bindir}/%{name}_2sql
366 %attr(755,root,root) %{_bindir}/%{name}_admin
367 %{_mandir}/man?/%{name}*
368
369 %if %{with daemon}
370 %attr(754,root,root) /etc/rc.d/init.d/dspam
371 %files client
372 %defattr(644,root,root,755)
373 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dspam.conf
374 %endif
375 %attr(755,root,mail) %{_bindir}/%{name}c
376
377 %files libs
378 %defattr(644,root,root,755)
379 %doc README CHANGELOG
380 %attr(755,root,root) %{_libdir}/lib*.so.*.*.*
381 %attr(755,root,root) %exclude %{_libdir}/lib*_drv*.so*
382
383 %files devel
384 %defattr(644,root,root,755)
385 %attr(755,root,root) %{_libdir}/lib*.so
386 %attr(755,root,root) %exclude %{_libdir}/lib*_drv*.so*
387 %{_libdir}/lib*.la
388 %{_includedir}/%{name}
389 %{_mandir}/man3/libdspam*
390 %{_pkgconfigdir}/*.pc
391
392 %files static
393 %defattr(644,root,root,755)
394 %{_libdir}/lib*.a
395
396 %files driver-hash
397 %defattr(644,root,root,755)
398 %attr(755,root,root) %{_bindir}/css*
399 %attr(755,root,root) %{_libdir}/libhash_drv*.so*
400
401 %if %{with db}
402 %files driver-db
403 %defattr(644,root,root,755)
404 %attr(755,root,root) %{_libdir}/libdb4_drv*.so*
405 %endif
406
407 %if %{with mysql}
408 %files driver-mysql
409 %defattr(644,root,root,755)
410 %doc doc/mysql_drv.txt src/tools.mysql_drv/*.sql
411 %attr(640,root,mail) %config(noreplace) /var/lib/%{name}/mysql.data
412 %attr(755,root,root) %{_libdir}/libmysql_drv*.so*
413 %endif
414
415 %if %{with pgsql}
416 %files driver-pgsql
417 %defattr(644,root,root,755)
418 %doc doc/pgsql_drv.txt src/tools.pgsql_drv/*.sql
419 %attr(640,root,mail) %config(noreplace) /var/lib/%{name}/pgsql.data
420 %attr(755,root,root) %{_bindir}/%{name}_pg2int8
421 %attr(755,root,root) %{_libdir}/libpgsql_drv*.so*
422 %endif
423
424 %if %{with sqlite}
425 %files driver-sqlite
426 %defattr(644,root,root,755)
427 %doc doc/sqlite_drv.txt
428 %attr(755,root,root) %{_libdir}/libsqlite_drv*.so*
429 %endif
This page took 0.10867 seconds and 4 git commands to generate.