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