[packages/dovecot-antispam] - adjust for dovecot 2.2 - GIT_DIR env var confuses version.sh script in package

baggins baggins at pld-linux.org
Tue Jul 23 20:08:22 CEST 2013


commit 454445255da21bfe236e31e6262f18419f794456
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Tue Jul 23 20:07:48 2013 +0200

    - adjust for dovecot 2.2
    - GIT_DIR env var confuses version.sh script in package

 dovecot-2.2.patch     | 41 +++++++++++++++++++++++++++++++++++++++++
 dovecot-antispam.spec |  5 ++++-
 2 files changed, 45 insertions(+), 1 deletion(-)
---
diff --git a/dovecot-antispam.spec b/dovecot-antispam.spec
index 0301707..c245d60 100644
--- a/dovecot-antispam.spec
+++ b/dovecot-antispam.spec
@@ -2,12 +2,13 @@ Summary:	The dovecot antispam plugin
 Summary(pl.UTF-8):	Wtyczka antyspamowa dla dovecota
 Name:		dovecot-antispam
 Version:	2.0
-Release:	12
+Release:	12.1
 License:	GPL v2
 Group:		Daemons
 Source0:	http://johannes.sipsolutions.net/download/dovecot-antispam/%{name}-%{version}.tar.bz2
 # Source0-md5:	14547898759fbd93f2b98304520decc6
 Patch0:		%{name}-git.patch
+Patch1:		dovecot-2.2.patch
 URL:		http://johannes.sipsolutions.net/Projects/dovecot-antispam
 BuildRequires:	dovecot-devel >= 1:2.0
 %requires_eq_to	dovecot dovecot-devel
@@ -22,8 +23,10 @@ way it was moved).
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 
 %build
+unset GIT_DIR
 %{__make} \
 	CFLAGS="%{rpmcflags}" \
 	LDFLAGS="%{rpmldflags}"
diff --git a/dovecot-2.2.patch b/dovecot-2.2.patch
new file mode 100644
index 0000000..7fef91e
--- /dev/null
+++ b/dovecot-2.2.patch
@@ -0,0 +1,41 @@
+diff -ur dovecot-antispam-2.0/antispam-plugin.h dovecot-antispam-2.0-2.2/antispam-plugin.h
+--- dovecot-antispam-2.0/antispam-plugin.h	2013-07-16 08:49:17.445971507 +0200
++++ dovecot-antispam-2.0-2.2/antispam-plugin.h	2013-07-16 08:47:54.968547139 +0200
+@@ -287,6 +287,25 @@
+ {
+ 	return dict_init(uri, DICT_DATA_TYPE_STRING, username, NULL);
+ }
++#elif DOVECOT_IS_EQ(2, 2)
++#define mempool_unref		pool_unref
++#define module_arg		struct module *
++#define ME(err)			MAIL_ERROR_ ##err,
++
++static inline const char *const *
++get_mail_headers(struct mail *mail, const char *hdr)
++{
++	const char *const *ret;
++	if (mail_get_headers(mail, hdr, &ret))
++		return NULL;
++	return ret;
++}
++
++static inline struct ostream *
++o_stream_create_from_fd(int fd, pool_t pool ATTR_UNUSED)
++{
++	return o_stream_create_fd(fd, 0, TRUE);
++}
+ #else
+ #error "Building against this dovecot version is not supported"
+ #endif
+diff -ur dovecot-antispam-2.0/dovecot-version.c dovecot-antispam-2.0-2.2/dovecot-version.c
+--- dovecot-antispam-2.0/dovecot-version.c	2013-07-16 08:49:17.445971507 +0200
++++ dovecot-antispam-2.0-2.2/dovecot-version.c	2013-07-16 08:48:53.755753877 +0200
+@@ -55,7 +55,7 @@
+ 		"DOVECOT_VCODE <= DOVECOT_VERSION_CODE(maj, min, 0)\n");
+ 
+ 	/* Use the antispam-storage-2.0.c for dovecot 2.1 as well */
+-	if (maj == 2 && min == 1)
++	if (maj == 2 && (min == 1 || min == 2))
+ 		min = 0;
+ 
+ 	printf("#define ANTISPAM_STORAGE			"
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/dovecot-antispam.git/commitdiff/454445255da21bfe236e31e6262f18419f794456



More information about the pld-cvs-commit mailing list