Package: dovecot-antispam
Version: 1.2+20090702-1+b1
Severity: wishlist
Tags: patch

The attached patches included the patch provide in #540283.

Cheers,
Rodolphe

--- System information. ---
Architecture: amd64
Kernel:       Linux 2.6.32-5-amd64

Debian Release: squeeze/sid
  500 unstable        www.debian-multimedia.org 
  500 unstable        ftp.fr.debian.org 
  500 unstable        ftp.debian.org 
  500 sid             download.tuxfamily.org 
  500 sid             debian.damsy.net 
    1 experimental    ftp.debian.org 

--- Package information. ---
Depends            (Version) | Installed
============================-+-===========
libc6               (>= 2.3) | 2.10.2-8
dovecot-imapd                | 1:1.2.11-1


Package's Recommends field is empty.

Package's Suggests field is empty.




>From 0301c8edba5bcc9b3e16d28c35ff9b77846e3395 Mon Sep 17 00:00:00 2001
From: Rodolphe Pelloux-Prayer <rodol...@damsy.net>
Date: Mon, 10 May 2010 19:23:29 +0200
Subject: [PATCH 1/9] Imported Upstream version 1.3

---
 antispam-plugin.h |    6 +++---
 dovecot-version.c |   25 ++++++++++++++++++++-----
 dspam-exec.c      |    3 ++-
 version.sh        |    2 +-
 4 files changed, 26 insertions(+), 10 deletions(-)

diff --git a/antispam-plugin.h b/antispam-plugin.h
index 5c56b42..38a3be6 100644
--- a/antispam-plugin.h
+++ b/antispam-plugin.h
@@ -85,7 +85,7 @@ extern bool need_folder_hook;
  * Dovecot version compat code
  */
 
-#if DOVECOT_VERSION_CODE(1, 1) == DOVECOT_VERSION || DOVECOT_VERSION_CODE(1, 2) == DOVECOT_VERSION
+#if DOVECOT_VERSION_CODE(1, 1, 0) == DOVECOT_VERSION || DOVECOT_VERSION_CODE(1, 2, 0) == DOVECOT_VERSION
 #define __attr_unused__		ATTR_UNUSED
 #define ME(err)			MAIL_ERROR_ ##err,
 #define PLUGIN_ID		uint32_t PLUGIN_FUNCTION(id) = 0
@@ -114,7 +114,7 @@ o_stream_create_from_fd(int fd, pool_t pool ATTR_UNUSED)
 	return o_stream_create_fd(fd, 0, TRUE);
 }
 
-#if DOVECOT_VERSION_CODE(1, 2) == DOVECOT_VERSION
+#if DOVECOT_VERSION_CODE(1, 2, 0) == DOVECOT_VERSION
 static inline struct dict *
 string_dict_init(const char *uri, const char *username)
 {
@@ -132,7 +132,7 @@ string_dict_init(const char *uri, const char *username)
 	return dict_init(uri, DICT_DATA_TYPE_STRING, username);
 }
 #endif
-#elif DOVECOT_VERSION_CODE(1, 0) == DOVECOT_VERSION
+#elif DOVECOT_VERSION_CODE(1, 0, 0) == DOVECOT_VERSION
 #define ME(err)
 #define PLUGIN_ID
 #define str_array_length(x)	strarray_length(x)
diff --git a/dovecot-version.c b/dovecot-version.c
index fbb7a88..7733e60 100644
--- a/dovecot-version.c
+++ b/dovecot-version.c
@@ -5,8 +5,9 @@
 
 int main(int argc, char **argv)
 {
-	char *v = PACKAGE_STRING, *e;
-	int maj = 0, min = 0;
+	const char *v = PACKAGE_STRING;
+	char *e;
+	int maj = 0, min = 0, patch = 0;
 
 	if (strncmp(v, "dovecot ", 8) && strncmp(v, "Dovecot ", 8))
 		return 1;
@@ -24,11 +25,25 @@ int main(int argc, char **argv)
 	if (v == e)
 		return 1;
 
+	/* not end of string yet? */
+	if (*e) {
+		v = e + 1;
+
+		patch = strtol(v, &e, 10);
+		if (v == e)
+			return 1;
+	}
+
 	printf("/* Auto-generated file, do not edit */\n\n");
-	printf("#define DOVECOT_VERSION_CODE(maj, min)	((maj)<<8 | (min))\n\n");
+	printf("#define DOVECOT_VERSION_CODE(maj, min, patch)	"
+		"((maj)<<16 | ((min)<<8) | (patch))\n\n");
 	
-	printf("#define DOVECOT_VERSION			0x%.2x%.2x\n", maj, min);
-	printf("#define ANTISPAM_STORAGE		\"antispam-storage-%d.%d.c\"\n", maj, min);
+	printf("#define DOVECOT_VERSION				"
+		"0x%.2x%.2x%.2x\n", maj, min, 0);
+	printf("#define DOVECOT_VPATCH				"
+		"0x%.2x%.2x%.2x\n", maj, min, patch);
+	printf("#define ANTISPAM_STORAGE			"
+		"\"antispam-storage-%d.%d.c\"\n", maj, min);
 
 	return 0;
 }
