Package: cyrus-sasl2
Version: 2.1.22.dfsg1-16
Tags: patch
User: [EMAIL PROTECTED]
Usertags: origin-ubuntu hardy ubuntu-patch

Hi!

In the interest of cleaning up old db4.x versions it would be great if
you could move cyrus-sasl2 to the latest libdb4.6. I attach a patch
for this.

Two things which should be considered:

 * I did not do any performance tests. Performance does not seem
   overly crucial to me for an authentication database.

 * The data format between the various db4.x did not change, and
   cyrus-sasl does not use on-disk transactions (in fact it does not
   use any transactions at all, check grep -r DB_TXN). Thus the
   upgrade in the postinst is not necessary. However, in the spirit of
   the existing 4.2->4.4 upgrade I updated this code for 4.4->4.6,
   too. You need to adapt the package version number in the patch.

Thanks for considering,

Martin
-- 
Martin Pitt        http://www.piware.de
Ubuntu Developer   http://www.ubuntu.com
Debian Developer   http://www.debian.org
diff -u cyrus-sasl2-2.1.22.dfsg1/debian/control 
cyrus-sasl2-2.1.22.dfsg1/debian/control
--- cyrus-sasl2-2.1.22.dfsg1/debian/control
+++ cyrus-sasl2-2.1.22.dfsg1/debian/control
@@ -5,14 +5,14 @@
 XSBC-Original-Maintainer: Debian Cyrus SASL Team <[EMAIL PROTECTED]>
 Uploaders: Fabian Fagerholm <[EMAIL PROTECTED]>, Roberto C. Sanchez <[EMAIL 
PROTECTED]>
 Standards-Version: 3.7.2
-Build-Depends: debhelper (>= 5.0.0), dpatch, autotools-dev, automake1.9, 
autoconf, libtool, libdb4.4-dev (>= 4.4.16-2), libpam0g-dev (>= 0.76-22), 
libssl-dev (>= 0.9.7e-3), libmysqlclient15-dev (>= 5.0.20-1), libopie-dev (>= 
2.32-10), libpq-dev (>= 8.1.3-4), libkrb5-dev, libsqlite0-dev (>= 2.8.16-1), 
libldap2-dev (>= 2.1.30-8), chrpath, groff-base, debconf (>= 0.5) | 
debconf-2.0, po-debconf, docbook-to-man
+Build-Depends: debhelper (>= 5.0.0), dpatch, autotools-dev, automake1.9, 
autoconf, libtool, libdb-dev (>= 4.4.16-2), libpam0g-dev (>= 0.76-22), 
libssl-dev (>= 0.9.7e-3), libmysqlclient15-dev (>= 5.0.20-1), libopie-dev (>= 
2.32-10), libpq-dev (>= 8.1.3-4), libkrb5-dev, libsqlite0-dev (>= 2.8.16-1), 
libldap2-dev (>= 2.1.30-8), chrpath, groff-base, debconf (>= 0.5) | 
debconf-2.0, po-debconf, docbook-to-man
 Build-Conflicts: heimdal-dev
 
 Package: sasl2-bin
 Section: utils
 Priority: optional
 Architecture: any
-Depends: libsasl2-2 (>= ${binary:Version}), ${shlibs:Depends}, 
${misc:Depends}, lsb-base (>= 3.0-6), db4.4-util, debconf (>= 1.4.69) | 
cdebconf (>= 0.39), sysv-rc (>= 2.86.ds1-14.1ubuntu2)
+Depends: libsasl2-2 (>= ${binary:Version}), ${shlibs:Depends}, 
${misc:Depends}, lsb-base (>= 3.0-6), db4.6-util, debconf (>= 1.4.69) | 
cdebconf (>= 0.39), sysv-rc (>= 2.86.ds1-14.1ubuntu2)
 Description: Cyrus SASL - administration programs for SASL users database
  This is the Cyrus SASL API implementation, version 2.1. See package
  libsasl2-2 and RFC 2222 for more information.
