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