]> git.pld-linux.org Git - packages/dspam.git/blob - dspam.spec
- add verbose bcond
[packages/dspam.git] / dspam.spec
1 # NOTE about versioning:
2 #  Stable Releases: 3.4.x, Development Releases: 3.5.x
3 #  All odd-versioned minor releases are considered development
4 #  releases, and all even-versioned minor releases are stable releases
5 # - from http://www.nuclearelephant.com/projects/dspam/download.shtml
6 #
7 # TODO:
8 # - everything
9 # - oracle driver
10 # - missing /etc/dspam.conf for cron:
11 #   /etc/cron.daily/dspam:
12 #    2430: [6/28/2005 1:2:1] Unable to open file for reading: /etc/dspam.conf: No such file or directory
13 #    2430: [6/28/2005 1:2:1] Unable to read dspam.conf
14 #
15 # Conditional build:
16 %bcond_without  mysql   # enable MySQL storage driver (disable sqlite/pgsql driver)
17 %bcond_with     pgsql   # enable PostgreSQL storage driver (disable sqlite/mysql driver)
18 %bcond_with     sqlite  # enable SQLite3 storage driver
19 %bcond_with     daemon
20 %bcond_with     verbose
21
22 %if %{with mysql} && %{with pgsql}
23 %undefine with_pgsql
24 %{warn:disabled pgsql as mysql and pgsql aren't supported together (yet)
25 }#'vim
26 %endif
27
28 %if %{with mysql} && %{with sqlite}
29 %undefine with_sqlite
30 %{warn:disabled sqlite as mysql and sqlite aren't supported together (yet)
31 }#'vim
32 %endif
33
34 %if %{with pgsql} && %{with sqlite}
35 %undefine with_sqlite
36 %{warn:disabled sqlite as pgsql and sqlite aren't supported together (yet)
37 }#'vim
38 %endif
39
40
41 %if %{with mysql} || %{with pgsql}
42 %define with_daemon 1
43 %endif
44
45 Summary:        A library and Mail Delivery Agent for Bayesian spam filtering
46 Summary(pl):    Biblioteka i MDA do bayesowskiego filtrowania spamu
47 Name:           dspam
48 Version:        3.4.9
49 Release:        0.2
50 License:        GPL
51 Group:          Applications/Mail
52 Source0:        http://www.nuclearelephant.com/projects/dspam/sources/%{name}-%{version}.tar.gz
53 # Source0-md5:  ef7ceba47e63edb02a59be3c36cf0f6f
54 Source1:        %{name}.init
55 URL:            http://www.nuclearelephant.com/projects/dspam/
56 BuildRequires:  autoconf
57 BuildRequires:  automake
58 BuildRequires:  libtool
59 %{?with_mysql:BuildRequires:    mysql-devel}
60 %{?with_pgsql:BuildRequires:    postgresql-devel}
61 %{?with_sqlite:BuildRequires:   sqlite3-devel}
62 BuildRequires:  sed >= 4.0
63 Buildroot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
64
65 %description
66 DSPAM (as in De-Spam) is an open-source project to create a new kind
67 of anti-spam mechanism, and is currently effective as both a
68 server-side agent for UNIX email servers and a developer's library for
69 mail clients, other anti-spam tools, and similar projects requiring
70 drop-in spam filtering.
71
72 The DSPAM agent masquerades as the email server's local delivery agent
73 and filters/learns spams using an advanced Bayesian statistical
74 approach (based on Bayes's theorem of combined probabilities) which
75 provides an administratively maintenance-free, easy-learning Anti-Spam
76 service custom tailored to each individual user's behavior. Advanced
77 because on top of standard Bayesian filtering is also incorporated the
78 use of Chained Tokens, de-obfuscation, and other enhancements. DSPAM
79 works great with Sendmail and Exim, and should work well with any
80 other MTA that supports an external local delivery agent (postfix,
81 qmail, etc.)
82
83 %description -l pl
84 DSPAM (czyli De-Spam) to projekt o otwartych ¼ród³ach maj±cy na celu
85 stworzenie nowego rodzaju mechanizmu antyspamowego. Aktualnie jest
86 efektywny zarówno jako dzia³aj±cy po stronie serwera agent dla
87 uniksowych serwerów pocztowych jak i biblioteka dla programistów
88 klientów pocztowych, innych narzêdzi antyspamowych i innych projektów
89 wymagaj±cych filtrowania spamu w locie.
90
91 Agent DSPAM zachowuje siê jak lokalny agent dostarczania poczty (MDA)
92 i filtruje/uczy siê spamu przy u¿yciu zaawansowanego bayesowskiego
93 przybli¿enia statystycznego (opartego na twierdzeniu Bayesa o
94 po³±czonych prawdopodobieñstwach), daj±c nie wymagaj±c± obs³ugi
95 administracyjnej, ³atwo ucz±c± siê us³ugê antyspamow± dostosowan± do
96 zachowania ka¿dego u¿ytkownika. Metoda jest zaawansowana poniewa¿ na
97 podstawie standardowego filtrowania bayesowskiego wprowadzono u¿ycie
98 tokenów ³añcuchowych, eliminowanie ukrywanie i inne rozszerzenia.
99 DSPAM dzia³a wspaniale z Sendmailem i Eximem, powinien dzia³aæ dobrze
100 z ka¿dym innym MTA obs³uguj±cym zewnêtrznego agenta MDA (postfiksem,
101 qmailem itd.).
102
103 %package client
104 Summary:        dspam client
105 Summary(pl):    Klient dspam
106 Group:          Applications/Mail
107 # to get the same dspam.conf when both installed
108 Conflicts:      dspam > %{version}-%{release}
109 Conflicts:      dspam < %{version}-%{release}
110
111 %description client
112 dspam client.
113
114 %description -l pl client
115 Klient dspam.
116
117 %package libs
118 Summary:        A library for Bayesian spam filtering
119 Summary(pl):    Biblioteka do bayesowskiego filtrowania spamu
120 Group:          Libraries
121
122 %description libs
123 DSPAM (as in De-Spam) is an open-source project to create a new kind
124 of anti-spam mechanism, and is currently effective as both a
125 server-side agent for UNIX email servers and a developer's library for
126 mail clients, other anti-spam tools, and similar projects requiring
127 drop-in spam filtering.
128
129 This package contains the library.
130
131 %description libs -l pl
132 DSPAM (czyli De-Spam) to projekt o otwartych ¼ród³ach maj±cy na celu
133 stworzenie nowego rodzaju mechanizmu antyspamowego. Aktualnie jest
134 efektywny zarówno jako dzia³aj±cy po stronie serwera agent dla
135 uniksowych serwerów pocztowych jak i biblioteka dla programistów
136 klientów pocztowych, innych narzêdzi antyspamowych i innych projektów
137 wymagaj±cych filtrowania spamu w locie.
138
139 Ten pakiet zawiera wspomnian± bibliotekê.
140
141 %package devel
142 Summary:        Header files for the DSPAM library
143 Summary(pl):    Pliki nag³ówkowe biblioteki DSPAM
144 Group:          Development/Libraries
145 Requires:       %{name}-libs = %{version}-%{release}
146
147 %description devel
148 DSPAM has had its core engine moved into a separate library, libdspam.
149 This library can be used by developers to provide 'drop-in' spam
150 filtering for their mail client applications, other anti-spam tools,
151 or similar projects.
152
153 %description devel -l pl
154 G³ówny silnik DSPAM zosta³ przeniesiony do oddzielnej biblioteki
155 libdspam, która mo¿e byæ u¿ywana przez programistów do zapewnienia
156 filtrowania spamu w locie dla aplikacji klientów pocztowych, innych
157 narzêdzi antyspamowych i podobnych projektów.
158
159 %package static
160 Summary:        Static DSPAM library
161 Summary(pl):    Statyczna biblioteka DSPAM
162 Group:          Development/Libraries
163 Requires:       %{name}-devel = %{version}-%{release}
164
165 %description static
166 Static DSPAM library.
167
168 %description static -l pl
169 Statyczna biblioteka DSPAM.
170
171 %prep
172 %setup -q
173 sed -i -e 's#\-static##g' src/Makefile* src/*/Makefile*
174
175 %build
176 %{__libtoolize}
177 %{__aclocal} -I m4
178 %{__autoconf}
179 %{__automake}
180 %configure \
181         %{?with_verbose: --enable-debug --enable-verbose-debug} \
182         --enable-trusted-user-security \
183         --enable-bayesian-dobly \
184         --enable-chained-tokens \
185         --enable-experimental \
186         --enable-bias \
187         --enable-large-scale \
188         --enable-delivery-to-stdout \
189         --with-userdir=/var/lib/%{name} \
190         --with-dspam-home=/var/lib/%{name} \
191         --with-userdir-owner=none \
192         --with-userdir-group=none \
193         --with-dspam-owner=none \
194         --with-dspam-group=none \
195         --with-signature-life=14 \
196         --disable-dependency-tracking \
197 %if %{with mysql}
198         --enable-daemon \
199         --enable-virtual-users \
200         --with-storage-driver=mysql_drv \
201         --with-mysql-includes=%{_includedir}/mysql \
202         --with-mysql-libraries=%{_libdir}
203 %endif
204 %if %{with pgsql}
205         --enable-daemon \
206         --enable-virtual-users \
207         --with-storage-driver=pgsql_drv \
208         --with-pgsql-includes=%{_includedir}/postgresql \
209         --with-pgsql-libraries=%{_libdir}
210 %endif
211 %if %{with sqlite}
212         --with-storage-driver=sqlite3_drv \
213         --with-sqlite3-includes=%{_includedir} \
214         --with-sqlite3-libraries=%{_libdir}
215 %endif
216 %{__make}
217
218 %install
219 rm -rf $RPM_BUILD_ROOT
220
221 %{__make} install \
222         DESTDIR=$RPM_BUILD_ROOT
223
224 install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig}
225 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/dspam
226
227 # install devel files
228 install -d $RPM_BUILD_ROOT{%{_includedir}/%{name},/var/lib/%{name}}
229 install src/*.h $RPM_BUILD_ROOT%{_includedir}/%{name}
230
231 # provide maintenance scripts
232 install -d $RPM_BUILD_ROOT/etc/cron.daily
233 install -d $RPM_BUILD_ROOT/etc/cron.weekly
234
235 cat > $RPM_BUILD_ROOT/etc/cron.daily/%{name} <<EOF
236 #!/bin/sh
237 exec %{_bindir}/%{name}_clean -s -p
238 EOF
239
240 chmod 755 $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily/%{name}
241
242 # fix prefix
243 sed -i -e "s|%{_prefix}/local|%{_prefix}|g" $RPM_BUILD_ROOT%{_bindir}/%{name}_corpus
244 sed -i -e "s|%{_prefix}/local|%{_prefix}|g" cgi/dspam.cgi
245
246 # fix purge stuff
247 #install dspam-cron.weekly $RPM_BUILD_ROOT%{_sysconfdir}/cron.weekly/%{name}
248
249 %if %{with mysql}
250 # fix missing file
251 install -d $RPM_BUILD_ROOT/var/lib/%{name}
252 cat > $RPM_BUILD_ROOT/var/lib/%{name}/mysql.data <<EOF
253 _UNCONFIGURED_
254
255 Note!
256
257 This file can only contain 5 lines with the following values:
258
259 HOSTNAME
260 PORT
261 USERNAME
262 PASSWORD
263 DATABASE
264 EOF
265 %endif
266
267 %if %{with pgsql}
268 # fix missing file
269 install -d $RPM_BUILD_ROOT/var/lib/%{name}
270 cat > $RPM_BUILD_ROOT/var/lib/%{name}/pgsql.data <<EOF
271 _UNCONFIGURED_
272
273 Note!
274
275 This file can only contain 5 lines with the following values:
276
277 HOSTNAME
278 PORT
279 USERNAME
280 PASSWORD
281 DATABASE
282 EOF
283 %endif
284
285 %post
286 /sbin/chkconfig --add dspam
287 if [ -f /var/lock/subsys/dspam ]; then
288         /etc/rc.d/init.d/dspam restart 1>&2
289 else
290         echo "Run \"/etc/rc.d/init.d/dspam start\" to start dspam daemon."
291 fi
292
293 %preun
294 if [ "$1" = "0" ]; then
295         if [ -f /var/lock/subsys/dspam ]; then
296                 /etc/rc.d/init.d/dspam stop 1>&2
297         fi
298         /sbin/chkconfig --del dspam
299 fi
300
301 %clean
302 rm -rf $RPM_BUILD_ROOT
303
304 %post   libs -p /sbin/ldconfig
305 %postun libs -p /sbin/ldconfig
306
307 %files
308 %defattr(644,root,root,755)
309 %doc README CHANGELOG RELEASE.NOTES UPGRADING
310 %doc cgi/base.css cgi/dspam.cgi
311 %if %{with mysql}
312 %doc doc/mysql_drv.txt
313 %doc src/tools.mysql_drv/*.sql
314 %endif
315 %if %{with pgsql}
316 %doc doc/pgsql_drv.txt
317 %doc src/tools.pgsql_drv/*.sql
318 %endif
319 %if %{without mysql} && %{without pgsql}
320 %doc doc/sqlite_drv.txt
321 %endif
322 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dspam.conf
323 %dir %attr(750,root,mail) /var/lib/%{name}
324 %{?with_mysql:%attr(640,root,mail) %config(noreplace) /var/lib/%{name}/mysql.data}
325 %{?with_pgsql:%attr(640,root,mail) %config(noreplace) /var/lib/%{name}/pgsql.data}
326 %attr(755,root,root) %config(noreplace) /etc/cron.daily/%{name}
327 %attr(755,root,mail) %{_bindir}/%{name}
328 %attr(755,root,mail) %{_bindir}/%{name}_logrotate
329 %attr(755,root,root) %{_bindir}/%{name}_clean
330 %attr(755,root,root) %{_bindir}/%{name}_corpus
331 %attr(755,root,root) %{_bindir}/%{name}_crc
332 %attr(755,root,root) %{_bindir}/%{name}_dump
333 %attr(755,root,root) %{_bindir}/%{name}_genaliases
334 %attr(755,root,root) %{_bindir}/%{name}_stats
335 %attr(755,root,root) %{_bindir}/%{name}_merge
336 %attr(755,root,root) %{_bindir}/%{name}_2sql
337 %attr(755,root,root) %{_bindir}/%{name}_admin
338 %{?with_pgsql:%attr(755,root,root) %{_bindir}/%{name}_pg2int8}
339 %{_mandir}/man?/%{name}*
340
341 %if %{with daemon}
342 %attr(754,root,root) /etc/rc.d/init.d/dspam
343 %files client
344 %defattr(644,root,root,755)
345 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dspam.conf
346 %endif
347 %attr(755,root,mail) %{_bindir}/%{name}c
348
349 %files libs
350 %defattr(644,root,root,755)
351 %doc README CHANGELOG
352 %attr(755,root,root) %{_libdir}/lib*.so.*.*.*
353
354 %files devel
355 %defattr(644,root,root,755)
356 %attr(755,root,root) %{_libdir}/lib*.so
357 %{_libdir}/lib*.la
358 %{_includedir}/%{name}
359 %{_mandir}/man3/libdspam*
360 %{_pkgconfigdir}/*.pc
361
362 %files static
363 %defattr(644,root,root,755)
364 %{_libdir}/lib*.a
This page took 0.070647 seconds and 4 git commands to generate.