[Pkg-dspam-commits] [pkg-dspam-commits] r251 - in branches/development/debian: . manpages patches

Julien Valroff julien-guest at alioth.debian.org
Sat Apr 17 13:28:45 UTC 2010


Author: julien-guest
Date: Sat Apr 17 13:28:38 2010
New Revision: 251

Log:
Make use of dspam_maintenance

Added:
   branches/development/debian/manpages/dspam_maintenance.1
   branches/development/debian/patches/015_dspam-maintenance.diff
Deleted:
   branches/development/debian/dspam.cron.daily
   branches/development/debian/libdspam7-drv-mysql.cron.daily
   branches/development/debian/libdspam7-drv-sqlite3.cron.daily
   branches/development/debian/patches/006_clean-manpages.diff
Modified:
   branches/development/debian/changelog
   branches/development/debian/copyright
   branches/development/debian/dspam.default
   branches/development/debian/dspam.install
   branches/development/debian/dspam.manpages
   branches/development/debian/patches/003_update-dspam.conf.diff
   branches/development/debian/patches/series
   branches/development/debian/rules

Modified: branches/development/debian/changelog
==============================================================================
--- branches/development/debian/changelog	Sat Apr 17 08:09:20 2010	(r250)
+++ branches/development/debian/changelog	Sat Apr 17 13:28:38 2010	(r251)
@@ -1,10 +1,9 @@
-dspam (3.9.0+git20100416-1) stable; urgency=low
+dspam (3.9.0+git20100417-1) experimental; urgency=low
 
   [ Kurt B. Kaiser ]
   * debian/rules: don't use --build config option if host equals target.
   * debian/rules: dpkg-dev now handles CFLAGS.
   * Use maintainer-clean in clean target and remove any Makefile.in left over.
-  * Break a long line in debian/copyright to quiet lintian.
   * Remove libapache2-mod-auth-shadow - no longer available in unstable
   * Suggest clamav-daemon instead of recommending it.
   * Suggest dspam-webfrontend.
@@ -82,8 +81,11 @@
   * Fix daily cron scripts to to avoid problems if the user has added
     two identical entries for certain values
     (thanks to Stevan Bajić <stevan at bajic.ch>)
+  * Add automatic configuration file splitting snippet in rules
+    (thanks to Stevan Bajić <stevan at bajic.ch>)
+  * Make use of dspam_maintenance.sh script instead of homemade purge scripts
 
- -- Julien Valroff <julien at kirya.net>  Sat, 17 Apr 2010 08:28:37 +0200
+ -- Julien Valroff <julien at kirya.net>  Sat, 17 Apr 2010 15:11:07 +0200
 
 dspam (3.6.8-9.3) unstable; urgency=low
 

Modified: branches/development/debian/copyright
==============================================================================
--- branches/development/debian/copyright	Sat Apr 17 08:09:20 2010	(r250)
+++ branches/development/debian/copyright	Sat Apr 17 13:28:38 2010	(r251)
@@ -35,7 +35,7 @@
 Copyright: 2007-2010, Stevan Bajic <stevan at bajic.ch>
 License: GNU AGPL-3
  The complete text of the GNU Affero General Public License
