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