]> git.pld-linux.org Git - packages/dspam.git/blob - dspam.spec
- fix %%files
[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.2
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 # fix missing file
203 install -d $RPM_BUILD_ROOT/var/lib/%{name}
204 cat > $RPM_BUILD_ROOT/var/lib/%{name}/mysql.data <<EOF
205 _UNCONFIGURED_
206
207 Note!
208
209 This file can only contain 5 lines with the following values:
210
211 HOSTNAME
212 PORT
213 USERNAME
214 PASSWORD
215 DATABASE
216 EOF
217 %endif
218
219 %if %{with pgsql}
220 # fix missing file
221 install -d $RPM_BUILD_ROOT/var/lib/%{name}
222 cat > $RPM_BUILD_ROOT/var/lib/%{name}/pgsql.data <<EOF
223 _UNCONFIGURED_
224
225 Note!
226
227 This file can only contain 5 lines with the following values:
228
229 HOSTNAME
230 PORT
231 USERNAME
232 PASSWORD
233 DATABASE
234 EOF
235 %endif
236
237 %clean
238 rm -rf $RPM_BUILD_ROOT
239
240 %post   libs -p /sbin/ldconfig
241 %postun libs -p /sbin/ldconfig
242
243 %files
244 %defattr(644,root,root,755)
245 %doc README CHANGELOG RELEASE.NOTES UPGRADING
246 %doc cgi/base.css cgi/dspam.cgi
247 %if %{with mysql}
248 %doc doc/mysql_drv.txt
249 %doc src/tools.mysql_drv/*.sql
250 %endif
251 %if %{with pgsql}
252 %doc doc/pgsql_drv.txt
253 %doc src/tools.pgsql_drv/*.sql
254 %endif
255 %if %{!with mysql} && %{!with pgsql}
256 %doc doc/sqlite_drv.txt
257 %endif
258 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dspam.conf
259 %dir %attr(750,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,mail) %{_bindir}/%{name}c
265 %attr(755,root,mail) %{_bindir}/%{name}_logrotate
266 %attr(755,root,root) %{_bindir}/%{name}_clean
267 %attr(755,root,root) %{_bindir}/%{name}_corpus
268 %attr(755,root,root) %{_bindir}/%{name}_crc
269 %attr(755,root,root) %{_bindir}/%{name}_dump
270 %attr(755,root,root) %{_bindir}/%{name}_genaliases
271 %attr(755,root,root) %{_bindir}/%{name}_stats
272 %attr(755,root,root) %{_bindir}/%{name}_merge
273 %attr(755,root,root) %{_bindir}/%{name}_2sql
274 %attr(755,root,root) %{_bindir}/%{name}_admin
275 %{?with_pgsql:%attr(755,root,root) %{_bindir}/%{name}_pg2int8}
276 %{_mandir}/man?/%{name}*
277
278 %files libs
279 %defattr(644,root,root,755)
280 %doc README CHANGELOG
281 %attr(755,root,root) %{_libdir}/lib*.so.*.*.*
282
283 %files devel
284 %defattr(644,root,root,755)
285 %attr(755,root,root) %{_libdir}/lib*.so
286 %{_libdir}/lib*.la
287 %{_includedir}/%{name}
288 %{_mandir}/man3/libdspam*
289 %{_pkgconfigdir}/*.pc
290
291 %files static
292 %defattr(644,root,root,755)
293 %{_libdir}/lib*.a
This page took 0.176504 seconds and 4 git commands to generate.