diff -u cyrus-sasl2-2.1.22.dfsg1/debian/sasl2-bin.postinst 
cyrus-sasl2-2.1.22.dfsg1/debian/sasl2-bin.postinst
--- cyrus-sasl2-2.1.22.dfsg1/debian/sasl2-bin.postinst
+++ cyrus-sasl2-2.1.22.dfsg1/debian/sasl2-bin.postinst
@@ -17,7 +17,8 @@
                # Upgrade SASL database if needed
                # The libdb dependency was updated in the following versions:
                #  2.1.22.dfsg1-14 (db4.2 -> db4.4)
-               if dpkg --compare-versions "$2" "lt-nl" 2.1.22.dfsg1-14; then
+               #  2.1.22.dfsg1-16ubuntu2 (db4.4 -> db4.6)
+               if dpkg --compare-versions "$2" "lt-nl" 2.1.22.dfsg1-16ubuntu2; 
then
                        
                        # If the database contains no users, just wipe it out,
                        # it will be recreated later in the current format
@@ -36,7 +37,7 @@
                                fi
 
                                # Upgrade SASL database and handle errors
-                               if ! db4.4_upgrade $SASLDB_FILE >/dev/null 
2>&1; then
+                               if ! db4.6_upgrade $SASLDB_FILE >/dev/null 
2>&1; then
                                        db_input high 
cyrus-sasl2/upgrade-sasldb2-failed || true
                                        db_go || true
                                        cp --archive "$RET" $SASLDB_FILE 
>/dev/null 2>&1
diff -u cyrus-sasl2-2.1.22.dfsg1/debian/changelog 
cyrus-sasl2-2.1.22.dfsg1/debian/changelog
--- cyrus-sasl2-2.1.22.dfsg1/debian/changelog
+++ cyrus-sasl2-2.1.22.dfsg1/debian/changelog
@@ -1,3 +1,15 @@
+cyrus-sasl2 (2.1.22.dfsg1-16ubuntu2) hardy; urgency=low
+
+  * debian/control: Move to db4.6.
+  * Add debian/patches/0017_db4.6.dpatch: Fix autotools macros to recognize db
+    4.6.
+  * debian/sasl2-bin.postinst: Adapt automatic db upgrade to 4.6. Note that
+    this should not be necessary; this package does not use on-disk
+    transactions and the data format did not change, but it was done for the
+    4.2->4.4 upgrade in the past to be on the safe side.
+
+ -- Martin Pitt <[EMAIL PROTECTED]>  Thu, 03 Jan 2008 12:05:44 +0100
+
 cyrus-sasl2 (2.1.22.dfsg1-16ubuntu1) hardy; urgency=low
 
   * Merge from debian unstable, remaining changes:
