]> git.pld-linux.org Git - packages/dspam.git/blobdiff - dspam.spec
- updated to 3.2.1
[packages/dspam.git] / dspam.spec
index 0076cfc69b26bb852d61fc12d5907b1ca23b81ed..511b368ab0d84b438238b08ef88ff2e1c476beab 100644 (file)
@@ -1,21 +1,26 @@
 #
 # Conditional build:
-%bcond_with    mysql   # enable mysql storage driver (disable db4 driver)
+%bcond_with    mysql   # enable MySQL storage driver (disable db4 driver)
+%bcond_with    pgsql   # enable PostgreSQL storage driver (disable db4 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
+Version:       3.2.1
 Release:       1
 License:       GPL
 Group:         Applications/Mail
 Source0:       http://www.nuclearelephant.com/projects/dspam/sources/%{name}-%{version}.tar.gz
-# Source0-md5: ddb40d26cc923d7569d48b3072e61715
+# Source0-md5: a4357c02ca39a68480719adf47fca67a
+Patch0:                %{name}-Makefile.patch
 URL:           http://www.nuclearelephant.com/projects/dspam/
+BuildRequires: db-static
 %if %{with mysql}
-BuildRequires: mysql-static
+BuildRequires: mysql-devel
+%else if %{with pgsql}
+BuildRequires: postgresql-devel
 %else
-BuildRequires: db-static
+BuildRequires: db-devel
 %endif
 Buildroot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -113,20 +118,20 @@ Statyczna biblioteka DSPAM.
 
 %prep
 %setup -q
+%patch0 -p1
 
 %build
 %configure \
-       --enable-static=yes \
        --enable-trusted-user-security \
        --enable-bayesian-dobly \
        --enable-chained-tokens \
        --enable-experimental \
-       --enable-signature-attachments \
        --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 \
@@ -139,11 +144,19 @@ Statyczna biblioteka DSPAM.
        --with-storage-driver=mysql_drv \
        --with-mysql-includes=%{_includedir}/mysql \
        --with-mysql-libraries=%{_libdir}
+%else
+%if %{with pgsql}
+       --enable-neural-networking \
+       --enable-virtual-users \
+       --with-storage-driver=pgsql_drv \
+       --with-pgsql-includes=%{_includedir}/postgresql \
+       --with-pgsql-libraries=%{_libdir}
 %else
        --with-storage-driver=libdb4_drv \
        --with-db4-includes=%{_includedir} \
        --with-db4-libraries=%{_libdir}
 %endif
+%endif
 %{__make}
 
 %install
@@ -153,7 +166,7 @@ rm -rf $RPM_BUILD_ROOT
 %{__make} install DESTDIR=$RPM_BUILD_ROOT
 
 # install devel files
-install -d $RPM_BUILD_ROOT%{_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}
@@ -165,7 +178,7 @@ install -d $RPM_BUILD_ROOT%{_sysconfdir}/cron.weekly
 
 cat > $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily/%{name} <<EOF
 #!/bin/sh
-exec %{_bindir}/%{name}_clean 2>&1 > /dev/null
+exec %{_bindir}/%{name}_clean -s -p
 EOF
 
 chmod 755 $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily/%{name}
@@ -197,6 +210,26 @@ 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:
+
+HOSTNAME
+PORT
+USERNAME
+PASSWORD
+DATABASE
+EOF
+%endif
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -205,8 +238,8 @@ rm -rf $RPM_BUILD_ROOT
 
 %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
+%doc cgi/base.css cgi/dspam.cgi
 %if %{with mysql}
 %doc README.mysql
 %doc tools.mysql_drv/mysql_objects.sql.space.optimized
@@ -214,8 +247,15 @@ rm -rf $RPM_BUILD_ROOT
 %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
 %dir %attr(0750,root,mail) /var/lib/%{name}
 %{?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) %{_sysconfdir}/cron.daily/%{name}
 #%attr(755,root,root) %config(noreplace) %{_sysconfdir}/cron.weekly/%{name}
 %attr(755,root,mail) %{_bindir}/%{name}
@@ -226,13 +266,14 @@ rm -rf $RPM_BUILD_ROOT
 %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}_2mysql
-%attr(755,root,root) %{_bindir}/%{name}_ngstats
-%attr(755,root,root) %{_bindir}/libdb4_purge
+%attr(755,root,root) %{_bindir}/%{name}_2sql
+%attr(755,root,root) %{_bindir}/%{name}_stats
+#%attr(755,root,root) %{_bindir}/libdb4_purge
+%{_mandir}/man?/*
 
 %files libs
 %defattr(644,root,root,755)
-%doc README CHANGE
+%doc README CHANGELOG
 %attr(755,root,root) %{_libdir}/lib*.so.*.*.*
 
 %files devel
This page took 0.065245 seconds and 4 git commands to generate.