SPECS: dspam.spec - mysql version is default now; sqlite2 support ...

arekm arekm at pld-linux.org
Fri Jun 17 10:25:56 CEST 2005


Author: arekm                        Date: Fri Jun 17 08:25:56 2005 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- mysql version is default now; sqlite2 support dropped; daemon mode enabled for mysql and postgresql

---- Files affected:
SPECS:
   dspam.spec (1.32 -> 1.33) 

---- Diffs:

================================================================
Index: SPECS/dspam.spec
diff -u SPECS/dspam.spec:1.32 SPECS/dspam.spec:1.33
--- SPECS/dspam.spec:1.32	Fri Jun 17 08:29:18 2005
+++ SPECS/dspam.spec	Fri Jun 17 10:25:51 2005
@@ -2,10 +2,16 @@
 # TODO: everything
 #
 # Conditional build:
-%bcond_with	mysql	# enable MySQL storage driver (disable sqlite driver)
+%bcond_without	mysql	# enable MySQL storage driver (disable sqlite driver)
 %bcond_with	pgsql	# enable PostgreSQL storage driver (disable sqlite driver)
-%bcond_with	sqlite2	# enable SQLite2 storage driver (disable sqlite3 driver)
+%bcond_with	sqlite	# enable SQLite3 storage driver
+%bcond_with	daemon	
 #
+
+%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
@@ -15,19 +21,19 @@
 Group:		Applications/Mail
 Source0:	http://www.nuclearelephant.com/projects/dspam/sources/%{name}-%{version}.tar.gz
 # Source0-md5:	b6930c31fe0940b8ad6d27324f8bab3e
+Source1:	%{name}.init
 URL:		http://www.nuclearelephant.com/projects/dspam/
+BuildRequires:	autoconf
+BuildRequires:	automake
+BuildRequires:	libtool
 %if %{with mysql}
 BuildRequires:	mysql-devel
 %else
 %if %{with pgsql}
 BuildRequires:	postgresql-devel
 %else
-%if %{with sqlite2}
-BuildRequires:	sqlite-devel
-BuildRequires:	sqlite-static
-%else
+%if %{with sqlite}
 BuildRequires:	sqlite3-devel
-BuildRequires:	sqlite3-static
 %endif
 %endif
 %endif
@@ -72,6 +78,20 @@
 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
@@ -128,9 +148,13 @@
 
 %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 \
@@ -148,22 +172,20 @@
 	--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
 %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 sqlite2}
-        --with-storage-driver=sqlite_drv \
-        --with-sqlite-includes=%{_includedir} \
-        --with-sqlite-libraries=%{_libdir}
-%else
+%if %{with sqlite}
 	--with-storage-driver=sqlite3_drv \
 	--with-sqlite3-includes=%{_includedir} \
 	--with-sqlite3-libraries=%{_libdir}
@@ -178,6 +200,10 @@
 %{__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}
@@ -236,6 +262,23 @@
 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
 
@@ -263,7 +306,6 @@
 %{?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
@@ -277,6 +319,14 @@
 %{?with_pgsql:%attr(755,root,root) %{_bindir}/%{name}_pg2int8}
 %{_mandir}/man?/%{name}*
 
+%if %{with daemon}
+%files client
+%defattr(644,root,root,755)
+%attr(754,root,root) /etc/rc.d/init.d/dspam
+%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)
 %doc README CHANGELOG
@@ -300,6 +350,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.33  2005/06/17 08:25:51  arekm
+- mysql version is default now; sqlite2 support dropped; daemon mode enabled for mysql and postgresql
+
 Revision 1.32  2005/06/17 06:29:18  arekm
 sqlite3 by default
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/dspam.spec?r1=1.32&r2=1.33&f=u




More information about the pld-cvs-commit mailing list