diff -u cyrus-sasl2-2.1.22.dfsg1/debian/patches/00list 
cyrus-sasl2-2.1.22.dfsg1/debian/patches/00list
--- cyrus-sasl2-2.1.22.dfsg1/debian/patches/00list
+++ cyrus-sasl2-2.1.22.dfsg1/debian/patches/00list
@@ -16,0 +17 @@
+0017_db4.6
only in patch2:
unchanged:
--- cyrus-sasl2-2.1.22.dfsg1.orig/debian/patches/0017_db4.6.dpatch
+++ cyrus-sasl2-2.1.22.dfsg1/debian/patches/0017_db4.6.dpatch
@@ -0,0 +1,43 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 0017_db4.6.dpatch by  <[EMAIL PROTECTED]>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Support and build against db4.6.
+
[EMAIL PROTECTED]@
+diff -urNad cyrus-sasl2-2.1.22.dfsg1~/aclocal.m4 
cyrus-sasl2-2.1.22.dfsg1/aclocal.m4
+--- cyrus-sasl2-2.1.22.dfsg1~/aclocal.m4       2006-05-18 21:30:08.000000000 
+0200
++++ cyrus-sasl2-2.1.22.dfsg1/aclocal.m4        2008-01-03 12:04:30.000000000 
+0100
+@@ -1691,7 +1691,7 @@
+       fi
+ 
+       saved_LIBS=$LIBS
+-        for dbname in db-4.4 db4.4 db44 db-4.3 db4.3 db43 db-4.2 db4.2 db42 
db-4.1 db4.1 db41 db-4.0 db4.0 db-4 db40 db4 db-3.3 db3.3 db33 db-3.2 db3.2 
db32 db-3.1 db3.1 db31 db-3 db30 db3 db
++        for dbname in db-4.6 db-4.4 db4.4 db44 db-4.3 db4.3 db43 db-4.2 db4.2 
db42 db-4.1 db4.1 db41 db-4.0 db4.0 db-4 db40 db4 db-3.3 db3.3 db33 db-3.2 
db3.2 db32 db-3.1 db3.1 db31 db-3 db30 db3 db
+           do
+           LIBS="$saved_LIBS -l$dbname"
+           AC_TRY_LINK([#include <db.h>],
+diff -urNad cyrus-sasl2-2.1.22.dfsg1~/cmulocal/berkdb.m4 
cyrus-sasl2-2.1.22.dfsg1/cmulocal/berkdb.m4
+--- cyrus-sasl2-2.1.22.dfsg1~/cmulocal/berkdb.m4       2005-04-26 
21:14:07.000000000 +0200
++++ cyrus-sasl2-2.1.22.dfsg1/cmulocal/berkdb.m4        2008-01-03 
12:04:46.000000000 +0100
+@@ -213,7 +213,7 @@
+       fi
+ 
+       saved_LIBS=$LIBS
+-        for dbname in db-4.4 db4.4 db44 db-4.3 db4.3 db43 db-4.2 db4.2 db42 
db-4.1 db4.1 db41 db-4.0 db4.0 db-4 db40 db4 db-3.3 db3.3 db33 db-3.2 db3.2 
db32 db-3.1 db3.1 db31 db-3 db30 db3 db
++        for dbname in db-4.6 db-4.4 db4.4 db44 db-4.3 db4.3 db43 db-4.2 db4.2 
db42 db-4.1 db4.1 db41 db-4.0 db4.0 db-4 db40 db4 db-3.3 db3.3 db33 db-3.2 
db3.2 db32 db-3.1 db3.1 db31 db-3 db30 db3 db
+           do
+           LIBS="$saved_LIBS -l$dbname"
+           AC_TRY_LINK([#include <db.h>],
+diff -urNad cyrus-sasl2-2.1.22.dfsg1~/saslauthd/aclocal.m4 
cyrus-sasl2-2.1.22.dfsg1/saslauthd/aclocal.m4
+--- cyrus-sasl2-2.1.22.dfsg1~/saslauthd/aclocal.m4     2006-05-18 
21:30:17.000000000 +0200
++++ cyrus-sasl2-2.1.22.dfsg1/saslauthd/aclocal.m4      2008-01-03 
12:04:58.000000000 +0100
+@@ -2016,7 +2016,7 @@
+       fi
+ 
+       saved_LIBS=$LIBS
+-        for dbname in db-4.4 db4.4 db44 db-4.3 db4.3 db43 db-4.2 db4.2 db42 
db-4.1 db4.1 db41 db-4.0 db4.0 db-4 db40 db4 db-3.3 db3.3 db33 db-3.2 db3.2 
db32 db-3.1 db3.1 db31 db-3 db30 db3 db
++        for dbname in db-4.6 db-4.4 db4.4 db44 db-4.3 db4.3 db43 db-4.2 db4.2 
db42 db-4.1 db4.1 db41 db-4.0 db4.0 db-4 db40 db4 db-3.3 db3.3 db33 db-3.2 
db3.2 db32 db-3.1 db3.1 db31 db-3 db30 db3 db
+           do
+           LIBS="$saved_LIBS -l$dbname"
+           AC_TRY_LINK([#include <db.h>],

Attachment: signature.asc
Description: Digital signature

Reply via email to