# TODO: # - support for libdclassify # - oracle driver # - messages from default install of cron with mysql driver Memory fault # - install drivers in /usr/lib/dspam # - if drivers are installed to private dir, remove versioned sonames from drivers # - upgrade to 3.9.0 # # Conditional build: %bcond_without mysql # disable MySQL storage driver %bcond_without pgsql # disable PostgreSQL storage driver %bcond_without sqlite # disable SQLite3 storage driver %bcond_with mysql40 # use with mysql 4.0 %include /usr/lib/rpm/macros.perl Summary: A library and Mail Delivery Agent for Bayesian spam filtering Summary(pl.UTF-8): Biblioteka i MDA do bayesowskiego filtrowania spamu Name: dspam Version: 3.9.0 Release: 0.1 License: GPL Group: Applications/Mail Source0: http://downloads.sourceforge.net/project/dspam/dspam/dspam-%{version}/%{name}-%{version}.tar.gz # Source0-md5: 10d092b57d628d8c91655fee5dc0d0cd Patch0: %{name}-webui.patch Patch1: %{name}-config.patch Patch2: %{name}-speedup.patch Patch3: %{name}-autotools.patch Patch4: %{name}-single-char-usernames.patch Source1: %{name}.init Source2: %{name}-apache.conf URL: http://dspam.nuclearelephant.com/ BuildRequires: autoconf BuildRequires: automake BuildRequires: clamav-devel BuildRequires: libtool %{?with_mysql:BuildRequires: mysql-devel} BuildRequires: openldap-devel >= 2.4.6 %{?with_pgsql:BuildRequires: postgresql-devel} BuildRequires: rpm-perlprov >= 4.1-13 BuildRequires: rpmbuild(macros) >= 1.268 BuildRequires: sed >= 4.0 %{?with_sqlite:BuildRequires: sqlite3-devel} BuildRequires: zlib-devel Requires(post,preun): /sbin/chkconfig Requires: %{name}-common = %{version}-%{release} Requires: %{name}-driver = %{version}-%{release} Requires: rc-scripts BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %define _webapps /etc/webapps %define _webapp %{name} # Disable parallel build %define _smp_mflags %{nil} %description DSPAM (as in De-Spam) is an open-source project to create a new kind of anti-spam mechanism, and is currently effective 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. The DSPAM agent masquerades as the email server's local delivery agent and filters/learns spams using an advanced Bayesian statistical approach (based on Bayes's theorem of combined probabilities) which provides an administratively maintenance-free, easy-learning Anti-Spam service custom tailored to each individual user's behavior. Advanced because on top of standard Bayesian filtering is also incorporated the use of Chained Tokens, de-obfuscation, and other enhancements. DSPAM works great with Sendmail and Exim, and should work well with any other MTA that supports an external local delivery agent (postfix, qmail, etc.) %description -l pl.UTF-8 DSPAM (czyli De-Spam) to projekt o otwartych źródłach mający na celu stworzenie nowego rodzaju mechanizmu antyspamowego. Aktualnie jest efektywny zarówno jako działający po stronie serwera agent dla uniksowych serwerów pocztowych jak i biblioteka dla programistów klientów pocztowych, innych narzędzi antyspamowych i innych projektów wymagających filtrowania spamu w locie. Agent DSPAM zachowuje się jak lokalny agent dostarczania poczty (MDA) i filtruje/uczy się spamu przy użyciu zaawansowanego bayesowskiego przybliżenia statystycznego (opartego na twierdzeniu Bayesa o połączonych prawdopodobieństwach), dając nie wymagającą obsługi administracyjnej, łatwo uczącą się usługę antyspamową dostosowaną do zachowania każdego użytkownika. Metoda jest zaawansowana ponieważ na podstawie standardowego filtrowania bayesowskiego wprowadzono użycie tokenów łańcuchowych, eliminowanie ukrywanie i inne rozszerzenia. DSPAM działa wspaniale z Sendmailem i Eximem, powinien działać dobrze z każdym innym MTA obsługującym zewnętrznego agenta MDA (postfiksem, qmailem itd.). %package client Summary: dspam client Summary(pl.UTF-8): Klient dspam Group: Applications/Mail Requires: %{name}-common %description client dspam client. %description client -l pl.UTF-8 Klient dspam. %package common Summary: Common files for dspam packages Summary(pl.UTF-8): Wspólne pliki dla pakietów z dspamem Group: Applications/Mail %description common Common files for dspam and dspam-client packages. %description client -l pl.UTF-8 Wspólne pliki dla pakietów dspam i dspam-client. %package libs Summary: A library for Bayesian spam filtering Summary(pl.UTF-8): Biblioteka do bayesowskiego filtrowania spamu Group: Libraries Obsoletes: dspam-driver-db %description libs DSPAM (as in De-Spam) is an open-source project to create a new kind of anti-spam mechanism, and is currently effective 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. This package contains the library. %description libs -l pl.UTF-8 DSPAM (czyli De-Spam) to projekt o otwartych źródłach mający na celu stworzenie nowego rodzaju mechanizmu antyspamowego. Aktualnie jest efektywny zarówno jako działający po stronie serwera agent dla uniksowych serwerów pocztowych jak i biblioteka dla programistów klientów pocztowych, innych narzędzi antyspamowych i innych projektów wymagających filtrowania spamu w locie. Ten pakiet zawiera wspomnianą bibliotekę. %package devel Summary: Header files for the DSPAM library Summary(pl.UTF-8): Pliki nagłówkowe biblioteki DSPAM Group: Development/Libraries Requires: %{name}-libs = %{version}-%{release} %description devel DSPAM has had its core engine moved into a separate library, libdspam. This library can be used by developers to provide 'drop-in' spam filtering for their mail client applications, other anti-spam tools, or similar projects. %description devel -l pl.UTF-8 Główny silnik DSPAM został przeniesiony do oddzielnej biblioteki libdspam, która może być używana przez programistów do zapewnienia filtrowania spamu w locie dla aplikacji klientów pocztowych, innych narzędzi antyspamowych i podobnych projektów. %package static Summary: Static DSPAM library Summary(pl.UTF-8): Statyczna biblioteka DSPAM Group: Development/Libraries Requires: %{name}-devel = %{version}-%{release} %description static Static DSPAM library. %description static -l pl.UTF-8 Statyczna biblioteka DSPAM. %package driver-hash Summary: HASH driver for DSPAM Summary(pl.UTF-8): Sterownik HASH dla DSPAM-a Group: Libraries Requires(post): sed >= 4.0 Requires: %{name} = %{version}-%{release} Provides: %{name}-driver = %{version}-%{release} %description driver-hash HASH driver for DSPAM. %description driver-hash -l pl.UTF-8 Sterownik HASH dla DSPAM-a. %package driver-mysql Summary: MySQL driver for DSPAM Summary(pl.UTF-8): Sterownik MySQL dla DSPAM-a Group: Libraries Requires(post): sed >= 4.0 Requires: %{name} = %{version}-%{release} Provides: %{name}-driver = %{version}-%{release} %description driver-mysql MySQL driver for DSPAM. %description driver-mysql -l pl.UTF-8 Sterownik MySQL dla DSPAM-a. %package driver-pgsql Summary: PostgreSQL driver for DSPAM Summary(pl.UTF-8): Sterownik PostgreSQL dla DSPAM-a Group: Libraries Requires(post): sed >= 4.0 Requires: %{name} = %{version}-%{release} Provides: %{name}-driver = %{version}-%{release} %description driver-pgsql PostgreSQL driver for DSPAM. %description driver-pgsql -l pl.UTF-8 Sterownik PostgreSQL dla DSPAM-a. %package driver-sqlite3 Summary: SQLite driver for DSPAM Summary(pl.UTF-8): Sterownik SQLite dla DSPAM-a Group: Libraries Requires(post): sed >= 4.0 Requires: %{name} = %{version}-%{release} Provides: %{name}-driver = %{version}-%{release} Obsoletes: dspam-driver-sqlite %description driver-sqlite3 SQLite driver for DSPAM. %description driver-sqlite3 -l pl.UTF-8 Sterownik SQLite dla DSPAM-a. %package webui Summary: DSPAM Web UI Summary(pl.UTF-8): Interfejs WWW do programu DSPAM Group: Applications/WWW Requires: webapps # needs dspam binary Requires: %{name} = %{version}-%{release} %description webui The Web UI (CGI client) can be run from any executable location on a web server, and detects its user's identity from the REMOTE_USER environment variable. This means you'll need to use HTTP password authentication to access the CGI (Any type of authentication will work, so long as Apache supports the module). This is also convenient in that you can set up authentication using almost any existing system you have. The only catch is that you'll need the usernames to match the actual DSPAM usernames used the system. A copy of the shadow password file will suffice for most common installs. %description webui -l pl.UTF-8 Interfejs użytkownika WWW (klient CGI) może być uruchamiany z dowolnego wykonywalnego miejsca na serwerze WWW i rozpoznaje tożsamość użytkownika ze zmiennej środowiskowej REMOTE_USER. Oznacza to, że trzeba użyć uwietrzytelnienia HTTP z hasłem do dostępu do CGI (działać będzie dowolny rodzaj uwierzytelnienia obsługiwany przez moduły Apache'a). Jest to o tyle wygodne, że można skonfigurować uwierzytelnianie dla prawie każdego istniejącego systemu. Jedynym wymogiem jest, żeby nazwy użytkowników pokrywały się z nazwami użytkowników DSPAM-a używanymi w systemie. Kopia pliku shadow wystarczy dla większości popularnych instalacji. %prep %setup -q %patch0 -p1 %patch1 -p1 %patch2 -p1 %patch3 -p1 %patch4 -p1 sed -i -e 's#\-static##g' src/Makefile* src/*/Makefile* %{?with_mysql40:sed -i -e 's#40100#99999#g' src/mysql_drv.c} sed -i -e 's,/usr/local/dspam/bin,/usr/bin,' ./scripts/train.pl %build %{__libtoolize} %{__aclocal} -I m4 %{__autoconf} %{__automake} DRIVERS=" hash_drv %{?with_mysql:mysql_drv} %{?with_pgsql:pgsql_drv} %{?with_sqlite:sqlite3_drv} " %configure \ --disable-dependency-tracking \ %{?debug: --enable-debug --enable-bnr-debug --enable-verbose-debug} \ --enable-trusted-user-security \ --enable-large-scale \ --with-dspam-home=/var/lib/%{name} \ --with-dspam-home-owner=none \ --with-dspam-home-group=none \ --with-dspam-owner=none \ --with-dspam-group=none \ --enable-ldap \ --enable-clamav \ --enable-preferences-extension \ --enable-long-usernames \ --enable-virtual-users \ --with-storage-driver=$(echo $DRIVERS | tr ' ' ',') \ %if %{with mysql} --with-mysql-includes=%{_includedir}/mysql \ --with-mysql-libraries=%{_libdir} \ %endif %if %{with pgsql} --with-pgsql-includes=%{_includedir}/postgresql \ --with-pgsql-libraries=%{_libdir} \ %endif %if 0 %if %{with sqlite} --with-sqlite-includes=%{_includedir} \ --with-sqlite-libraries=%{_libdir} \ %endif %endif --enable-daemon # --enable-dclassify-extension needs libdclassify %{__make} %install rm -rf $RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT{/var/run/dspam,/etc/{rc.d/init.d,sysconfig}} \ $RPM_BUILD_ROOT/var/lib/%{name}/{txt,data} %{__make} install \ DESTDIR=$RPM_BUILD_ROOT install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/dspam cp -a txt/*.txt $RPM_BUILD_ROOT/var/lib/%{name}/txt # install devel files install -d $RPM_BUILD_ROOT{%{_includedir}/%{name},/var/{log,lib}/%{name}} install src/*.h $RPM_BUILD_ROOT%{_includedir}/%{name} # provide maintenance scripts install -d $RPM_BUILD_ROOT/etc/cron.{daily,weekly} cat > $RPM_BUILD_ROOT/etc/cron.daily/%{name} < $RPM_BUILD_ROOT/var/lib/%{name}/mysql.data < $RPM_BUILD_ROOT/var/lib/%{name}/pgsql.data <