- can be found in /usr/share/doc/dspam/AGPL-3
+ can be found in /usr/share/doc/dspam/AGPL-3.gz
 
 Files: debian/*
 Copyright: 2005-2010, Debian DSPAM Maintainers <pkg-dspam-misc at lists.alioth.debian.org>

Modified: branches/development/debian/dspam.default
==============================================================================
--- branches/development/debian/dspam.default	Sat Apr 17 08:09:20 2010	(r250)
+++ branches/development/debian/dspam.default	Sat Apr 17 13:28:38 2010	(r251)
@@ -8,3 +8,7 @@
 
 # Options for dspam.
 #OPTIONS="--debug"
+
+# Options for dspam_maintenance script (daily cronjob)
+# See dspam_maintenance(1) for possible options
+#MAINTENANCE_OPTIONS="--verbose"

Modified: branches/development/debian/dspam.install
==============================================================================
--- branches/development/debian/dspam.install	Sat Apr 17 08:09:20 2010	(r250)
+++ branches/development/debian/dspam.install	Sat Apr 17 13:28:38 2010	(r251)
@@ -19,3 +19,4 @@
 debian/tmp/usr/bin/cssstat          usr/bin/
 debian/tmp/usr/bin/cssconvert       usr/bin/
 debian/tmp/usr/bin/csscompress      usr/bin/
+contrib/dspam_maintenance/dspam_maintenance	usr/bin/

Modified: branches/development/debian/dspam.manpages
==============================================================================
--- branches/development/debian/dspam.manpages	Sat Apr 17 08:09:20 2010	(r250)
+++ branches/development/debian/dspam.manpages	Sat Apr 17 13:28:38 2010	(r251)
@@ -1,5 +1,6 @@
 debian/manpages/dspam_2sql.1
 debian/manpages/dspamc.1
+debian/manpages/dspam_maintenance.1
 debian/manpages/cssclean.1
 debian/manpages/csscompress.1
 debian/manpages/cssconvert.1

Added: branches/development/debian/manpages/dspam_maintenance.1
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/development/debian/manpages/dspam_maintenance.1	Sat Apr 17 13:28:38 2010	(r251)
@@ -0,0 +1,35 @@
+.TH "DSPAM_MAINTENANCE" "1" "April 2010"
+.SH NAME
+dspam_maintenance \- maintenance script for DSPAM database and logs
+.SH SYNOPSYS
+dspam_maintenance
+[\-\-profile=[PROFILE]]
+[\-\-logdays=no_of_days]
+[\-\-signatures=no_of_days]
+[\-\-neutral=no_of_days]
+[\-\-unused=no_of_days]
+[\-\-hapaxes=no_of_days]
+[\-\-hits1s=no_of_days]
+[\-\-hits1i=no_of_days]
+[\-\-without\-sql\-purge]
+[\-\-purgescriptdir=[DIRECTORY]
+[\-\-with\-all\-drivers]
+[\-\-verbose]
+
+.SH DESCRIPTION
+Remove old signatures and unimportant tokens from the DSPAM database.
+.br
+Purge old log entries in user and system logs.
+
+.br
+This script can be called from the command line or run from
+within cron. Either add a line in your crontab or add this
+script in your cron.{hourly,daily,weekly,monthly}. Running
+this script every hour might not be the best idea but it's
+your decision if you want to do so.
+
+.SH "AUTHORS"
+dspam_maintenance was written by Stevan Bajic <stevan at bajic.ch>
+.PP
+This manual page was written by Julien Valroff <julien at kirya.net>,
+for the Debian project (but may be used by others).

Modified: branches/development/debian/patches/003_update-dspam.conf.diff
==============================================================================
--- branches/development/debian/patches/003_update-dspam.conf.diff	Sat Apr 17 08:09:20 2010	(r250)
+++ branches/development/debian/patches/003_update-dspam.conf.diff	Sat Apr 17 13:28:38 2010	(r251)
@@ -4,6 +4,15 @@
 
 --- a/src/dspam.conf.in
 +++ b/src/dspam.conf.in
+@@ -19,7 +19,7 @@
+ #
+ # Options include:
+ #
+-#   libmysql_drv.so     libpgsql_drv.so   libsqlite_drv.so
++#   libmysql_drv.so     libpgsql_drv.so
+ #   libsqlite3_drv.so   libhash_drv.so
+ #
+ # IMPORTANT: Switching storage drivers requires more than merely changing
 @@ -143,11 +143,10 @@
  #
  Trust root

Added: branches/development/debian/patches/015_dspam-maintenance.diff
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/development/debian/patches/015_dspam-maintenance.diff	Sat Apr 17 13:28:38 2010	(r251)
@@ -0,0 +1,108 @@
+--- a/contrib/dspam_maintenance/dspam_maintenance.sh
++++ b/contrib/dspam_maintenance/dspam_maintenance.sh
+@@ -27,10 +27,10 @@
+ PGSQL_BIN_DIR="/usr/bin"
+ SQLITE_BIN_DIR="/usr/bin"
+ SQLITE3_BIN_DIR="/usr/bin"
+-DSPAM_CONFIGDIR=""
+-DSPAM_HOMEDIR=""
+-DSPAM_BIN_DIR=""
+-DSPAM_PURGE_SCRIPT_DIR=""
++DSPAM_CONFIGDIR="/etc/dspam"
++DSPAM_HOMEDIR="/var/spool/dspam"
++DSPAM_BIN_DIR="/usr/bin"
++DSPAM_PURGE_SCRIPT_DIR="/usr/share/doc/libdspam7-drv-mysql/sql /usr/share/doc/libdspam7-drv-pgsql/sql /usr/share/doc/libdspam7-drv-sqlite3/sql"
+ 
+ 
+ #
+@@ -52,7 +52,7 @@
+ 		--with-all-drivers) PURGE_ALL_DRIVERS="true";;
+ 		--verbose) VERBOSE="true";;
+ 		*)
+-			echo -ne "Usage: $0 \n\t[--profile=[PROFILE]]\n\t[--logdays=no_of_days]\n\t[--signatures=no_of_days]\n\t[--neutral=no_of_days]\n\t[--unused=no_of_days]\n\t[--hapaxes=no_of_days]\n\t[--hits1s=no_of_days]\n\t[--hits1i=no_of_days]\n\t[--without-sql-purge]\n\t[--purgescriptdir=[DIRECTORY]\n\t[--with-all-drivers]\n\t\[--verbose]\n"
++			/bin/echo -ne "Usage: $0 \n\t[--profile=[PROFILE]]\n\t[--logdays=no_of_days]\n\t[--signatures=no_of_days]\n\t[--neutral=no_of_days]\n\t[--unused=no_of_days]\n\t[--hapaxes=no_of_days]\n\t[--hits1s=no_of_days]\n\t[--hits1i=no_of_days]\n\t[--without-sql-purge]\n\t[--purgescriptdir=[DIRECTORY]\n\t[--with-all-drivers]\n\t[--verbose]\n"
+ 			exit 1
+ 			;;
+ 	esac
+@@ -63,7 +63,7 @@
+ # Function to run dspam_clean
+ #
+ run_dspam_clean() {
+-	[ "${VERBOSE}" = "true" ] && echo -ne "Running dspam_clean"
++	[ "${VERBOSE}" = "true" ] && /bin/echo -ne "Running dspam_clean"
+ 	local PURGE_SIG="${1}"
+ 	local ADD_PARAMETER=""
+ 	read_dspam_params DefaultProfile
+@@ -73,10 +73,10 @@
+ 	fi
+ 	if [ "${PURGE_SIG}" = "YES" ]
+ 	then
+-		echo " (with purging old signatures)"
++		[ "${VERBOSE}" = "true" ] && echo " (with purging old signatures)"
+ 		${DSPAM_BIN_DIR}/dspam_clean ${ADD_PARAMETER} -s${SIGNATURE_AGE} -p${NEUTRAL_AGE} -u${UNUSED_AGE},${HAPAXES_AGE},${HITS1S_AGE},${HITS1I_AGE} >/dev/null 2>&1
+ 	else
+-		echo " (without purging old signatures)"
++		[ "${VERBOSE}" = "true" ] && echo " (without purging old signatures)"
+ 		${DSPAM_BIN_DIR}/dspam_clean ${ADD_PARAMETER} -p${NEUTRAL_AGE} -u${UNUSED_AGE},${HAPAXES_AGE},${HITS1S_AGE},${HITS1I_AGE} >/dev/null 2>&1
+ 	fi
+ 	return ${?}
+@@ -128,15 +128,15 @@
+ 		read_dspam_params MySQLServer${PROFILE} MySQLPort${PROFILE} MySQLUser${PROFILE} MySQLPass${PROFILE} MySQLDb${PROFILE} MySQLCompress${PROFILE} && \
+ 		[ -n "${MySQLServer}" -a -n "${MySQLUser}" -a -n "${MySQLDb}" ]
+ 	then
+-		if [ ! -e "${MYSQL_BIN_DIR}/mysql_config" ]
++		if [ ! -e "${MYSQL_BIN_DIR}/mysql" ]
+ 		then
+ 			echo "Can not run MySQL purge script:"
+-			echo "  ${MYSQL_BIN_DIR}/mysql_config does not exist"
++			echo "  ${MYSQL_BIN_DIR}/mysql does not exist"
+ 			return 1
+ 		fi
+ 		DSPAM_MySQL_PURGE_SQL=
+ 		DSPAM_MySQL_PURGE_SQL_FILES=
+-		DSPAM_MySQL_VER=$(${MYSQL_BIN_DIR}/mysql_config --version | sed "s:[^0-9.]*::g")
++		DSPAM_MySQL_VER=$(${MYSQL_BIN_DIR}/mysql --version | sed "s:[^0-9.]*::g")
+ 		DSPAM_MySQL_MAJOR=$(echo "${DSPAM_MySQL_VER}" | cut -d. -f1)
+ 		DSPAM_MySQL_MINOR=$(echo "${DSPAM_MySQL_VER}" | cut -d. -f2)
+ 		DSPAM_MySQL_MICRO=$(echo "${DSPAM_MySQL_VER}" | cut -d. -f3)
+@@ -148,9 +148,9 @@
+ 			# For the 4.1-optimized version see:
+ 			# http://securitydot.net/txt/id/32/type/articles/
+ 			# Version >= 3.9.0 of DSPAM do already include a better purge script.
+-			DSPAM_MySQL_PURGE_SQL_FILES="mysql_purge-4.1-optimized mysql_purge-4.1"
++			DSPAM_MySQL_PURGE_SQL_FILES="purge-4.1"
+ 		else
+-			DSPAM_MySQL_PURGE_SQL_FILES="mysql_purge"
++			DSPAM_MySQL_PURGE_SQL_FILES="purge"
+ 
+ 		fi
+ 
+@@ -199,7 +199,7 @@
+ 		fi
+ 
+ 		# Construct mysql command line
+-		echo -e "[client]\npassword=${MySQLPass}\n">"${DSPAM_CRON_TMPFILE}"
++		/bin/echo -e "[client]\npassword=${MySQLPass}\n">"${DSPAM_CRON_TMPFILE}"
+ 		DSPAM_MySQL_CMD="${MYSQL_BIN_DIR}/mysql"
+ 		DSPAM_MySQL_CMD="${DSPAM_MySQL_CMD} --defaults-extra-file=${DSPAM_CRON_TMPFILE}"
+ 		DSPAM_MySQL_CMD="${DSPAM_MySQL_CMD} --silent"
+@@ -345,9 +345,7 @@
+ 	[ "${VERBOSE}" = "true" ] && echo "Running SQLite v3 storage driver data cleanup"
+ 	if	[ "${USE_SQL_PURGE}" = "true" ]
+ 	then
+-		DSPAM_SQLite3_PURGE_SQL=""
+-		[ -f "${DSPAM_CONFIGDIR}/config/sqlite3_purge.sql" ] && DSPAM_SQLite3_PURGE_SQL="${DSPAM_CONFIGDIR}/config/sqlite3_purge.sql"
+-		[ -f "${DSPAM_CONFIGDIR}/sqlite3_purge.sql" ] && DSPAM_SQLite3_PURGE_SQL="${DSPAM_CONFIGDIR}/sqlite3_purge.sql"
++		DSPAM_SQLite3_PURGE_SQL="/usr/share/doc/libdspam7-drv-sqlite3/sql/purge-3.sql"
+ 
+ 		if [ -z "${DSPAM_SQLite3_PURGE_SQL}" ]
+ 		then
+@@ -689,7 +687,7 @@
+ 		read_dspam_params StorageDriver
+ 		if [ -n "${StorageDriver}" ]
+ 		then
+-			for foo in hash_drv mysql_drv pgsql_drv sqlite3_drv sqlite_drv
++			for foo in hash_drv mysql_drv pgsql_drv sqlite3_drv
+ 			do
+ 				if ( echo "${StorageDriver}" | grep -q "${foo}" )
+ 				then

Modified: branches/development/debian/patches/series
==============================================================================
--- branches/development/debian/patches/series	Sat Apr 17 08:09:20 2010	(r250)
+++ branches/development/debian/patches/series	Sat Apr 17 13:28:38 2010	(r251)
@@ -2,6 +2,6 @@
 002_dspam-webfrontend-config-debian.diff
 003_update-dspam.conf.diff
 004_dspam-default.prefs-in_etc.diff
-006_clean-manpages.diff
 008_where-to-find-txt-files.diff
 010_default-daemon-port.diff
+015_dspam-maintenance.diff

Modified: branches/development/debian/rules
==============================================================================
--- branches/development/debian/rules	Sat Apr 17 08:09:20 2010	(r250)
+++ branches/development/debian/rules	Sat Apr 17 13:28:38 2010	(r251)
@@ -75,6 +75,9 @@
 	CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" ./configure $(CONFIGURE)
 	touch configure-stamp
 
+	# dh_install does not support renaming
+	mv contrib/dspam_maintenance/dspam_maintenance.sh contrib/dspam_maintenance/dspam_maintenance
+
 # Build target.
 build: build-stamp
 build-stamp: configure
@@ -86,11 +89,11 @@
 	cat src/tools.pgsql_drv/pgsql_objects.sql > debian/sqlfiles/pgsql
 	cat src/tools.pgsql_drv/virtual_users.sql >> debian/sqlfiles/pgsql
 
-	# could we do something automatic for file splitting?
-	# awk '/^# -- ExtLookup --$/ , /^# -- Profiles --$/' src/dspam.conf.in | sed '$d' > debian/config/extlookup.conf
-	# awk '/^# --- SQLite ---$/ , /^# --- Hash ---$/' src/dspam.conf.in | sed '$d' > debian/config/sqlite.conf
-	# awk '/^# --- MySQL ---$/ , /^# --- PostgreSQL ---$/' src/dspam.conf.in | sed '$d' > debian/config/mysql.conf
-	# awk '/^# --- PostgreSQL ---$/ , /^# --- SQLite ---$/' src/dspam.conf.in | sed '$d' > debian/config/pgsql.conf
+	#for foo in ExtLookup=extlookup SQLite=sqlite MySQL=mysql PostgreSQL=pgsql Hash=hash;
+	#do
+	#	sed -n -e "/^# \-\- ${foo%=*} \-\-[\t ]*$/,/^# \-\- [^-]\{1,99\}\-\-[\t ]*$/p" src/dspam.conf.in > debian/config/${foo#*=}.conf;
+	#	sed -i -e '$d' debian/config/${foo#*=}.conf;
+	#done;
 
 	touch build-stamp
 



More information about the Pkg-dspam-commits mailing list