]> git.pld-linux.org Git - packages/dspam.git/blobdiff - dspam.spec
- BR: sed >= 4.0
[packages/dspam.git] / dspam.spec
index 62d147102d555f24aeea2db133659be8a72c5479..cbd13371862499444093da40a5cf4edaf9eddc9c 100644 (file)
@@ -1,12 +1,30 @@
+# TODO: everything
+#
+# Conditional build:
+%bcond_with    mysql   # enable MySQL storage driver (disable sqlite driver)
+%bcond_with    pgsql   # enable PostgreSQL storage driver (disable sqlite driver)
+#
 Summary:       A library and Mail Delivery Agent for Bayesian spam filtering
+Summary(pl):   Biblioteka i MDA do bayesowskiego filtrowania spamu
 Name:          dspam
-Version:       2.10.6
-Release:       1
+Version:       3.2.7
+Release:       0.1
 License:       GPL
 Group:         Applications/Mail
 Source0:       http://www.nuclearelephant.com/projects/dspam/sources/%{name}-%{version}.tar.gz
+# Source0-md5: f2bc9fb56ab6f21ef0b0ec7a3d453121
+Patch0:                %{name}-Makefile.patch
 URL:           http://www.nuclearelephant.com/projects/dspam/
+%if %{with mysql}
 BuildRequires: mysql-devel
+%else 
+%if %{with pgsql}
+BuildRequires: postgresql-devel
+%else
+BuildRequires: sqlite-devel
+%endif
+%endif
+BuildRequires: sed >= 4.0
 Buildroot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -18,7 +36,7 @@ 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 Baye's theorem of combined probabilities) which
+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
@@ -27,8 +45,29 @@ 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
+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 libs
-Summary:       A library and Mail Delivery Agent for Bayesian spam filtering
+Summary:       A library for Bayesian spam filtering
+Summary(pl):   Biblioteka do bayesowskiego filtrowania spamu
 Group:         Libraries
 
 %description libs
@@ -38,19 +77,21 @@ 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 Baye'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.)
+This package contains the library.
+
+%description libs -l pl
+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:       Development library and header files for the %{name} library
+Summary:       Header files for the DSPAM library
+Summary(pl):   Pliki nag³ówkowe biblioteki DSPAM
 Group:         Development/Libraries
 Requires:      %{name}-libs = %{version}-%{release}
 
@@ -60,69 +101,103 @@ 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
+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):   Statyczna biblioteka DSPAM
+Group:         Development/Libraries
+Requires:      %{name}-devel = %{version}-%{release}
+
+%description static
+Static DSPAM library.
+
+%description static -l pl
+Statyczna biblioteka DSPAM.
+
 %prep
 %setup -q
+%patch0 -p1
+sed -i -e 's#-static##g' tools/Makefile*
 
 %build
-%configure2_13 \
-    --enable-trusted-user-security \
-    --enable-bayesian-dobly \
-    --enable-chained-tokens \
-    --enable-neural-networking \
-    --enable-experimental \
-    --enable-signature-attachments \
-    --enable-bias \
-    --enable-large-scale \
-    --enable-delivery-to-stdout \
-    --enable-virtual-users \
-    --with-userdir=/var/lib/%{name} \
-    --with-userdir-owner=none \
-    --with-userdir-group=none \
-    --with-dspam-owner=none \
-    --with-dspam-group=none \
-    --with-signature-life=14 \
-    --disable-dependency-tracking \
-    --enable-virtual-users \
-    --with-storage-driver=mysql_drv \
-    --with-mysql-includes=%{_includedir}/mysql \
-    --with-mysql-libraries=%{_libdir}/mysql \
+%configure \
+       --enable-trusted-user-security \
+       --enable-bayesian-dobly \
+       --enable-chained-tokens \
+       --enable-experimental \
+       --enable-bias \
+       --enable-large-scale \
+       --enable-delivery-to-stdout \
+       --enable-virtual-users \
+       --with-userdir=/var/lib/%{name} \
+       --with-dspam-home=/var/lib/%{name} \
+       --with-userdir-owner=none \
+       --with-userdir-group=none \
+       --with-dspam-owner=none \
+       --with-dspam-group=none \
+       --with-signature-life=14 \
+       --disable-dependency-tracking \
+%if %{with mysql}
+       --enable-virtual-users \
+       --with-storage-driver=mysql_drv \
+       --with-mysql-includes=%{_includedir}/mysql \
+       --with-mysql-libraries=%{_libdir}
+%else
+%if %{with pgsql}
+       --enable-virtual-users \
+       --with-storage-driver=pgsql_drv \
+       --with-pgsql-includes=%{_includedir}/postgresql \
+       --with-pgsql-libraries=%{_libdir}
+%else
+       --with-storage-driver=sqlite_drv \
+       --with-sqlite-includes=%{_includedir} \
+       --with-sqlite-libraries=%{_libdir}
+%endif
+%endif
 %{__make}
 
 %install
 rm -rf $RPM_BUILD_ROOT
 
