Name: dspam Summary: Statistical Anti-Spam Filter URL: http://www.nuclearelephant.com/ Vendor: Jonathan A. Zdziarski & community Packager: Franta Hanzlik Group: System Environment/Daemons License: GPL Version: 3.9.0 %define subvers git.2009.09.17 Release: %{subvers}.daemon%{dist} Requires: perl-GD Requires: perl-GD-Graph3d Requires: perl-GDGraph Requires: perl-GDTextUtil Requires: perl-CGI-Simple BuildRequires: autoconf BuildArch: i586 # list of sources Source0: http://www.nuclearelephant.com/sources/dspam-%{version}-%{subvers}.tar.xz Source1: dspam_auth_fc4.sh Source2: dspam_auth_fc5.sh Source3: dspam_post.sh Source4: dspam-poznamky Source5: dspam1group.sh Source6: hash-sigclean.tgz # build information Prefix: %{_prefix} BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildPreReq: mysql-devel PreReq: mysql AutoReqProv: no #% {trace} #% {verbose} %description DSPAM (as in De-Spam) is an extremely scalable, open-source statistical anti-spam filter. While most commercial solutions only claim a mere 95%% accuracy (1 error in 20), a majority of DSPAM users frequently see around 99.95%% (1 error in 2000) and can sometimes reach peaks as high as 99.991%% (2 errors in 22,786). DSPAM presently functions as both a server-side agent for UNIX email servers and a developer's library for mail clients, other anti-spam tools, and similar projects requiring drop-in spam filtering. DSPAM has been implemented on many large and small scale systems. %package devel Summary: Development files and static library for dspam Group: Development/Libraries Requires: %{name} = %{version}-%{release}, pkgconfig %description devel Developers are able to link to the DSPAM core engine (libdspam) to provide "drop-in" spam-filtering for their applications. Examples of the libdspam API can be found in the example.c file included with this distribution. The dspam-devel package includes the libraries and include files that you will need to use libdspam. %prep [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT %setup -q -n %{name}-%{version}-%{subvers} %build if [ ! -f configure ]; then ./autogen.sh fi # --prefix=% {_prefix} \ # --mandir=% {_mandir} \ %configure \ --sysconfdir=%{_sysconfdir}/dspam \ --with-storage-driver="hash_drv,mysql_drv" \ --with-mysql-includes=/usr/include/mysql \ --with-mysql-libraries=/usr/lib/mysql \ --with-delivery-agent=/usr/bin/procmail.dspam \ --disable-homedir \ --with-dspam-home=%{_localstatedir}/dspam \ --with-dspam-home-mode=775 \ --with-dspam-home-owner="dspam" \ --with-dspam-home-group="dspam" \ --with-dspam-mode=2755 \ --enable-daemon \ --with-dspam-owner="dspam" \ --with-dspam-group="dspam" # --enable-domain-scale \ ## --with-dspam-home-owner="`%{l_shtool} echo -e %u`" \ ## --with-dspam-home-group="`%{l_shtool} echo -e %g`" \ # --with-dspam-mode=755 \ # --with-dspam-owner="`%{l_shtool} echo -e %u`" \ # --with-dspam-group="`%{l_shtool} echo -e %g`" \ ## --disable-homedir \ ## --disable-shared \ ## --enable-warnings=no \ make %install mkdir -p $RPM_BUILD_ROOT%{_bindir} make DESTDIR=$RPM_BUILD_ROOT install install -m 755 -d $RPM_BUILD_ROOT/var/dspam/txt cp -pd txt/*.txt $RPM_BUILD_ROOT/var/dspam/txt/ mkdir -p $RPM_BUILD_ROOT/var/www/dspam/html/templates cp -pdR webui/cgi-bin/templates/* $RPM_BUILD_ROOT/var/www/dspam/html/templates/ cp -pd webui/htdocs/*.css $RPM_BUILD_ROOT/var/www/dspam/html/ cp -pd webui/htdocs/*.gif $RPM_BUILD_ROOT/var/www/dspam/html/ cp -pd webui/cgi-bin/*.cgi $RPM_BUILD_ROOT/var/www/dspam/html/ cp -pd webui/cgi-bin/*.prefs $RPM_BUILD_ROOT/var/www/dspam/html/ cp -pd webui/cgi-bin/*.pl $RPM_BUILD_ROOT/var/www/dspam/html/ cp -pd webui/cgi-bin/admins $RPM_BUILD_ROOT/var/www/dspam/html/ cp -pd webui/cgi-bin/*.txt $RPM_BUILD_ROOT/var/www/dspam/html/ mkdir -p contrib/fedora install -p -m 0644 %SOURCE1 %SOURCE2 %SOURCE3 %SOURCE4 %SOURCE5 %SOURCE6 contrib/fedora %files %attr(0640,root,mail) %config /etc/dspam/dspam.conf %defattr(-, dspam, dspam, 2770) %dir /var/dspam %dir /var/dspam/log /var/dspam/txt/* %{_bindir}/* %defattr(-, root, root, 0775) %{_libdir}/*.so* %{_libdir}/dspam/*.so* ##% doc LICENSE README CHANGELOG UPGRADING RELEASE.NOTES doc/*.txt doc/*.sh #% doc %dir %{_docdir} %doc LICENSE README CHANGELOG UPGRADING RELEASE.NOTES doc/* %doc contrib/ # % doc ${RPM_BUILD_ROOT}%{_docdir}/%{name}-%{version}/fedora/contrib/* %doc %{_mandir}/man1/*.1* %defattr(-, dspam, dspam, 771) /var/www/dspam/* %files devel %defattr(-, root, root, 0755) %{_includedir}/* %{_libdir}/dspam/*.la %{_libdir}/*.a %{_libdir}/*.la %{_libdir}/dspam/*.a %{_libdir}/pkgconfig/*.pc %{_mandir}/man3/*.3* %pre # UID dspam-u nesmi byt systemove ("UID_MIN"), jinak suexec odmitne scripty spoustet. # Takže bez přepínače "-r" : useradd -G mail,apache -M -d /var/dspam -c "dspam agent account" -s /sbin/nologin dspam id dspam %post function echvhost(){ cat < DocumentRoot "/var/www/dspam/html" ServerName nospam._DOM_ ServerAdmin webmaster@_DOM_ ErrorLog logs/dspam._DOM_-error_log TransferLog logs/dspam._DOM_-access_log SSLEngine on SSLProtocol all -SSLv2 SSLCertificateFile /etc/pki/tls/certs/dspam._DOM_.crt DirectoryIndex dspam.cgi SuexecUserGroup dspam dspam AddExternalAuth for-dspam /usr/bin/pwauth SetExternalAuthMethod for-dspam pipe SSLOptions +StdEnvVars AddHandler cgi-script .cgi Options +FollowSymLinks +ExecCGI AllowOverride AuthConfig Order deny,allow Deny from all SSLRequireSSL AuthType Basic AuthName "DSPAM Control Center" # AuthName "Overeni uzivatelskeho pristupu" # AuthUserFile /etc/httpd/dspam._DOM_/htpasswd # Tohle je jen pro http 2.2 (FC4 s apache v2.0 to mit nesmi): AuthBasicProvider external AuthExternal for-dspam Require valid-user Satisfy Any EOF } DD=`dnsdomainname` [ "$DD" ] || DD=`uname -n|sed -e 's/^[^\.]\+\.\(.*\)/\1/'` [ "$DD" ] || DD=localdomain OF="/etc/httpd/conf.d/dspamssl.conf" [ -f "$OF" ] && OF="$OF.rpmnew" echvhost|sed -e "s/_DOM_/$DD/g" > "$OF" echo "$OF zalozen" # sed -e "s/_DOM_/$DD/g" /var/dspam/txt/firstrun_cz_pre.txt >/var/dspam/txt/firstrun_cz.txt sed -e "s/_DOM_/$DD/g" /var/dspam/txt/firstspam_cz_pre.txt >/var/dspam/txt/firstspam_cz.txt sed -e "s/_DOM_/$DD/g" /var/dspam/txt/quarantinefull_cz_pre.txt >/var/dspam/txt/quarantinefull_cz.txt # OF="/etc/aliases.dspam" awk 'BEGIN{FS=":"};(($3 >499) && ($3 < 64000) && ($5 !~ "pseudo")){printf "spam-%%s:\t\"|/etc/smrsh/dspam --class=spam --source=error --user %%s\"\n",$1,$1}' /etc/passwd > "$OF" echo "\"$OF\" zalozen" cp -a /usr/bin/procmail /usr/bin/procmail.dspam chgrp mail /usr/bin/procmail.dspam chmod 4750 /usr/bin/procmail.dspam ls -l /usr/bin/procmail.dspam [ -f /etc/smrsh/dspam ] && mv /etc/smrsh/dspam /etc/smrsh/dspam.rpmold ln -s /usr/bin/dspam /etc/smrsh/dspam if ! grep -q '^dspam' /etc/mail/trusted-users; then echo "dspam" >>/etc/mail/trusted-users; fi if [ -f /etc/mail/sendmail.mc ]; then sed -e "/^MAILER(smtp/i \dnl # Tyto 2 radky jsou pro DSPAM antispam:\\ define(\`LOCAL_MAILER_PATH', \`/usr/bin/dspam')\\ define(\`LOCAL_MAILER_ARGS', \`dspam -t -Y -a \$h \"--deliver=innocent\" --user \$u -d %%u')dnl" /etc/mail/sendmail.mc > /etc/mail/sendmail_dspam.mc else echo "\"/etc/mail/sendmail.mc\" not exist, local mailer definition is in \"/etc/mail/sendmail_dspam.mc\" !" echo "dnl # Tyto 2 radky jsou pro DSPAM antispam: define(\`LOCAL_MAILER_PATH', \`/usr/bin/dspam')dnl define(\`LOCAL_MAILER_ARGS', \`dspam -t -Y -a \$h \"--deliver=innocent\" --user \$u -d %%u')dnl" > /etc/mail/sendmail_dspam.mc fi pushd /etc/dspam >/dev/null cp -a dspam.conf dspam.conf.PUV sed -e "/^Trust daemon/a Trust dspam" -e 's/\(Notifications off\)/#\1\nNotifications on/' /etc/dspam/dspam.conf.PUV >/etc/dspam/dspam.conf echo "Notification on + dspam added as \"Trust user\" in dspam.conf" # Udela si to instalak sam, nebo ne?? # chown -R dspam:dspam /var/www/dspam chmod 755 /var/www/dspam chmod 644 /var/www/dspam/html/* chmod 754 /var/www/dspam/html/*.cgi chmod 644 /var/www/dspam/html/templates/* chmod 755 /var/www/dspam/html chmod 755 /var/www/dspam/html/templates /sbin/ldconfig %postun -p /sbin/ldconfig %post devel -p /sbin/ldconfig %postun devel -p /sbin/ldconfig %clean [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT %changelog * Sun Sep 24 2006 Franta Hanzlik - external post script