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