/[packages]/cauldron/dspam/current/SPECS/dspam.spec
ViewVC logotype

Contents of /cauldron/dspam/current/SPECS/dspam.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 131607 - (show annotations) (download)
Wed Aug 3 23:31:01 2011 UTC (12 years, 7 months ago) by dlucio
File size: 15723 byte(s)
trying to make this SPEC compatible with mageia so it will be easier for me
1 %define _disable_ld_no_undefined 1
2
3 %define major 7
4 %define libname %mklibname dspam %{major}
5 %define develname %mklibname dspam -d
6
7 Summary: A library and Mail Delivery Agent for Bayesian spam filtering
8 Name: dspam
9 Version: 3.10.0
10 Release: %mkrel 3
11 License: GPL
12 Group: System/Servers
13 URL: http://dspam.nuclearelephant.com/
14 Source0: http://dspam.nuclearelephant.com/sources/%{name}-%{version}.tar.gz
15 Source1: dspam_sa_trainer.tar.bz2
16 Source2: dspam.cf
17 Source3: dspam.cron
18 Source4: dspam.sysconfig
19 Source5: dspam.init
20 Patch0: dspam-modules.diff
21 Requires(post): rpm-helper
22 Requires(preun): rpm-helper
23 Requires: clamav clamd
24 BuildRequires: autoconf2.5
25 BuildRequires: automake
26 BuildRequires: mysql-devel
27 BuildRequires: sqlite3-devel
28 BuildRequires: postgresql-devel
29 BuildRequires: openldap-devel
30 BuildRequires: libtool
31 #BuildConflicts: sqlite-devel
32 Obsoletes: dspam-amavis
33 Obsoletes: dspam-db4
34 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
35
36 %description
37 DSPAM (as in De-Spam) is an open-source project to create a new
38 kind of anti-spam mechanism, and is currently effective as both a
39 server-side agent for UNIX email servers and a developer's library
40 for mail clients, other anti-spam tools, and similar projects
41 requiring drop-in spam filtering.
42
43 The DSPAM agent masquerades as the email server's local delivery
44 agent and filters/learns spams using an advanced Bayesian
45 statistical approach (based on Baye's theorem of combined
46 probabilities) which provides an administratively
47 maintenance-free, easy-learning Anti-Spam service custom tailored
48 to each individual user's behavior. Advanced because on top of
49 standard Bayesian filtering is also incorporated the use of
50 Chained Tokens, de-obfuscation, and other enhancements. DSPAM
51 works great with Sendmail and Exim, and should work well with
52 any other MTA that supports an external local delivery agent
53 (postfix, qmail, etc.)
54
55 %package -n %{libname}
56 Summary: A library and Mail Delivery Agent for Bayesian spam filtering
57 Group: System/Libraries
58 Conflicts: %{mklibname dspam 5}
59 Conflicts: %{mklibname dspam 6}
60 Conflicts: %{mklibname dspamdb4 6}
61 Conflicts: %{mklibname dspamamavis 6}
62
63 %description -n %{libname}
64 DSPAM (as in De-Spam) is an open-source project to create a new
65 kind of anti-spam mechanism, and is currently effective as both a
66 server-side agent for UNIX email servers and a developer's library
67 for mail clients, other anti-spam tools, and similar projects
68 requiring drop-in spam filtering.
69
70 The DSPAM agent masquerades as the email server's local delivery
71 agent and filters/learns spams using an advanced Bayesian
72 statistical approach (based on Baye's theorem of combined
73 probabilities) which provides an administratively
74 maintenance-free, easy-learning Anti-Spam service custom tailored
75 to each individual user's behavior. Advanced because on top of
76 standard Bayesian filtering is also incorporated the use of
77 Chained Tokens, de-obfuscation, and other enhancements. DSPAM
78 works great with Sendmail and Exim, and should work well with
79 any other MTA that supports an external local delivery agent
80 (postfix, qmail, etc.)
81
82 %package -n %{develname}
83 Summary: Development library and header files for the %{name} library
84 Group: Development/C
85 Requires: %{libname} = %{version}
86 Provides: %{name}-devel lib%{name}-devel
87 Obsoletes: %{mklibname dspam 5 -d}
88 Obsoletes: %{mklibname dspam 6 -d}
89 Obsoletes: %{mklibname dspam 7 -d}
90
91 %description -n %{develname}
92 DSPAM has had its core engine moved into a separate library,
93 libdspam. This library can be used by developers to provide
94 'drop-in' spam filtering for their mail client applications,
95 other anti-spam tools, or similar projects.
96
97 %package backend-mysql
98 Summary: The mysql driver for dspam
99 Group: System/Servers
100 Requires: %{name} = %{version}
101 Obsoletes: dspam-mysql
102 Obsoletes: %{mklibname dspammysql 6}
103
104 %description backend-mysql
105 The mysql driver for dspam
106
107 %package backend-pgsql
108 Summary: The pgsql driver for dspam
109 Group: System/Servers
110 Requires: %{name} = %{version}
111 Obsoletes: dspam-pgsql
112 Obsoletes: %{mklibname dspampgsql 6}
113
114 %description backend-pgsql
115 The pgsql driver for dspam
116
117 %package backend-sqlite3
118 Summary: The sqlite3 driver for dspam
119 Group: System/Servers
120 Requires: %{name} = %{version}
121
122 %description backend-sqlite3
123 The sqlite3 driver for dspam
124
125 %package cgi
126 Summary: Web administration GUI for DSPAM
127 Group: System/Servers
128 Requires: apache
129 Requires: %{name} = %{version}
130
131 %description cgi
132 Web administration GUI for DSPAM.
133
134 %prep
135
136 %setup -q -n %{name}-%{version} -a1
137 %patch0 -p1
138
139 # instead of maintaining patches...
140 find -type f -name "Makefile*" | xargs perl -pi -e "s|-static||g"
141
142 cp %{SOURCE2} dspam.cf
143 cp %{SOURCE3} dspam.cron
144 cp %{SOURCE4} dspam.sysconfig
145 cp %{SOURCE5} dspam.init
146
147 %build
148 export WANT_AUTOCONF_2_5=1
149 rm -f configure
150 autoreconf -fis
151 ln -snf %{_bindir}/libtool .
152
153 #sh ./autogen.sh
154
155 %configure2_5x \
156 --enable-daemon \
157 --enable-ldap \
158 --enable-trusted-user-security \
159 --enable-clamav \
160 --enable-neural-networking \
161 --enable-long-usernames \
162 --enable-domain-scale \
163 --enable-virtual-users \
164 --with-dspam-home=%{_localstatedir}/lib/dspam \
165 --with-logdir=/var/log/dspam \
166 --with-storage-driver=hash_drv,mysql_drv,pgsql_drv,sqlite3_drv \
167 --with-mysql-includes=%{_includedir}/mysql --with-mysql-libraries=%{_libdir} \
168 --with-pgsql-includes=%{_includedir} --with-pgsql-libraries=%{_libdir} \
169 --with-sqlite3-includes=%{_includedir} --with-sqlite3-libraries=%{_libdir}
170
171 %install
172 rm -rf %{buildroot}
173
174 # make some dirs
175 install -d %{buildroot}%{_includedir}/dspam
176 install -d %{buildroot}%{_initrddir}
177 install -d %{buildroot}%{_sysconfdir}/mail/spamassassin
178 install -d %{buildroot}%{_sysconfdir}/cron.daily
179 install -d %{buildroot}%{_sysconfdir}/logrotate.d
180 install -d %{buildroot}%{_sysconfdir}/httpd/conf/webapps.d
181 install -d %{buildroot}%{_sysconfdir}/sysconfig
182 install -d %{buildroot}%{_sysconfdir}/ld.so.conf.d
183 install -d %{buildroot}%{_libdir}/dspam
184 install -d %{buildroot}%{_localstatedir}/lib/dspam/data
185 install -d %{buildroot}/var/log/dspam
186 install -d %{buildroot}/var/run/dspam
187 install -d %{buildroot}/var/www/icons
188 install -d %{buildroot}%{_datadir}/dspam/cgi-bin/templates
189 install -d %{buildroot}%{_datadir}/dspam-sqlite3
190 install -d %{buildroot}%{_datadir}/dspam-mysql
191 install -d %{buildroot}%{_datadir}/dspam-pgsql
192
193 %makeinstall_std
194
195 # install promo icon
196 install -m0644 webui/htdocs/dspam-logo-small.gif %{buildroot}/var/www/icons/dspam.gif
197
198 # install /etc stuff
199 install -m0755 dspam.cron %{buildroot}%{_sysconfdir}/cron.daily/dspam
200 install -m0644 dspam.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/dspam
201 install -m0755 dspam.init %{buildroot}%{_initrddir}/dspam
202
203 # nuke unwanted devel files
204 rm -f %{buildroot}%{_libdir}/dspam/lib*_drv.*a
205
206 # install sql stuff
207 install -m0644 src/tools.sqlite_drv/*.sql %{buildroot}%{_datadir}/dspam-sqlite3/
208 install -m0644 src/tools.mysql_drv/*.sql %{buildroot}%{_datadir}/dspam-mysql/
209 install -m0644 src/tools.pgsql_drv/*.sql %{buildroot}%{_datadir}/dspam-pgsql/
210
211 # install the cgi stuff
212 install -m0755 webui/cgi-bin/*.cgi %{buildroot}%{_datadir}/dspam/cgi-bin/
213 install -m0755 webui/cgi-bin/configure.pl %{buildroot}%{_datadir}/dspam/cgi-bin/
214 install -m0644 webui/cgi-bin/*.txt %{buildroot}%{_datadir}/dspam/cgi-bin/
215 install -m0644 webui/cgi-bin/default.prefs %{buildroot}%{_datadir}/dspam/cgi-bin/
216 install -m0644 webui/cgi-bin/admins %{buildroot}%{_datadir}/dspam/cgi-bin/
217 install -m0644 webui/htdocs/*.css %{buildroot}%{_datadir}/dspam/cgi-bin/
218 install -m0644 webui/htdocs/*.gif %{buildroot}%{_datadir}/dspam/cgi-bin/
219 install -m0644 webui/cgi-bin/templates/*.html %{buildroot}%{_datadir}/dspam/cgi-bin/templates/
220
221 # fix webroot
222 perl -pi -e "s|\"\/\"\;|\"\/dspam\"\;|g" %{buildroot}%{_datadir}/dspam/cgi-bin/configure.pl
223
224 cat > dspam.apache2 << EOF
225
226 Alias /dspam %{_datadir}/dspam/cgi-bin
227
228 <Directory %{_datadir}/dspam/cgi-bin/>
229
230 Options ExecCGI
231 AllowOverride Limit AuthConfig
232 DirectoryIndex dspam.cgi
233
234 Order deny,allow
235 Deny from all
236 allow from 127.0.0.1
237
238 AuthUserFile %{_datadir}/dspam/cgi-bin/.htpasswd
239 AuthGroupFile /dev/null
240 AuthName "Authorization required"
241 AuthType Basic
242
243 <Limit GET>
244 require user root
245 require user dspamadmin
246 </Limit>
247
248 </Directory>
249 EOF
250 install -m0644 dspam.apache2 %{buildroot}%{_sysconfdir}/httpd/conf/webapps.d/dspam.conf
251 echo "dspamadmin:h7Sr5nPztyPjU" > %{buildroot}%{_datadir}/dspam/cgi-bin/.htpasswd
252 echo "dspamadmin" >> %{buildroot}%{_datadir}/dspam/cgi-bin/admins
253
254 cat > dspam.logrotate << EOF
255 /var/log/dspam/*.log {
256 missingok
257 monthly
258 compress
259 postrotate
260 /bin/kill -HUP \`cat /var/run/dspam/dspam.pid 2> /dev/null\` || /bin/true
261 endscript
262 }
263 EOF
264 install -m0644 dspam.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/dspam
265
266 # fix strange perms (strip cannot access setuid/sgid files...)
267 chmod 755 %{buildroot}%{_bindir}/*
268
269 # install spamassassin stuff
270 install -m0644 dspam.cf %{buildroot}%{_sysconfdir}/mail/spamassassin
271
272 # fix default config (patches won't apply here...)
273 perl -pi -e "s|^#ServerDomainSocketPath.*|ServerDomainSocketPath \"%{_localstatedir}/lib/dspam/dspam\.sock\"|g" %{buildroot}%{_sysconfdir}/dspam.conf
274 perl -pi -e "s|^#ClientHost.*|ClientHost \"%{_localstatedir}/lib/dspam/dspam\.sock\"|g" %{buildroot}%{_sysconfdir}/dspam.conf
275 perl -pi -e "s|^#ServerPID.*|ServerPID \"/var/run/dspam/dspam\.pid\"|g" %{buildroot}%{_sysconfdir}/dspam.conf
276 perl -pi -e "s|^#ServerMode.*|ServerMode dspam|g" %{buildroot}%{_sysconfdir}/dspam.conf
277
278 # fix strange perms
279 chmod 644 doc/*
280
281 # provide a README.urpmi file
282 cat > README.urpmi << EOF
283
284 Due huge changes in the source an upgrade from 3.4.x to 3.6.x has to be done
285 manually, please read these files:
286
287 %{_docdir}/%{name}-%{version}/RELEASE.NOTES
288 %{_docdir}/%{name}-%{version}/UPGRADING
289
290 The previous 3.4.x packages was specially handcrafted so that you could use each
291 driver and even toggle between them, or use them simultaneousely. This is not
292 nessesary anymore and that magic has therefore been removed.
293
294 The Berkley-DB backend driver has been removed as it is prone to give errors due
295 lack of thread safety as outlined in the dspam documentation.
296
297 The amavis-new tailored package has been removed, it may reappear later on.
298
299 You will have to define a proper cron command to use for daily cleanups. Look
300 in the %{_sysconfdir}/sysconfig/dspam file for some examples.
301
302 For example when executing dspam with the mysql driver it is possible it will
303 complain that it cannot find a %{_localstatedir}/lib/dspam/mysql.data file. This
304 is for backward compatibility. Do not use this file, edit the %{_sysconfdir}/dspam.conf
305 file instead.
306
307 The dspam-cgi web interface is password protected and only accessable from 127.0.0.1,
308 login as dspamadmin (l/p=dspamadmin) and change this ASAP in the
309 %{_datadir}/dspam/cgi-bin/.htpasswd file. Preferably you should use some other
310 authentication mechanish.
311 EOF
312
313 echo "%{_libdir}/dspam" > %{buildroot}%{_sysconfdir}/ld.so.conf.d/dspam.conf
314
315 %post
316 %_post_service dspam
317
318 %preun
319 %_preun_service dspam
320
321 %post cgi
322 if [ -f /var/lock/subsys/httpd ]; then
323 %{_initrddir}/httpd restart 1>&2;
324 fi
325
326 %postun cgi
327 if [ "$1" = "0" ]; then
328 if [ -f /var/lock/subsys/httpd ]; then
329 %{_initrddir}/httpd restart 1>&2
330 fi
331 fi
332
333 %if "%{distribution}" == "Mandriva Linux"
334 %if %mdkversion < 200900
335 %post -n %{libname} -p /sbin/ldconfig
336
337 %postun -n %{libname} -p /sbin/ldconfig
338
339 %post backend-mysql -p /sbin/ldconfig
340
341 %postun backend-mysql -p /sbin/ldconfig
342
343 %post backend-pgsql -p /sbin/ldconfig
344
345 %postun backend-pgsql -p /sbin/ldconfig
346
347 %post backend-sqlite3 -p /sbin/ldconfig
348
349 %postun backend-sqlite3 -p /sbin/ldconfig
350 %endif
351 %endif
352
353 %clean
354 rm -rf %{buildroot}
355
356 %files
357 %defattr(-,root,root)
358 %doc README* RELEASE.NOTES CHANGELOG txt/*.txt dspam_sa_trainer
359 %doc doc/courier.txt doc/exim.txt doc/markov.txt doc/pop3filter.txt
360 %doc doc/postfix.txt doc/qmail.txt doc/relay.txt doc/sendmail.txt
361 %attr(0755,root,root) %{_initrddir}/dspam
362 %attr(0755,root,root) %{_sysconfdir}/cron.daily/dspam
363 %attr(0644,root,mail) %config(noreplace) %{_sysconfdir}/dspam.conf
364 %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/sysconfig/dspam
365 %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/logrotate.d/dspam
366 %attr(0644,root,mail) %config(noreplace) %{_sysconfdir}/mail/spamassassin/dspam.cf
367 %attr(0644,root,mail) %config(noreplace) %{_sysconfdir}/ld.so.conf.d/dspam.conf
368 %attr(0755,root,root) %{_bindir}/cssclean
369 %attr(0755,root,root) %{_bindir}/csscompress
370 %attr(0755,root,root) %{_bindir}/cssconvert
371 %attr(0755,root,root) %{_bindir}/cssstat
372 %attr(0755,root,mail) %{_bindir}/dspam_admin
373 %attr(0755,root,mail) %{_bindir}/dspam
374 %attr(0755,root,root) %{_bindir}/dspam_2sql
375 %attr(0755,root,root) %{_bindir}/dspam_clean
376 %attr(0755,root,root) %{_bindir}/dspam_crc
377 %attr(0755,root,root) %{_bindir}/dspamc
378 %attr(0755,root,root) %{_bindir}/dspam_dump
379 %attr(0755,root,root) %{_bindir}/dspam_logrotate
380 %attr(0755,root,root) %{_bindir}/dspam_merge
381 %attr(0755,root,root) %{_bindir}/dspam_stats
382 %attr(0755,root,root) %{_bindir}/dspam_train
383 %attr(0755,root,root) %{_bindir}/dspam_notify
384 %attr(0644,root,root) %{_mandir}/man1/dspam.1*
385 %attr(0644,root,root) %{_mandir}/man1/dspam_clean.1*
386 %attr(0644,root,root) %{_mandir}/man1/dspam_dump.1*
387 %attr(0644,root,root) %{_mandir}/man1/dspam_merge.1*
388 %attr(0644,root,root) %{_mandir}/man1/dspam_stats.1*
389 %attr(0644,root,root) %{_mandir}/man1/dspam_train.1*
390 %attr(0644,root,root) %{_mandir}/man1/dspam_admin.1*
391 %attr(0644,root,root) %{_mandir}/man1/dspam_crc.1*
392 %attr(0644,root,root) %{_mandir}/man1/dspam_logrotate.1*
393 %attr(0644,root,root) /var/www/icons/dspam.gif
394 %dir %attr(0750,root,mail) %{_localstatedir}/lib/dspam
395 %dir %attr(0750,root,mail) %{_localstatedir}/lib/dspam/data
396 %dir %attr(0755,root,root) %{_datadir}/dspam
397 %dir %attr(0750,root,mail) /var/log/dspam
398 %dir %attr(0750,root,root) /var/run/dspam
399
400 %files -n %{libname}
401 %defattr(-,root,root)
402 %attr(0755,root,root) %{_libdir}/libdspam.so.*
403 %attr(0755,root,root) %{_libdir}/dspam/libhash_drv.so
404
405 %files -n %{develname}
406 %defattr(-,root,root)
407 %attr(0755,root,root) %{_libdir}/libdspam.so
408 %attr(0644,root,root) %{_libdir}/libdspam.*a
409 %{_includedir}/dspam
410 %attr(0644,root,root) %{_libdir}/pkgconfig/dspam.pc
411 %attr(0644,root,root) %{_mandir}/man3/*
412
413 %files backend-mysql
414 %defattr(-,root,root)
415 %doc doc/mysql_drv.txt
416 %attr(0755,root,root) %{_libdir}/dspam/libmysql_drv.so
417 %dir %attr(0755,root,root) %{_datadir}/dspam-mysql
418 %attr(0644,root,root) %{_datadir}/dspam-mysql/*
419
420 %files backend-pgsql
421 %defattr(-,root,root)
422 %doc doc/pgsql_drv.txt
423 %attr(0755,root,root) %{_libdir}/dspam/libpgsql_drv.so
424 %attr(0755,root,root) %{_bindir}/dspam_pg2int8
425 %dir %attr(0755,root,root) %{_datadir}/dspam-pgsql
426 %attr(0644,root,root) %{_datadir}/dspam-pgsql/*
427
428 %files backend-sqlite3
429 %defattr(-,root,root)
430 %doc doc/sqlite_drv.txt
431 %attr(0755,root,root) %{_libdir}/dspam/libsqlite3_drv.so
432 %{_datadir}/dspam-sqlite3
433
434 %files cgi
435 %defattr(-,root,root)
436 %dir %attr(0755,root,root) %{_datadir}/dspam/cgi-bin
437 %dir %attr(0755,root,root) %{_datadir}/dspam/cgi-bin/templates
438 %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/httpd/conf/webapps.d/dspam.conf
439 %attr(0644,root,root) %config(noreplace) %{_datadir}/dspam/cgi-bin/default.prefs
440 %attr(0644,root,root) %config(noreplace) %{_datadir}/dspam/cgi-bin/admins
441 %attr(0644,root,root) %config(noreplace) %{_datadir}/dspam/cgi-bin/.htpasswd
442 %attr(0644,root,root) %{_datadir}/dspam/cgi-bin/*.txt
443 %attr(0644,root,root) %{_datadir}/dspam/cgi-bin/*.gif
444 %attr(0644,root,root) %{_datadir}/dspam/cgi-bin/*.css
445 %attr(0755,root,root) %{_datadir}/dspam/cgi-bin/*.cgi
446 %attr(0755,root,root) %{_datadir}/dspam/cgi-bin/*.pl
447 %attr(0644,root,root) %{_datadir}/dspam/cgi-bin/templates/*.html

  ViewVC Help
Powered by ViewVC 1.1.30