]> git.pld-linux.org Git - packages/dspam.git/blobdiff - dspam.spec
- make it possible to have all db backend bconds on at same time (for future)
[packages/dspam.git] / dspam.spec
index 5c3b4ae6a60ffc54d5c83ad6a1aa8bfb6544a8be..e5eb911b3d1b57b2cb1365247add0c1a6638014e 100644 (file)
@@ -1,34 +1,63 @@
-# TODO: everything
+# NOTE about versioning:
+#  Stable Releases: 3.4.x, Development Releases: 3.5.x
+#  All odd-versioned minor releases are considered development
+#  releases, and all even-versioned minor releases are stable releases
+# - from http://www.nuclearelephant.com/projects/dspam/download.shtml
 #
-# 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)
+# TODO:
+# - everything
+# - oracle driver
+# - missing /etc/dspam.conf for cron:
+#   /etc/cron.daily/dspam:
+#    2430: [6/28/2005 1:2:1] Unable to open file for reading: /etc/dspam.conf: No such file or directory
+#    2430: [6/28/2005 1:2:1] Unable to read dspam.conf
 #
+# Conditional build:
+%bcond_without mysql   # enable MySQL storage driver (disable sqlite/pgsql driver)
+%bcond_with    pgsql   # enable PostgreSQL storage driver (disable sqlite/mysql driver)
+%bcond_with    sqlite  # enable SQLite3 storage driver
+%bcond_with    daemon
+
+%if %{with mysql} && %{with pgsql}
+%undefine with_pgsql
+%{warn:disabled pgsql as mysql and pgsql aren't supported together (yet)
+}#'vim
+%endif
+
+%if %{with mysql} && %{with sqlite}
+%undefine with_sqlite
+%{warn:disabled sqlite as mysql and sqlite aren't supported together (yet)
+}#'vim
+%endif
+
+%if %{with pgsql} && %{with sqlite}
+%undefine with_sqlite
+%{warn:disabled sqlite as pgsql and sqlite aren't supported together (yet)
+}#'vim
+%endif
+
+
+%if %{with mysql} || %{with pgsql}
+%define        with_daemon 1
+%endif
+
 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.3
-Release:       0.1
+Version:       3.4.9
+Release:       0.2
 License:       GPL
 Group:         Applications/Mail
 Source0:       http://www.nuclearelephant.com/projects/dspam/sources/%{name}-%{version}.tar.gz
-# Source0-md5: befcaee35a69efe559471367b2249ea3
+# Source0-md5: ef7ceba47e63edb02a59be3c36cf0f6f
+Source1:       %{name}.init
 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: libtool
+%{?with_mysql:BuildRequires:   mysql-devel}
+%{?with_pgsql:BuildRequires:   postgresql-devel}
+%{?with_sqlite:BuildRequires:  sqlite3-devel}
 BuildRequires: sed >= 4.0
 Buildroot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -70,6 +99,20 @@ 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 -l pl client
+Klient dspam.
+
 %package libs
 Summary:       A library for Bayesian spam filtering
 Summary(pl):   Biblioteka do bayesowskiego filtrowania spamu
@@ -126,9 +169,13 @@ Statyczna biblioteka DSPAM.
 
 %prep
 %setup -q
