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