-%makeinstall_std
+%{__make} install \
+       DESTDIR=$RPM_BUILD_ROOT
 
 # install devel files
-install -d %{buildroot}%{_includedir}/%{name}
-install -m0644 libdspam.h %{buildroot}%{_includedir}/%{name}/
-install -m0644 libdspam_objects.h %{buildroot}%{_includedir}/%{name}/
-install -m0644 lht.h %{buildroot}%{_includedir}/%{name}/
-install -m0644 nodetree.h %{buildroot}%{_includedir}/%{name}/
+install -d $RPM_BUILD_ROOT{%{_includedir}/%{name},/var/lib/%{name}}
+install -m0644 libdspam.h $RPM_BUILD_ROOT%{_includedir}/%{name}
+install -m0644 libdspam_objects.h $RPM_BUILD_ROOT%{_includedir}/%{name}
+install -m0644 lht.h $RPM_BUILD_ROOT%{_includedir}/%{name}
+install -m0644 nodetree.h $RPM_BUILD_ROOT%{_includedir}/%{name}
 
 # provide maintenance scripts
-install -d %{buildroot}%{_sysconfdir}/cron.daily
-install -d %{buildroot}%{_sysconfdir}/cron.weekly
+install -d $RPM_BUILD_ROOT/etc/cron.daily
+install -d $RPM_BUILD_ROOT/etc/cron.weekly
 
-cat > %{buildroot}%{_sysconfdir}/cron.daily/%{name} <<EOF
+cat > $RPM_BUILD_ROOT/etc/cron.daily/%{name} <<EOF
 #!/bin/sh
-exec %{_bindir}/%{name}_clean 2>&1 > /dev/null
+exec %{_bindir}/%{name}_clean -s -p
 EOF
 
-chmod 755 %{buildroot}%{_sysconfdir}/cron.daily/%{name}
+chmod 755 $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily/%{name}
 
 # fix prefix
-perl -pi -e "s|%{_prefix}/local|%{_prefix}|g" %{buildroot}%{_bindir}/%{name}_corpus
-perl -pi -e "s|%{_prefix}/local|%{_prefix}|g" cgi/dspam.cgi
-
-cp tools.mysql_drv/README README.mysql
+sed -i -e "s|%{_prefix}/local|%{_prefix}|g" $RPM_BUILD_ROOT%{_bindir}/%{name}_corpus
+sed -i -e "s|%{_prefix}/local|%{_prefix}|g" cgi/dspam.cgi
 
 # fix purge stuff
-install -m0755 dspam-cron.weekly %{buildroot}%{_sysconfdir}/cron.weekly/%{name}
+#install -m0755 dspam-cron.weekly $RPM_BUILD_ROOT%{_sysconfdir}/cron.weekly/%{name}
+
+%if %{with mysql}
+cp tools.mysql_drv/README README.mysql
 
 # fix missing file
-install -d %{buildroot}/var/lib/%{name}
-cat > %{buildroot}/var/lib/%{name}/mysql.data <<EOF
+install -d $RPM_BUILD_ROOT/var/lib/%{name}
+cat > $RPM_BUILD_ROOT/var/lib/%{name}/mysql.data <<EOF
 _UNCONFIGURED_
 
 Note!
@@ -135,45 +210,81 @@ USERNAME
 PASSWORD
 DATABASE
 EOF
+%endif
+
+%if %{with pgsql}
+cp tools.pgsql_drv/README README.pgsql
+
+# fix missing file
+install -d $RPM_BUILD_ROOT/var/lib/%{name}
+cat > $RPM_BUILD_ROOT/var/lib/%{name}/pgsql.data <<EOF
+_UNCONFIGURED_
+
+Note!
+
+This file can only contain 5 lines with the following values:
 
-%post libs -p /sbin/ldconfig
-%postun libs -p /sbin/ldconfig
+HOSTNAME
+PORT
+USERNAME
+PASSWORD
+DATABASE
+EOF
+%endif
 
 %clean
