]> git.pld-linux.org Git - packages/dspam.git/blob - dspam.spec
- fix the %%if syntax, db4 driver works again
[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
147 %if %{with pgsql}
148         --enable-neural-networking \
149         --enable-virtual-users \
150         --with-storage-driver=pgsql_drv \
151         --with-pgsql-includes=%{_includedir}/postgresql \
152         --with-pgsql-libraries=%{_libdir}
153 %else
154         --with-storage-driver=libdb4_drv \
155         --with-db4-includes=%{_includedir} \
156         --with-db4-libraries=%{_libdir}
157 %endif
158 %endif
159 %{__make}
160
161 %install
162 rm -rf $RPM_BUILD_ROOT
163
164 #%makeinstall_std
165 %{__make} install DESTDIR=$RPM_BUILD_ROOT
166
167 # install devel files
168 install -d $RPM_BUILD_ROOT{%{_includedir}/%{name},/var/lib/%{name}}
169 install -m0644 libdspam.h $RPM_BUILD_ROOT%{_includedir}/%{name}
170 install -m0644 libdspam_objects.h $RPM_BUILD_ROOT%{_includedir}/%{name}
171 install -m0644 lht.h $RPM_BUILD_ROOT%{_includedir}/%{name}
172 install -m0644 nodetree.h $RPM_BUILD_ROOT%{_includedir}/%{name}
173
174 # provide maintenance scripts
175 install -d $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily
176 install -d $RPM_BUILD_ROOT%{_sysconfdir}/cron.weekly
177
178 cat > $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily/%{name} <<EOF
179 #!/bin/sh
180 exec %{_bindir}/%{name}_clean 2>&1 > /dev/null
181 EOF
182
183 chmod 755 $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily/%{name}
184
185 # fix prefix
186 perl -pi -e "s|%{_prefix}/local|%{_prefix}|g" $RPM_BUILD_ROOT%{_bindir}/%{name}_corpus
187 perl -pi -e "s|%{_prefix}/local|%{_prefix}|g" cgi/dspam.cgi
188
189 # fix purge stuff
190 #install -m0755 dspam-cron.weekly $RPM_BUILD_ROOT%{_sysconfdir}/cron.weekly/%{name}
191
192 %if %{with mysql}
193 cp tools.mysql_drv/README README.mysql
194
195 # fix missing file
196 install -d $RPM_BUILD_ROOT/var/lib/%{name}
197 cat > $RPM_BUILD_ROOT/var/lib/%{name}/mysql.data <<EOF
198 _UNCONFIGURED_
199
200 Note!
201
202 This file can only contain 5 lines with the following values:
203
204 HOSTNAME
205 PORT
206 USERNAME
207 PASSWORD
208 DATABASE
209 EOF
210 %endif
211
212 %if %{with pgsql}
213 cp tools.pgsql_drv/README README.pgsql
214
215 # fix missing file
216 install -d $RPM_BUILD_ROOT/var/lib/%{name}
217 cat > $RPM_BUILD_ROOT/var/lib/%{name}/pgsql.data <<EOF
218 _UNCONFIGURED_
219
220 Note!
221
222 This file can only contain 5 lines with the following values:
223
224 HOSTNAME
225 PORT
226 USERNAME
227 PASSWORD
228 DATABASE
229 EOF
230 %endif
231
232 %clean
233 rm -rf $RPM_BUILD_ROOT
234
235 %post   libs -p /sbin/ldconfig
236 %postun libs -p /sbin/ldconfig
237
238 %files
239 %defattr(644,root,root,755)
240 %doc README CHANGELOG RELEASE.NOTES
241 %doc cgi/base.css cgi/dspam.cgi cgi/logo.gif
242 %if %{with mysql}
243 %doc README.mysql
244 %doc tools.mysql_drv/mysql_objects.sql.space.optimized
245 %doc tools.mysql_drv/mysql_objects.sql.speed.optimized
246 %doc tools.mysql_drv/purge.sql
247 %doc tools.mysql_drv/virtual_users.sql
248 %endif
249 %if %{with pgsql}
250 %doc README.pgsql
251 %doc tools.pgsql_drv/virtual_users.sql
252 %doc tools.pgsql_drv/pgsql_objects.sql
253 %doc tools.pgsql_drv/purge.sql
254 %endif
255 %dir %attr(0750,root,mail) /var/lib/%{name}
256 %{?with_mysql:%attr(640,root,mail) %config(noreplace) /var/lib/%{name}/mysql.data}
257 %{?with_pgsql:%attr(640,root,mail) %config(noreplace) /var/lib/%{name}/pgsql.data}
258 %attr(755,root,root) %config(noreplace) %{_sysconfdir}/cron.daily/%{name}
259 #%attr(755,root,root) %config(noreplace) %{_sysconfdir}/cron.weekly/%{name}
260 %attr(755,root,mail) %{_bindir}/%{name}
261 %attr(755,root,root) %{_bindir}/%{name}_clean
262 %attr(755,root,root) %{_bindir}/%{name}_corpus
263 %attr(755,root,root) %{_bindir}/%{name}_crc
264 %attr(755,root,root) %{_bindir}/%{name}_dump
265 %attr(755,root,root) %{_bindir}/%{name}_genaliases
266 %attr(755,root,root) %{_bindir}/%{name}_stats
267 %attr(755,root,root) %{_bindir}/%{name}_merge
268 %attr(755,root,root) %{_bindir}/%{name}_2sql
269 %attr(755,root,root) %{_bindir}/%{name}_stats
270 #%attr(755,root,root) %{_bindir}/libdb4_purge
271 %{_mandir}/man?/*
272
273 %files libs
274 %defattr(644,root,root,755)
275 %doc README CHANGELOG
276 %attr(755,root,root) %{_libdir}/lib*.so.*.*.*
277
278 %files devel
279 %defattr(644,root,root,755)
280 %attr(755,root,root) %{_libdir}/lib*.so
281 %{_libdir}/lib*.la
282 %{_includedir}/%{name}
283
284 %files static
285 %defattr(644,root,root,755)
286 %{_libdir}/lib*.a
This page took 0.129344 seconds and 4 git commands to generate.