X-Git-Url: http://git.pld-linux.org/?p=packages%2Fdspam.git;a=blobdiff_plain;f=dspam.spec;h=07d11c22bc88c8fa17b1b29abffdbb63faac968e;hp=c4cf44a105c2a6d2b061ac7e4f4b0021aa659a18;hb=411ba1cab285fcd99f86c3075dfa11b0a4d8f2af;hpb=3a30d34c65968f31b46501a461925630b722c2b0 diff --git a/dspam.spec b/dspam.spec index c4cf44a..07d11c2 100644 --- a/dspam.spec +++ b/dspam.spec @@ -1,37 +1,53 @@ -# TODO: everything +# TODO: +# - support for libdclassify +# - oracle driver +# - messages from default install of cron with mysql driver Memory fault +# - installing dspam and dspam-client on same host causes +# /etc/dspam.conf being owned by both packages and .rpmnew files being +# created. move the config to -libs? -common? patch code to use +# different config for client? # # Conditional build: -%bcond_with mysql # enable MySQL storage driver (disable sqlite driver) -%bcond_with pgsql # enable PostgreSQL storage driver (disable sqlite driver) -%bcond_with sqlite3 # enable SQLite3 storage driver (disable sqlite2 driver) +%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): Biblioteka i MDA do bayesowskiego filtrowania spamu Name: dspam -Version: 3.4.8 +Version: 3.6.8 Release: 0.1 License: GPL Group: Applications/Mail Source0: http://www.nuclearelephant.com/projects/dspam/sources/%{name}-%{version}.tar.gz -# Source0-md5: b6930c31fe0940b8ad6d27324f8bab3e +# Source0-md5: c4b1a7079690ee16d8b0f36b2a2a90a4 +Patch0: %{name}-webui.patch +Patch1: %{name}-config.patch +Patch2: %{name}-speedup.patch +Source1: %{name}.init +Source2: %{name}-apache.conf URL: http://www.nuclearelephant.com/projects/dspam/ -%if %{with mysql} -BuildRequires: mysql-devel -%else -%if %{with pgsql} -BuildRequires: postgresql-devel -%else -%if %{with sqlite3} -BuildRequires: sqlite3-devel -%else -BuildRequires: sqlite-devel -BuildRequires: sqlite-static -%endif -%endif -%endif +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: clamav-devel +BuildRequires: libtool +%{?with_mysql:BuildRequires: mysql-devel} +BuildRequires: openldap-devel +%{?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: rc-scripts Buildroot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) +%define _webapps /etc/webapps +%define _webapp %{name} + %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 @@ -70,10 +86,25 @@ DSPAM dzia z ka¿dym innym MTA obs³uguj±cym zewnêtrznego agenta MDA (postfiksem, qmailem itd.). +%package client +Summary: dspam client +Summary(pl): Klient dspam +Group: Applications/Mail +# to get the same dspam.conf when both installed +Conflicts: dspam < %{version}-%{release} +Conflicts: dspam > %{version}-%{release} + +%description client +dspam client. + +%description client -l pl +Klient dspam. + %package libs Summary: A library for Bayesian spam filtering Summary(pl): Biblioteka do bayesowskiego filtrowania spamu Group: Libraries +Requires: %{name}-driver = %{version}-%{release} %description libs DSPAM (as in De-Spam) is an open-source project to create a new kind @@ -124,66 +155,172 @@ Static DSPAM library. %description static -l pl Statyczna biblioteka DSPAM. +%package driver-hash +Summary: HASH driver for DSPAM +Summary(pl): Sterownik HASH dla DSPAM-a +Group: Libraries +Requires(post): sed >= 4.0 +Requires: %{name}-libs = %{version}-%{release} +Provides: %{name}-driver = %{version}-%{release} + +%description driver-hash +HASH driver for DSPAM. + +%description driver-hash -l pl +Sterownik HASH dla DSPAM-a. + +%package driver-mysql +Summary: MySQL driver for DSPAM +Summary(pl): Sterownik MySQL dla DSPAM-a +Group: Libraries +Requires(post): sed >= 4.0 +Requires: %{name}-libs = %{version}-%{release} +Provides: %{name}-driver = %{version}-%{release} + +%description driver-mysql +MySQL driver for DSPAM. + +%description driver-mysql -l pl +Sterownik MySQL dla DSPAM-a. + +%package driver-pgsql +Summary: PostgreSQL driver for DSPAM +Summary(pl): Sterownik PostgreSQL dla DSPAM-a +Group: Libraries +Requires(post): sed >= 4.0 +Requires: %{name}-libs = %{version}-%{release} +Provides: %{name}-driver = %{version}-%{release} + +%description driver-pgsql +PostgreSQL driver for DSPAM. + +%description driver-pgsql -l pl +Sterownik PostgreSQL dla DSPAM-a. + +%package driver-sqlite +Summary: SQLite driver for DSPAM +Summary(pl): Sterownik SQLite dla DSPAM-a +Group: Libraries +Requires(post): sed >= 4.0 +Requires: %{name}-libs = %{version}-%{release} +Provides: %{name}-driver = %{version}-%{release} + +%description driver-sqlite +SQLite driver for DSPAM. + +%description driver-sqlite -l pl +Sterownik SQLite dla DSPAM-a. + +%package webui +Summary: DSPAM Web UI +Summary(pl): 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 +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 -sed -i -e 's#-static##g' src/tools/Makefile* +%patch0 -p1 +%patch1 -p1 +%patch2 -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:sqlite_drv} +" %configure \ + --disable-dependency-tracking \ + %{?debug: --enable-debug --enable-bnr-debug --enable-verbose-debug} \ --enable-trusted-user-security \ - --enable-bayesian-dobly \ - --enable-chained-tokens \ - --enable-experimental \ --enable-bias \ --enable-large-scale \ - --enable-delivery-to-stdout \ --with-userdir=/var/lib/%{name} \ - --with-dspam-home=/var/lib/%{name} \ --with-userdir-owner=none \ --with-userdir-group=none \ + --with-dspam-home=/var/lib/%{name} \ + --with-dspam-home-owner=none \ + --with-dspam-home-group=none \ --with-dspam-owner=none \ --with-dspam-group=none \ --with-signature-life=14 \ - --disable-dependency-tracking \ -%if %{with mysql} + --enable-ldap \ + --enable-clamav \ + --enable-preferences-extension \ + --enable-long-usernames \ + --enable-neural-networking \ --enable-virtual-users \ - --with-storage-driver=mysql_drv \ + --with-storage-driver=$(echo $DRIVERS | tr ' ' ',') \ +%if %{with mysql} --with-mysql-includes=%{_includedir}/mysql \ - --with-mysql-libraries=%{_libdir} -%else + --with-mysql-libraries=%{_libdir} \ +%endif %if %{with pgsql} - --enable-virtual-users \ - --with-storage-driver=pgsql_drv \ --with-pgsql-includes=%{_includedir}/postgresql \ - --with-pgsql-libraries=%{_libdir} -%else -%if %{with sqlite3} - --with-storage-driver=sqlite3_drv \ - --with-sqlite3-includes=%{_includedir} \ - --with-sqlite3-libraries=%{_libdir} -%else - --with-storage-driver=sqlite_drv \ - --with-sqlite-includes=%{_includedir} \ - --with-sqlite-libraries=%{_libdir} -%endif + --with-pgsql-libraries=%{_libdir} \ %endif +%if %{with sqlite} + --with-sqlite3-includes=%{_includedir} \ + --with-sqlite3-libraries=%{_libdir} \ %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/lib/%{name}} +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 -install -d $RPM_BUILD_ROOT/etc/cron.weekly - +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 <