-[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
+rm -rf $RPM_BUILD_ROOT
+
+%post  libs -p /sbin/ldconfig
+%postun        libs -p /sbin/ldconfig
 
 %files
 %defattr(644,root,root,755)
-%doc README CHANGE
-%doc cgi/base.css cgi/dspam.cgi cgi/logo.gif cgi/template.html
+%doc README CHANGELOG RELEASE.NOTES README.courier README.pop3filter README.qmail README.exim README.postfix README.sendmail
+%doc cgi/base.css cgi/dspam.cgi
+%if %{with mysql}
 %doc README.mysql
-%doc tools.mysql_drv/mysql_objects.sql.space.optimized
-%doc tools.mysql_drv/mysql_objects.sql.speed.optimized
+%doc tools.mysql_drv/mysql_objects-space.sql
+%doc tools.mysql_drv/mysql_objects-speed.sql
 %doc tools.mysql_drv/purge.sql
 %doc tools.mysql_drv/virtual_users.sql
+%endif
+%if %{with pgsql}
+%doc README.pgsql
+%doc tools.pgsql_drv/virtual_users.sql
+%doc tools.pgsql_drv/pgsql_objects.sql
+%doc tools.pgsql_drv/purge.sql
+%endif
+%config(noreplace) %verify(not size mtime md5) /etc/dspam.conf
 %dir %attr(0750,root,mail) /var/lib/%{name}
-%attr(0640,root,mail) %config(noreplace) /var/lib/%{name}/mysql.data
-%attr(0755,root,root) %config(noreplace) %{_sysconfdir}/cron.daily/%{name}
-%attr(0755,root,root) %config(noreplace) %{_sysconfdir}/cron.weekly/%{name}
-%attr(0755,root,mail) %{_bindir}/%{name}
-%attr(0755,root,root) %{_bindir}/%{name}_clean
-%attr(0755,root,root) %{_bindir}/%{name}_corpus
-%attr(0755,root,root) %{_bindir}/%{name}_crc
-%attr(0755,root,root) %{_bindir}/%{name}_dump
-%attr(0755,root,root) %{_bindir}/%{name}_genaliases
-%attr(0755,root,root) %{_bindir}/%{name}_stats
-%attr(0755,root,root) %{_bindir}/%{name}_merge
-%attr(0755,root,root) %{_bindir}/%{name}_2mysql
-%attr(0755,root,root) %{_bindir}/%{name}_ngstats
+%{?with_mysql:%attr(640,root,mail) %config(noreplace) /var/lib/%{name}/mysql.data}
+%{?with_pgsql:%attr(640,root,mail) %config(noreplace) /var/lib/%{name}/pgsql.data}
+%attr(755,root,root) %config(noreplace) /etc/cron.daily/%{name}
+%attr(755,root,mail) %{_bindir}/%{name}
+%attr(755,root,root) %{_bindir}/%{name}_admin
+%attr(755,root,root) %{_bindir}/%{name}_clean
+%attr(755,root,root) %{_bindir}/%{name}_corpus
+%attr(755,root,root) %{_bindir}/%{name}_crc
+%attr(755,root,root) %{_bindir}/%{name}_dump
+%attr(755,root,root) %{_bindir}/%{name}_genaliases
+%attr(755,root,root) %{_bindir}/%{name}_stats
+%attr(755,root,root) %{_bindir}/%{name}_merge
+%attr(755,root,root) %{_bindir}/%{name}_2sql
+%attr(755,root,root) %{_bindir}/%{name}_stats
+%{_mandir}/man?/*
 
 %files libs
 %defattr(644,root,root,755)
-%doc README CHANGE
-%attr(0755,root,root) %{_libdir}/*.so.*
+%doc README CHANGELOG
+%attr(755,root,root) %{_libdir}/lib*.so.*.*.*
 
 %files devel
 %defattr(644,root,root,755)
-%attr(0644,root,root) %{_includedir}/%{name}/*.h
-%attr(0755,root,root) %{_libdir}/*.so
-%attr(0644,root,root) %{_libdir}/*.la
-%attr(0755,root,root) %{_libdir}/*.a
+%attr(755,root,root) %{_libdir}/lib*.so
+%{_libdir}/lib*.la
+%{_includedir}/%{name}
+%{_pkgconfigdir}/*.pc
+
+%files static
+%defattr(644,root,root,755)
+%{_libdir}/lib*.a
This page took 0.121428 seconds and 4 git commands to generate.