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