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