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