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