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