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