diff --git a/dspam-exec.c b/dspam-exec.c
index 3c52271..ecfb9f1 100644
--- a/dspam-exec.c
+++ b/dspam-exec.c
@@ -58,7 +58,8 @@ static int call_dspam(const char *signature, enum classification wanted)
 	 * non-zero exit code on errors so we treat it as an error
 	 * if it logged anything to stderr.
 	 */
-	pipe(pipes);
+	if (pipe(pipes) < 0)
+		return -1;
 
 	pid = fork();
 	if (pid < 0)
diff --git a/version.sh b/version.sh
index 2cbdde6..cae4b64 100755
--- a/version.sh
+++ b/version.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-VERSION=1.2
+VERSION=1.3
 
 if head=$(git rev-parse --verify HEAD 2>/dev/null); then
 	git update-index --refresh --unmerged > /dev/null
-- 
1.7.1

>From d77f24508c145df44519fb97f871b58ced0f0fbb Mon Sep 17 00:00:00 2001
From: Rodolphe Pelloux-Prayer <rodol...@damsy.net>
Date: Wed, 12 May 2010 12:07:06 +0200
Subject: [PATCH 2/9] Apply Julien Valroff's patch.

---
 debian/README.Debian                              |    6 --
 debian/changelog                                  |   12 +++
 debian/compat                                     |    2 +-
 debian/control                                    |   91 ++++++++++++++++++++-
 debian/dovecot-antispam-backend-crm114.dirs       |    1 +
 debian/dovecot-antispam-backend-crm114.install    |    1 +
 debian/dovecot-antispam-backend-dspam.dirs        |    1 +
 debian/dovecot-antispam-backend-dspam.install     |    1 +
 debian/dovecot-antispam-backend-mailtrain.dirs    |    1 +
 debian/dovecot-antispam-backend-mailtrain.install |    1 +
 debian/dovecot-antispam-backend-spool2dir.dirs    |    1 +
 debian/dovecot-antispam-backend-spool2dir.install |    1 +
 debian/dovecot-antispam-config                    |   50 -----------
 debian/rules                                      |   59 +++++++++++---
 debian/watch                                      |    2 +
 15 files changed, 160 insertions(+), 70 deletions(-)
 delete mode 100644 debian/README.Debian
 create mode 100644 debian/dovecot-antispam-backend-crm114.dirs
 create mode 100644 debian/dovecot-antispam-backend-crm114.install
 create mode 100644 debian/dovecot-antispam-backend-dspam.dirs
 create mode 100644 debian/dovecot-antispam-backend-dspam.install
 create mode 100644 debian/dovecot-antispam-backend-mailtrain.dirs
 create mode 100644 debian/dovecot-antispam-backend-mailtrain.install
 create mode 100644 debian/dovecot-antispam-backend-spool2dir.dirs
 create mode 100644 debian/dovecot-antispam-backend-spool2dir.install
 delete mode 100644 debian/dovecot-antispam-config
 create mode 100644 debian/watch