-sed -i -e 's#-static##g' src/tools/Makefile*
+sed -i -e 's#\-static##g' src/Makefile* src/*/Makefile*
 
 %build
+%{__libtoolize}
+%{__aclocal} -I m4
+%{__autoconf}
+%{__automake}
 %configure \
        --enable-trusted-user-security \
        --enable-bayesian-dobly \
@@ -146,27 +193,23 @@ sed -i -e 's#-static##g' src/tools/Makefile*
        --with-signature-life=14 \
        --disable-dependency-tracking \
 %if %{with mysql}
+       --enable-daemon \
        --enable-virtual-users \
        --with-storage-driver=mysql_drv \
        --with-mysql-includes=%{_includedir}/mysql \
        --with-mysql-libraries=%{_libdir}
-%else
+%endif
 %if %{with pgsql}
+       --enable-daemon \
        --enable-virtual-users \
        --with-storage-driver=pgsql_drv \
        --with-pgsql-includes=%{_includedir}/postgresql \
        --with-pgsql-libraries=%{_libdir}
-%else
-%if %{with sqlite3}
+%endif
+%if %{with sqlite}
        --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
-%endif
 %endif
 %{__make}
 
@@ -176,6 +219,9 @@ rm -rf $RPM_BUILD_ROOT
 %{__make} install \
        DESTDIR=$RPM_BUILD_ROOT
 
+install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig}
+install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/dspam
+
 # install devel files
 install -d $RPM_BUILD_ROOT{%{_includedir}/%{name},/var/lib/%{name}}
 install src/*.h $RPM_BUILD_ROOT%{_includedir}/%{name}
@@ -199,8 +245,6 @@ sed -i -e "s|%{_prefix}/local|%{_prefix}|g" cgi/dspam.cgi
 #install 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 $RPM_BUILD_ROOT/var/lib/%{name}
 cat > $RPM_BUILD_ROOT/var/lib/%{name}/mysql.data <<EOF
@@ -219,8 +263,6 @@ 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
@@ -238,6 +280,22 @@ DATABASE
 EOF
 %endif
 
+%post
+/sbin/chkconfig --add dspam
+if [ -f /var/lock/subsys/dspam ]; then
+       /etc/rc.d/init.d/dspam restart 1>&2
+else
+       echo "Run \"/etc/rc.d/init.d/dspam start\" to start dspam daemon."
+fi
+
+%preun
+if [ "$1" = "0" ]; then
+       if [ -f /var/lock/subsys/dspam ]; then
+               /etc/rc.d/init.d/dspam stop 1>&2
+       fi
+       /sbin/chkconfig --del dspam
+fi
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -249,17 +307,15 @@ rm -rf $RPM_BUILD_ROOT
 %doc README CHANGELOG RELEASE.NOTES UPGRADING
 %doc cgi/base.css cgi/dspam.cgi
 %if %{with mysql}
-%doc README.mysql
-%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
+%doc doc/mysql_drv.txt
+%doc src/tools.mysql_drv/*.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
+%doc doc/pgsql_drv.txt
+%doc src/tools.pgsql_drv/*.sql
+%endif
+%if %{without mysql} && %{without pgsql}
+%doc doc/sqlite_drv.txt
 %endif
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dspam.conf
 %dir %attr(750,root,mail) /var/lib/%{name}
@@ -267,7 +323,6 @@ rm -rf $RPM_BUILD_ROOT
 %{?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,mail) %{_bindir}/%{name}c
 %attr(755,root,mail) %{_bindir}/%{name}_logrotate
 %attr(755,root,root) %{_bindir}/%{name}_clean
 %attr(755,root,root) %{_bindir}/%{name}_corpus
@@ -278,8 +333,16 @@ rm -rf $RPM_BUILD_ROOT
 %attr(755,root,root) %{_bindir}/%{name}_merge
 %attr(755,root,root) %{_bindir}/%{name}_2sql
 %attr(755,root,root) %{_bindir}/%{name}_admin
-#%attr(755,root,root) %{_bindir}/libdb4_purge
-%{_mandir}/man?/*
+%{?with_pgsql:%attr(755,root,root) %{_bindir}/%{name}_pg2int8}
+%{_mandir}/man?/%{name}*
+
+%if %{with daemon}
+%attr(754,root,root) /etc/rc.d/init.d/dspam
+%files client
+%defattr(644,root,root,755)
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dspam.conf
+%endif
+%attr(755,root,mail) %{_bindir}/%{name}c
 
 %files libs
 %defattr(644,root,root,755)
@@ -288,10 +351,10 @@ rm -rf $RPM_BUILD_ROOT
 
 %files devel
 %defattr(644,root,root,755)
-%{_libdir}/pkgconfig/dspam.pc
 %attr(755,root,root) %{_libdir}/lib*.so
 %{_libdir}/lib*.la
 %{_includedir}/%{name}
+%{_mandir}/man3/libdspam*
 %{_pkgconfigdir}/*.pc
 
 %files static
This page took 0.061967 seconds and 4 git commands to generate.