diff --git a/debian/README.Debian b/debian/README.Debian
deleted file mode 100644
index 47e103f..0000000
--- a/debian/README.Debian
+++ /dev/null
@@ -1,6 +0,0 @@
-dovecot-antispam
-================
-
-Read dovecot-antispam(7).
-
- -- Jonny Lamb <jo...@debian.org>  Wed, 18 Feb 2009 15:02:42 +0000
diff --git a/debian/changelog b/debian/changelog
index da20a4b..4522386 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,15 @@
+dovecot-antispam (1.2+20090702-1.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Builds multiple binary packages for each available backend
+    (Closes: #540283)
+  * Remove useless README.Debian
+  * Bump Standards version to 3.8.3
+  * Bump DH compat to 7
+  * Add watchfile to track new upstream releases
+
+ -- Julien Valroff <jul...@kirya.net>  Wed, 18 Nov 2009 14:17:48 +0100
+
 dovecot-antispam (1.2+20090702-1) unstable; urgency=low
 
   * Adopt this one officially now with the maintainer's blessing. Thanks Jonny!
diff --git a/debian/compat b/debian/compat
index 7ed6ff8..7f8f011 100644
--- a/debian/compat
+++ b/debian/compat
@@ -1 +1 @@
-5
+7
diff --git a/debian/control b/debian/control
index bf49940..fd27ef8 100644
--- a/debian/control
+++ b/debian/control
@@ -2,16 +2,38 @@ Source: dovecot-antispam
 Section: mail
 Priority: optional
 Maintainer: Ron Lee <r...@debian.org>
-Build-Depends: debhelper (>= 5), dovecot-dev
-Standards-Version: 3.8.2.0
+Build-Depends: debhelper (>= 7), dovecot-dev
+Standards-Version: 3.8.3
 Homepage: http://johannes.sipsolutions.net/Projects/dovecot-antispam
 Vcs-Git: git://git.debian.org/users/ron/dovecot-antispam.git
 Vcs-Browser: http://git.debian.org/?p=users/ron/dovecot-antispam.git;a=summary
 
 Package: dovecot-antispam
+Architecture: all
+Depends: ${shlibs:Depends}, ${misc:Depends}, dovecot-antispam-mailtrain
+Description: a Dovecot plugin that helps train spam filters - transitional package
+ dovecot-antispam provides a plugin for the Dovecot IMAP server that
+ helps train spam filters. It watches designated spam folders and
+ trains mail as spam or non-spam when it moves in or out of those
+ folders respectively.  This avoids the problem of needing additional
+ folders to track correctly and incorrectly classified spam and non-spam.
+ .
+ dovecot-antispam supports dspam, crm114, and generic training by
+ mailing spam and non-spam to training addresses.  For crm114, it
+ supports folders for the additional "unsure" classification, and
+ trains when moving from there to spam or normal folders.
+ .
+ Note that dovecot-antispam needs the type of spam filter configured at
+ compile time.  It supports building with a custom name, specifically
+ to allow installing multiple variations simultaneously.
+ .
+ This package is a transitional package to dovecot-antispam-mailtrain
+ and can be removed safely.
+
+Package: dovecot-antispam-backend-mailtrain
 Architecture: any
 Depends: ${shlibs:Depends}, ${misc:Depends}, dovecot-imapd
-Description: a Dovecot plugin that helps train spam filters
+Description: a Dovecot plugin that helps train spam filters - mailtrain backend
  dovecot-antispam provides a plugin for the Dovecot IMAP server that
  helps train spam filters. It watches designated spam folders and
  trains mail as spam or non-spam when it moves in or out of those
@@ -27,3 +49,66 @@ Description: a Dovecot plugin that helps train spam filters
  compile time.  It supports building with a custom name, specifically
  to allow installing multiple variations simultaneously.  This package
  is built to use the mailtrain backend.
+
+Package: dovecot-antispam-backend-dspam
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, dovecot-imapd
+Recommends: dspam
+Description: a Dovecot plugin that helps train spam filters - dspam backend
+ dovecot-antispam provides a plugin for the Dovecot IMAP server that
+ helps train spam filters. It watches designated spam folders and
+ trains mail as spam or non-spam when it moves in or out of those
+ folders respectively.  This avoids the problem of needing additional
+ folders to track correctly and incorrectly classified spam and non-spam.
+ .
+ dovecot-antispam supports dspam, crm114, and generic training by
+ mailing spam and non-spam to training addresses.  For crm114, it
+ supports folders for the additional "unsure" classification, and
+ trains when moving from there to spam or normal folders.
+ .
+ Note that dovecot-antispam needs the type of spam filter configured at
+ compile time.  It supports building with a custom name, specifically
+ to allow installing multiple variations simultaneously.  This package
+ is built to use the dspam backend.
+
+Package: dovecot-antispam-backend-crm114
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, dovecot-imapd
+Recommends: crm114
+Description: a Dovecot plugin that helps train spam filters - crm114 backend
+ dovecot-antispam provides a plugin for the Dovecot IMAP server that
+ helps train spam filters. It watches designated spam folders and
+ trains mail as spam or non-spam when it moves in or out of those
+ folders respectively.  This avoids the problem of needing additional
+ folders to track correctly and incorrectly classified spam and non-spam.
+ .
+ dovecot-antispam supports dspam, crm114, and generic training by
+ mailing spam and non-spam to training addresses.  For crm114, it
+ supports folders for the additional "unsure" classification, and
+ trains when moving from there to spam or normal folders.
+ .
+ Note that dovecot-antispam needs the type of spam filter configured at
+ compile time.  It supports building with a custom name, specifically
+ to allow installing multiple variations simultaneously.  This package
+ is built to use the crm114 backend.
+
+Package: dovecot-antispam-backend-spool2dir
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, dovecot-imapd
+Description: a Dovecot plugin that helps train spam filters - spool2dir backend
+ dovecot-antispam provides a plugin for the Dovecot IMAP server that
+ helps train spam filters. It watches designated spam folders and
+ trains mail as spam or non-spam when it moves in or out of those
+ folders respectively.  This avoids the problem of needing additional
+ folders to track correctly and incorrectly classified spam and non-spam.
+ .
+ dovecot-antispam supports dspam, crm114, and generic training by
+ mailing spam and non-spam to training addresses.  For crm114, it
+ supports folders for the additional "unsure" classification, and
+ trains when moving from there to spam or normal folders.
+ .
+ Note that dovecot-antispam needs the type of spam filter configured at
+ compile time.  It supports building with a custom name, specifically
+ to allow installing multiple variations simultaneously.  This package
+ is built to use the spool2dir backend.
+
diff --git a/debian/dovecot-antispam-backend-crm114.dirs b/debian/dovecot-antispam-backend-crm114.dirs
new file mode 100644
index 0000000..e5a37d1
--- /dev/null
+++ b/debian/dovecot-antispam-backend-crm114.dirs
@@ -0,0 +1 @@
+usr/lib/dovecot/modules/imap
diff --git a/debian/dovecot-antispam-backend-crm114.install b/debian/dovecot-antispam-backend-crm114.install
new file mode 100644
index 0000000..b43a40e
--- /dev/null
+++ b/debian/dovecot-antispam-backend-crm114.install
@@ -0,0 +1 @@
+lib90_crm114_plugin.so usr/lib/dovecot/modules/imap
diff --git a/debian/dovecot-antispam-backend-dspam.dirs b/debian/dovecot-antispam-backend-dspam.dirs
new file mode 100644
index 0000000..e5a37d1
--- /dev/null
+++ b/debian/dovecot-antispam-backend-dspam.dirs
@@ -0,0 +1 @@
+usr/lib/dovecot/modules/imap
diff --git a/debian/dovecot-antispam-backend-dspam.install b/debian/dovecot-antispam-backend-dspam.install
new file mode 100644
index 0000000..e96e4b7
--- /dev/null
+++ b/debian/dovecot-antispam-backend-dspam.install
@@ -0,0 +1 @@
+lib90_dspam_plugin.so usr/lib/dovecot/modules/imap
diff --git a/debian/dovecot-antispam-backend-mailtrain.dirs b/debian/dovecot-antispam-backend-mailtrain.dirs
new file mode 100644
index 0000000..e5a37d1
--- /dev/null
+++ b/debian/dovecot-antispam-backend-mailtrain.dirs
@@ -0,0 +1 @@
+usr/lib/dovecot/modules/imap
diff --git a/debian/dovecot-antispam-backend-mailtrain.install b/debian/dovecot-antispam-backend-mailtrain.install
new file mode 100644
index 0000000..862d275
--- /dev/null
+++ b/debian/dovecot-antispam-backend-mailtrain.install
@@ -0,0 +1 @@
+lib90_antispam_plugin.so usr/lib/dovecot/modules/imap
diff --git a/debian/dovecot-antispam-backend-spool2dir.dirs b/debian/dovecot-antispam-backend-spool2dir.dirs
new file mode 100644
index 0000000..e5a37d1
--- /dev/null
+++ b/debian/dovecot-antispam-backend-spool2dir.dirs
@@ -0,0 +1 @@
+usr/lib/dovecot/modules/imap
diff --git a/debian/dovecot-antispam-backend-spool2dir.install b/debian/dovecot-antispam-backend-spool2dir.install
new file mode 100644
index 0000000..a3af840
--- /dev/null
+++ b/debian/dovecot-antispam-backend-spool2dir.install
@@ -0,0 +1 @@
+lib90_spool2dir_plugin.so usr/lib/dovecot/modules/imap
diff --git a/debian/dovecot-antispam-config b/debian/dovecot-antispam-config
deleted file mode 100644
index d094d11..0000000
--- a/debian/dovecot-antispam-config
+++ /dev/null
@@ -1,50 +0,0 @@
-# Example plugin build time configuration
-#
-# This file lists the configuration options that are used when building the
-# antispam plugin. All lines starting with # are ignored. Configuration option
-# lines must be commented out completely, if they are not to be included,
-# i.e. just setting VARIABLE=n is not disabling that variable.
-#
-# This file is included in Makefile, so variables like CFLAGS and LIBS can also
-# be modified from here. In most cases, these lines should use += in order not
-# to override previous values of the variables.
-
-# backend (select exactly one)
-#  dspam-exec		- direct dspam training by calling dspam executable
-#  signature-log	- signature logging using dovecot's dict API
-#  mailtrain		- send mail to special addresses for training
-#  crm114-exec		- direct crm114 training by calling mailreaver.crm
-#BACKEND=dspam-exec
-#BACKEND=signature-log
-BACKEND=mailtrain
-#BACKEND=crm114-exec
-
-# Dovecot build/header directory
-# Building the plugin requires configured dovecot sources or having
-# configured it with --enable-header-install in which case you can
-# point DOVECOT= to the installed headers too.
-#DOVECOT=../dovecot-1.0.5
-#DOVECOT=../dovecot-1.1
-DOVECOT=/usr/include/dovecot
-
-# install directory for 'make install'
-# NB no need for a final '/'
-INSTALLDIR=/usr/lib/dovecot/modules/imap
-# The user and group for the installed plugin
-USER=root
-GROUP=root
-
-# enable debugging to syslog or stderr
-#DEBUG=stderr
-#DEBUG=syslog
-
-# verbose debugging (lots of output!)
-#DEBUG_VERBOSE=1
-
-# plugin name, change only if you need to rename the plugin
-# (because, for example, you need two instances for different
-# spam filters installed)
-PLUGINNAME=antispam
-
-# extra CFLAGS
-# CFLAGS += -g3
diff --git a/debian/rules b/debian/rules
index 0ac5356..b85cbe2 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,35 +1,74 @@
 #!/usr/bin/make -f
 
+BACKENDS+=mailtrain
+BACKENDS+=dspam
+BACKENDS+=crm114
+BACKENDS+=spool2dir
+
 build: build-stamp
 
-build-stamp:
-	dh_testdir
-	cp debian/dovecot-antispam-config .config
+build-mailtrain: clean-int
+	cp -f defconfig .config
+	echo "BACKEND=mailtrain" >> .config
+	$(MAKE)
+
+build-dspam: clean-int
+	cp -f defconfig .config
+	echo "BACKEND=dspam-exec" >> .config
+	sed -i 's/^PLUGINNAME=antispam/PLUGINNAME=dspam/' .config
+	$(MAKE)
+
+build-crm114: clean-int
+	cp -f defconfig .config
+	echo "BACKEND=crm114-exec" >> .config
+	sed -i 's/^PLUGINNAME=antispam/PLUGINNAME=crm114/' .config
+	$(MAKE)
+
+build-spool2dir: clean-int
+	cp -f defconfig .config
+	echo "BACKEND=spool2dir" >> .config
+	sed -i 's/^PLUGINNAME=antispam/PLUGINNAME=spool2dir/' .config
 	$(MAKE)
-	touch $@
+
+build-stamp: $(foreach v,$(BACKENDS),build-$(v))
+	dh_testdir
+	touch build-stamp
+
+clean-int:
+	$(MAKE) clean
+	$(RM) .config
+	dh_clean
 
 clean:
 	dh_testdir
 	dh_testroot
 	rm -f build-stamp
 	$(MAKE) clean	
-	$(RM) .config dovecot-antispam.7
+	$(RM) .config
 	dh_clean
 
-install: build
+install: build $(foreach v,$(BACKENDS),build-$(v))
 	dh_testdir
 	dh_testroot
 	dh_clean -k
-	dh_install lib90_antispam_plugin.so usr/lib/dovecot/modules/imap
-	ln -sf antispam.7 dovecot-antispam.7
-	dh_installman dovecot-antispam.7
 
 binary-indep: build install
+	dh_testdir
+	dh_testroot
+	dh_installdocs -A NOTES README
+	dh_compress
+	dh_fixperms
+	dh_installdeb
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
 
 binary-arch: build install
 	dh_testdir
 	dh_testroot
-	dh_installdocs
+	dh_install
+	dh_installman -A -Ndovecot-antispam antispam.7
+	dh_installdocs -A NOTES README
 	dh_installchangelogs
 	dh_strip
 	dh_compress
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 0000000..42262f5
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,2 @@
+version=3
+http://johannes.sipsolutions.net/download/dovecot-antispam/dovecot-antispam-(.*)\.tar.bz2
-- 
1.7.1

>From c24412a22a75bf78ea1fa22f320deff5d5553ccf Mon Sep 17 00:00:00 2001
From: Rodolphe Pelloux-Prayer <rodol...@damsy.net>
Date: Wed, 12 May 2010 12:59:24 +0200
Subject: [PATCH 3/9] Bump Standards version to 3.8.4

---
 debian/control |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/debian/control b/debian/control
index fd27ef8..1b787d4 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,7 @@ Section: mail
 Priority: optional
 Maintainer: Ron Lee <r...@debian.org>
 Build-Depends: debhelper (>= 7), dovecot-dev
-Standards-Version: 3.8.3
+Standards-Version: 3.8.4
 Homepage: http://johannes.sipsolutions.net/Projects/dovecot-antispam
 Vcs-Git: git://git.debian.org/users/ron/dovecot-antispam.git
 Vcs-Browser: http://git.debian.org/?p=users/ron/dovecot-antispam.git;a=summary
-- 
1.7.1

>From b0eaf7aea52e423df49a5f30e4320a1d98aa0a49 Mon Sep 17 00:00:00 2001
From: Rodolphe Pelloux-Prayer <rodol...@damsy.net>
Date: Wed, 12 May 2010 11:31:55 +0200
Subject: [PATCH 4/9] Add debian/source/format file (3.0 quilt).

---
 debian/source/format |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 debian/source/format

diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
-- 
1.7.1

>From f66b210fcb98a3afcfaa23b794b13e97320572cf Mon Sep 17 00:00:00 2001
From: Rodolphe Pelloux-Prayer <rodol...@damsy.net>
Date: Wed, 12 May 2010 13:33:07 +0200
Subject: [PATCH 5/9] Patch version.sh : remove git detection.

---
 debian/control                                     |    2 +-
 .../0001-Remove-git-detection-in-version.sh.patch  |   36 ++++++++++++++++++++
 debian/patches/series                              |    1 +
 3 files changed, 38 insertions(+), 1 deletions(-)
 create mode 100644 debian/patches/0001-Remove-git-detection-in-version.sh.patch
 create mode 100644 debian/patches/series

diff --git a/debian/control b/debian/control
index 1b787d4..2ea5f54 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@ Source: dovecot-antispam
 Section: mail
 Priority: optional
 Maintainer: Ron Lee <r...@debian.org>
-Build-Depends: debhelper (>= 7), dovecot-dev
+Build-Depends: debhelper (>= 7), dovecot-dev, quilt
 Standards-Version: 3.8.4
 Homepage: http://johannes.sipsolutions.net/Projects/dovecot-antispam
 Vcs-Git: git://git.debian.org/users/ron/dovecot-antispam.git
diff --git a/debian/patches/0001-Remove-git-detection-in-version.sh.patch b/debian/patches/0001-Remove-git-detection-in-version.sh.patch
new file mode 100644
index 0000000..abc8264
--- /dev/null
+++ b/debian/patches/0001-Remove-git-detection-in-version.sh.patch
@@ -0,0 +1,36 @@
+From: Rodolphe Pelloux-Prayer <rodol...@damsy.net>
+Date: Wed, 12 May 2010 13:31:34 +0200
+Subject: [PATCH] Remove git detection in version.sh.
+
+---
+ version.sh |   19 +------------------
+ 1 files changed, 1 insertions(+), 18 deletions(-)
+
+diff --git a/version.sh b/version.sh
+index cae4b64..9f2c5e9 100755
+--- a/version.sh
++++ b/version.sh
+@@ -1,21 +1,4 @@
+ #!/bin/sh
+ 
+ VERSION=1.3
+-
+-if head=$(git rev-parse --verify HEAD 2>/dev/null); then
+-	git update-index --refresh --unmerged > /dev/null
+-	descr=$(git describe)
+-	
+-	# on git builds check that the version number above
+-	# is correct...
+-	[ "${descr%%-*}" = "v$VERSION" ] || exit 2
+-
+-	echo -n '#define ANTISPAM_VERSION "'
+-	echo -n "${descr#v}"
+-	if git diff-index --name-only HEAD | read dummy ; then
+-		echo -n "-dirty"
+-	fi
+-	echo '"'
+-else
+-	echo '#define ANTISPAM_VERSION "'$VERSION'-notgit"'
+-fi
++echo '#define ANTISPAM_VERSION "'$VERSION'-notgit"'
+-- 
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..9c49bb0
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+0001-Remove-git-detection-in-version.sh.patch
-- 
1.7.1

>From f5d76bbf6c0c8a7df72a6d2843fc1966d50f04bb Mon Sep 17 00:00:00 2001
From: Rodolphe Pelloux-Prayer <rodol...@damsy.net>
Date: Fri, 14 May 2010 16:28:10 +0200
Subject: [PATCH 6/9] Use dh_prep instead of dh_clean -k.

---
 debian/rules |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/debian/rules b/debian/rules
index b85cbe2..acf4b67 100755
--- a/debian/rules
+++ b/debian/rules
@@ -50,7 +50,7 @@ clean:
 install: build $(foreach v,$(BACKENDS),build-$(v))
 	dh_testdir
 	dh_testroot
-	dh_clean -k
+	dh_prep
 
 binary-indep: build install
 	dh_testdir
-- 
1.7.1

>From 478a6308b33028852bf7ddf8e9df15e0beb4a7e9 Mon Sep 17 00:00:00 2001
From: Rodolphe Pelloux-Prayer <rodol...@damsy.net>
Date: Fri, 14 May 2010 16:56:46 +0200
Subject: [PATCH 7/9] Rename plugin to antispam_backend (backend=crm114|dspam|mailtrain|spool2dir).

---
 debian/dovecot-antispam-backend-crm114.install    |    2 +-
 debian/dovecot-antispam-backend-dspam.install     |    2 +-
 debian/dovecot-antispam-backend-mailtrain.install |    2 +-
 debian/dovecot-antispam-backend-spool2dir.install |    2 +-
 debian/rules                                      |    9 +++++----
 5 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/debian/dovecot-antispam-backend-crm114.install b/debian/dovecot-antispam-backend-crm114.install
index b43a40e..b6c131f 100644
--- a/debian/dovecot-antispam-backend-crm114.install
+++ b/debian/dovecot-antispam-backend-crm114.install
@@ -1 +1 @@
-lib90_crm114_plugin.so usr/lib/dovecot/modules/imap
+lib90_antispam_crm114_plugin.so usr/lib/dovecot/modules/imap
diff --git a/debian/dovecot-antispam-backend-dspam.install b/debian/dovecot-antispam-backend-dspam.install
index e96e4b7..154be85 100644
--- a/debian/dovecot-antispam-backend-dspam.install
+++ b/debian/dovecot-antispam-backend-dspam.install
@@ -1 +1 @@
-lib90_dspam_plugin.so usr/lib/dovecot/modules/imap
+lib90_antispam_dspam_plugin.so usr/lib/dovecot/modules/imap
diff --git a/debian/dovecot-antispam-backend-mailtrain.install b/debian/dovecot-antispam-backend-mailtrain.install
index 862d275..2f41044 100644
--- a/debian/dovecot-antispam-backend-mailtrain.install
+++ b/debian/dovecot-antispam-backend-mailtrain.install
@@ -1 +1 @@
-lib90_antispam_plugin.so usr/lib/dovecot/modules/imap
+lib90_antispam_mailtrain_plugin.so usr/lib/dovecot/modules/imap
diff --git a/debian/dovecot-antispam-backend-spool2dir.install b/debian/dovecot-antispam-backend-spool2dir.install
index a3af840..6db09c7 100644
--- a/debian/dovecot-antispam-backend-spool2dir.install
+++ b/debian/dovecot-antispam-backend-spool2dir.install
@@ -1 +1 @@
-lib90_spool2dir_plugin.so usr/lib/dovecot/modules/imap
+lib90_antispam_spool2dir_plugin.so usr/lib/dovecot/modules/imap
diff --git a/debian/rules b/debian/rules
index acf4b67..bdb233d 100755
--- a/debian/rules
+++ b/debian/rules
@@ -10,24 +10,25 @@ build: build-stamp
 build-mailtrain: clean-int
 	cp -f defconfig .config
 	echo "BACKEND=mailtrain" >> .config
+	sed -i 's/^PLUGINNAME=antispam/PLUGINNAME=antispam_mailtrain/' .config
 	$(MAKE)
 
 build-dspam: clean-int
 	cp -f defconfig .config
 	echo "BACKEND=dspam-exec" >> .config
-	sed -i 's/^PLUGINNAME=antispam/PLUGINNAME=dspam/' .config
+	sed -i 's/^PLUGINNAME=antispam/PLUGINNAME=antispam_dspam/' .config
 	$(MAKE)
 
 build-crm114: clean-int
 	cp -f defconfig .config
 	echo "BACKEND=crm114-exec" >> .config
-	sed -i 's/^PLUGINNAME=antispam/PLUGINNAME=crm114/' .config
+	sed -i 's/^PLUGINNAME=antispam/PLUGINNAME=antispam_crm114/' .config
 	$(MAKE)
 
 build-spool2dir: clean-int
 	cp -f defconfig .config
 	echo "BACKEND=spool2dir" >> .config
-	sed -i 's/^PLUGINNAME=antispam/PLUGINNAME=spool2dir/' .config
+	sed -i 's/^PLUGINNAME=antispam/PLUGINNAME=antispam_spool2dir/' .config
 	$(MAKE)
 
 build-stamp: $(foreach v,$(BACKENDS),build-$(v))
@@ -43,7 +44,7 @@ clean:
 	dh_testdir
 	dh_testroot
 	rm -f build-stamp
-	$(MAKE) clean	
+	$(MAKE) clean
 	$(RM) .config
 	dh_clean
 
-- 
1.7.1

>From 4178b6b62c2514b8bdda8c80cca42c993dec42e8 Mon Sep 17 00:00:00 2001
From: Rodolphe Pelloux-Prayer <rodol...@damsy.net>
Date: Fri, 14 May 2010 17:45:22 +0200
Subject: [PATCH 8/9] Add basic README.Debian.

---
 debian/README.Debian                           |    6 ++++++
 debian/dovecot-antispam-backend-crm114.docs    |    1 +
 debian/dovecot-antispam-backend-dspam.docs     |    1 +
 debian/dovecot-antispam-backend-mailtrain.docs |    1 +
 debian/dovecot-antispam-backend-spool2dir.docs |    1 +
 debian/rules                                   |    4 ++--
 6 files changed, 12 insertions(+), 2 deletions(-)
 create mode 100644 debian/README.Debian
 create mode 100644 debian/dovecot-antispam-backend-crm114.docs
 create mode 100644 debian/dovecot-antispam-backend-dspam.docs
 create mode 100644 debian/dovecot-antispam-backend-mailtrain.docs
 create mode 100644 debian/dovecot-antispam-backend-spool2dir.docs

diff --git a/debian/README.Debian b/debian/README.Debian
new file mode 100644
index 0000000..da3fd0f
--- /dev/null
+++ b/debian/README.Debian
@@ -0,0 +1,6 @@
+In debian, antispam plugin is split by backends.
+In dovecot.conf, use antispam_mailtrain, antispam_dspam, antispam_crm114 or
+antispam_spool2dir instead of antispam for each plugin option.
+
+With dspam backend, 'antispam_dspam_binary = /usr/bin/dspam' will be
+'antispam_dspam_dspam_binary = /usr/bin/dspam'
diff --git a/debian/dovecot-antispam-backend-crm114.docs b/debian/dovecot-antispam-backend-crm114.docs
new file mode 100644
index 0000000..e174728
--- /dev/null
+++ b/debian/dovecot-antispam-backend-crm114.docs
@@ -0,0 +1 @@
+debian/README.Debian
diff --git a/debian/dovecot-antispam-backend-dspam.docs b/debian/dovecot-antispam-backend-dspam.docs
new file mode 100644
index 0000000..e174728
--- /dev/null
+++ b/debian/dovecot-antispam-backend-dspam.docs
@@ -0,0 +1 @@
+debian/README.Debian
diff --git a/debian/dovecot-antispam-backend-mailtrain.docs b/debian/dovecot-antispam-backend-mailtrain.docs
new file mode 100644
index 0000000..e174728
--- /dev/null
+++ b/debian/dovecot-antispam-backend-mailtrain.docs
@@ -0,0 +1 @@
+debian/README.Debian
diff --git a/debian/dovecot-antispam-backend-spool2dir.docs b/debian/dovecot-antispam-backend-spool2dir.docs
new file mode 100644
index 0000000..e174728
--- /dev/null
+++ b/debian/dovecot-antispam-backend-spool2dir.docs
@@ -0,0 +1 @@
+debian/README.Debian
diff --git a/debian/rules b/debian/rules
index bdb233d..01bc05c 100755
--- a/debian/rules
+++ b/debian/rules
@@ -56,7 +56,7 @@ install: build $(foreach v,$(BACKENDS),build-$(v))
 binary-indep: build install
 	dh_testdir
 	dh_testroot
-	dh_installdocs -A NOTES README
+	dh_installdocs
 	dh_compress
 	dh_fixperms
 	dh_installdeb
@@ -69,7 +69,7 @@ binary-arch: build install
 	dh_testroot
 	dh_install
 	dh_installman -A -Ndovecot-antispam antispam.7
-	dh_installdocs -A NOTES README
+	dh_installdocs
 	dh_installchangelogs
 	dh_strip
 	dh_compress
-- 
1.7.1

>From 2a70af70a59df7cc664f1ae632a4e9f713fe93bf Mon Sep 17 00:00:00 2001
From: Rodolphe Pelloux-Prayer <rodol...@damsy.net>
Date: Fri, 14 May 2010 22:51:22 +0200
Subject: [PATCH 9/9] =?UTF-8?q?Prepare=20a=201.3=20release=20=E2=80=A6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 debian/changelog |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 4522386..4306358 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,6 @@
-dovecot-antispam (1.2+20090702-1.1) unstable; urgency=low
+dovecot-antispam (1.2+20090702-1.1) UNRELEASED; urgency=low
 
+  [ Julien Valroff ]
   * Non-maintainer upload.
   * Builds multiple binary packages for each available backend
     (Closes: #540283)
@@ -8,7 +9,18 @@ dovecot-antispam (1.2+20090702-1.1) unstable; urgency=low
   * Bump DH compat to 7
   * Add watchfile to track new upstream releases
 
- -- Julien Valroff <jul...@kirya.net>  Wed, 18 Nov 2009 14:17:48 +0100
+  [ Rodolphe Pelloux-Prayer ]
+  * Imported Upstream version 1.3
+  * Apply Julien Valroff's patch.
+  * Bump Standards version to 3.8.4
+  * Add debian/source/format file (3.0 quilt).
+  * Patch version.sh : remove git detection.
+  * Use dh_prep instead of dh_clean -k.
+  * Rename plugin to antispam_backend
+    (backend=crm114|dspam|mailtrain|spool2dir).
+  * Add basic README.Debian.
+
+ -- Rodolphe Pelloux-Prayer <rodol...@damsy.net>  Fri, 14 May 2010 22:46:30 +0200
 
 dovecot-antispam (1.2+20090702-1) unstable; urgency=low
 
-- 
1.7.1

Reply via email to