[Pkg-sks-commit] r223 - in sks/trunk/sks/debian: . patches

Christoph Martin chrism at alioth.debian.org
Tue May 31 14:33:30 UTC 2011


Author: chrism
Date: 2011-05-31 14:33:30 +0000 (Tue, 31 May 2011)
New Revision: 223

Added:
   sks/trunk/sks/debian/patches/203_db.patch
   sks/trunk/sks/debian/patches/512_no_XA_berkeleydb.patch
Removed:
   sks/trunk/sks/debian/patches/203_db47.patch
Modified:
   sks/trunk/sks/debian/NEWS
   sks/trunk/sks/debian/README.Debian
   sks/trunk/sks/debian/changelog
   sks/trunk/sks/debian/control
   sks/trunk/sks/debian/patches/series
   sks/trunk/sks/debian/rules
   sks/trunk/sks/debian/sks.docs
   sks/trunk/sks/debian/sks.postinst
Log:
incorporate 6.1 and 6.2 NMU

Modified: sks/trunk/sks/debian/NEWS
===================================================================
--- sks/trunk/sks/debian/NEWS	2010-11-22 15:15:35 UTC (rev 222)
+++ sks/trunk/sks/debian/NEWS	2011-05-31 14:33:30 UTC (rev 223)
@@ -1,3 +1,12 @@
+sks (1.1.1+dpkgv3-6.1) unstable; urgency=low
+
+  sks now uses a Berkeley DB version 5.1 without XA environment.
+  The postinst script should upgrade the database automatically.
+  There will be backup in /var/backups/sks in case something went
+  wrong.
+
+ -- Ondřej Surý <ondrej at debian.org>  Fri, 13 May 2011 12:38:29 +0200
+
 sks (1.1.1+dpkgv3-1) unstable; urgency=high
 
    *** NOTE ***

Modified: sks/trunk/sks/debian/README.Debian
===================================================================
--- sks/trunk/sks/debian/README.Debian	2010-11-22 15:15:35 UTC (rev 222)
+++ sks/trunk/sks/debian/README.Debian	2011-05-31 14:33:30 UTC (rev 223)
@@ -7,34 +7,20 @@
 
 If you don't find one feel free to ask on the SKS mailing list.
 
-You can retrieve one use commands similar to the following lines:
+You can retrieve the keydump by executing following commands as the
+root user (or just su to debian-sks user)):
 
  cd /var/lib/sks/dump
- wget -q -r -np -nd -A asc http://ftp.prato.linux.it/pub/keyring/dump-latest/ -e robots=off
+ su debian-sks -c "wget -q -r -np -nd -A pgp http://ftp.prato.linux.it/pub/keyring/dump-latest/ -e robots=off"
 
 To build the database from the keydumps call:
 
- /usr/lib/sks/sks_build.sh
- chown -R debian-sks:debian-sks /var/lib/sks
+ su debian-sks -c "/usr/lib/sks/sks_build.sh"
 
 To make the server start you have to edit the defaults file:
 
  vi /etc/default/sks
 
-If you have an old database from a Berkely DB Version (e.g 4.6) prior to the
-current version (at the moment 4.7) you have to do the following in
-/var/lib/sks/DB and /var/lib/sks/PTree:
-
- db4.6_checkpoint -1
- db4.6_recover
- db4.7_recover -e
- db4.7_checkpoint -1
- db4.7_archive | xargs --no-run-if-empty rm -f
-
- chown -R debian-sks:debian-sks /var/lib/sks /var/log/sks
-
-Then you can start the database with /etc/init.d/sks start.
-
 If you want to connect to the global sks-network, send a mail to
 pgp-keyserver-folk at flame.org or sks-devel at nongnu.org and ask for
 gossip partners. Include the partners in /etc/sks/membership.
@@ -44,4 +30,4 @@
 Thanks to Peter Palfrader <weasel at debian.org> for building the
 original Debian package.
 
- -- Christoph Martin <christoph.martin at uni-mainz.de>, Mon, 27 Sep 2010 12:07:30 +0200
+ -- Ondřej Surý <ondrej at debian.org>, Thu, 19 May 2011 11:55:48 +0200

Modified: sks/trunk/sks/debian/changelog
===================================================================
--- sks/trunk/sks/debian/changelog	2010-11-22 15:15:35 UTC (rev 222)
+++ sks/trunk/sks/debian/changelog	2011-05-31 14:33:30 UTC (rev 223)
@@ -3,8 +3,31 @@
   * remove default mailsync entry to prevent sks from sending email syncs
     per default (Thanks to Graham Dunn <grdunn at rim.com> for the hint)
 
- --
+ -- Christoph Martin <christoph.martin at uni-mainz.de>  Tue, 31 May 2011 16:04:02 +0200
 
+sks (1.1.1+dpkgv3-6.2) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Handle gracefully missing db directory, which can happen if:
+    + sks was not enabled and didn't create PTree directory
+    + keys haven't been imported to the package
+  * Update instructions for retrieving keydump (Closes: #605454)
+  * Install README from source directory (Closes: #599868)
+  * Use dh_ocaml >= 0.9 (Closes: #599579)
+  * Add hints to run commands as debian-sks user as suggested in the BTS
+
+ -- Ondřej Surý <ondrej at debian.org>  Thu, 19 May 2011 11:56:33 +0200
+
+sks (1.1.1+dpkgv3-6.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Remove XA environment usage (patch from upstream) and use generic -ldb
+    library to link with (Closes: #621384)
+  * Add automagick upgrade of Berkeley DB databases (Closes: #606183)
+  * Change db4.7-util to Recommends: db4.7-util and Depends: db-util
+
+ -- Ondřej Surý <ondrej at debian.org>  Fri, 13 May 2011 12:33:13 +0200
+
 sks (1.1.1+dpkgv3-6) unstable; urgency=high
 
   * fix to not really working fix for strip of bytecode (closes: 599029)

Modified: sks/trunk/sks/debian/control
===================================================================
--- sks/trunk/sks/debian/control	2010-11-22 15:15:35 UTC (rev 222)
+++ sks/trunk/sks/debian/control	2011-05-31 14:33:30 UTC (rev 223)
@@ -4,11 +4,13 @@
 Standards-Version: 3.8.3
 Maintainer: Christoph Martin <christoph.martin at uni-mainz.de>
 Uploaders: Fabio M. Di Nitto <fabbione at fabbione.net>
-Build-Depends: ocaml (>= 3.08), camlp4, libdb4.7-dev, debhelper (>= 7.0.50~), zlib1g-dev, libcryptokit-ocaml-dev (>= 1.2-4), ocaml-nox (>= 1.3-4), perl, perl-doc
+Build-Depends: ocaml (>= 3.08), camlp4, libdb-dev, debhelper (>= 7.0.50~), zlib1g-dev, libcryptokit-ocaml-dev (>= 1.2-4), ocaml-nox (>= 1.3-4), perl, perl-doc, dh-ocaml (>= 0.9~)
 
 Package: sks
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, ${F:OCamlRun}, db4.7-util, adduser, logrotate
+Depends: ${shlibs:Depends}, ${misc:Depends}, ${ocaml:Depends}, db-util, adduser, logrotate
+Provides: ${ocaml:Provides}
+Recommends: db4.7-util
 Suggests: postfix | mail-transport-agent, procmail
 Description: Synchronizing OpenPGP Key Server
  SKS is an OpenPGP key server that correctly handles all OpenPGP features

Added: sks/trunk/sks/debian/patches/203_db.patch
===================================================================
--- sks/trunk/sks/debian/patches/203_db.patch	                        (rev 0)
+++ sks/trunk/sks/debian/patches/203_db.patch	2011-05-31 14:33:30 UTC (rev 223)
@@ -0,0 +1,11 @@
+--- a/bdb/Makefile
++++ b/bdb/Makefile
+@@ -29,7 +29,7 @@
+ OCAMLOPTFLAGS=$(COMMONCAMLFLAGS) -inline 40 
+ 
+ ifndef LIBDB
+-LIBDB=-ldb-4.6
++LIBDB=-ldb
+ endif
+ 
+ COBJS = bdb_stubs.o

Deleted: sks/trunk/sks/debian/patches/203_db47.patch
===================================================================
--- sks/trunk/sks/debian/patches/203_db47.patch	2010-11-22 15:15:35 UTC (rev 222)
+++ sks/trunk/sks/debian/patches/203_db47.patch	2011-05-31 14:33:30 UTC (rev 223)
@@ -1,11 +0,0 @@
---- a/bdb/Makefile
-+++ b/bdb/Makefile
-@@ -29,7 +29,7 @@
- OCAMLOPTFLAGS=$(COMMONCAMLFLAGS) -inline 40 
- 
- ifndef LIBDB
--LIBDB=-ldb-4.6
-+LIBDB=-ldb-4.7
- endif
- 
- COBJS = bdb_stubs.o

Added: sks/trunk/sks/debian/patches/512_no_XA_berkeleydb.patch
===================================================================
--- sks/trunk/sks/debian/patches/512_no_XA_berkeleydb.patch	                        (rev 0)
+++ sks/trunk/sks/debian/patches/512_no_XA_berkeleydb.patch	2011-05-31 14:33:30 UTC (rev 223)
@@ -0,0 +1,44 @@
+--- a/bdb/bdb.ml
++++ b/bdb/bdb.ml
+@@ -55,7 +55,7 @@ struct
+ 
+   type t = db
+ 
+-  type create_flag = XA_CREATE
++  type create_flag
+ 
+   type open_flag = 
+      CREATE | EXCL | NOMMAP | RDONLY | THREAD | TRUNCATE | AUTO_COMMIT
+--- a/bdb/bdb_stubs.c
++++ b/bdb/bdb_stubs.c
+@@ -371,11 +371,10 @@ value caml_dbenv_set_cachesize(value dbe
+ 
+ /**  DB Flags  ***********************************************/
+ static int db_create_flags[] = {
+-  DB_XA_CREATE
+ };
+ 
+ //+
+-//+   type create_flag = XA_CREATE
++//+   type create_flag
+ 
+ static int db_open_flags[] = {
+   DB_CREATE, DB_EXCL, DB_NOMMAP, DB_RDONLY, DB_THREAD, 
+@@ -424,11 +423,16 @@ static int db_set_flags[] = {
+ value caml_db_create(value dbenv_opt, value vflags){
+   CAMLparam2(dbenv_opt,vflags);
+   int err;
+-  int flags = convert_flag_list(vflags,db_create_flags);
++  int flags;
+   DB *db;
+   DB_ENV *dbenv;
+   CAMLlocal1(rval);
+ 
++  /* The flags parameter is currently unused, and must be set to 0. */
++  if (vflags != Val_emptylist)
++    invalid_argument("DB.create invalid create flag");
++  flags = convert_flag_list(vflags,db_create_flags);
++
+   if (Is_None(dbenv_opt)) { dbenv = NULL; }
+   else { 
+     test_dbenv_closed(Some_val(dbenv_opt));

Modified: sks/trunk/sks/debian/patches/series
===================================================================
--- sks/trunk/sks/debian/patches/series	2010-11-22 15:15:35 UTC (rev 222)
+++ sks/trunk/sks/debian/patches/series	2011-05-31 14:33:30 UTC (rev 223)
@@ -1,5 +1,5 @@
 202_makefile_bytecode.patch 
-203_db47.patch 
+203_db.patch 
 500_debian_fhs.patch 
 501_makefile_cflags.patch 
 502_makefile_install.patch 
@@ -7,3 +7,4 @@
 509-content-types.patch 
 510-allowed-chars.patch 
 511_gcc44.patch 
+512_no_XA_berkeleydb.patch

Modified: sks/trunk/sks/debian/rules
===================================================================
--- sks/trunk/sks/debian/rules	2010-11-22 15:15:35 UTC (rev 222)
+++ sks/trunk/sks/debian/rules	2011-05-31 14:33:30 UTC (rev 223)
@@ -12,8 +12,10 @@
 
 export DEB_BUILD_OPTIONS += $(if $(BYTECODE)," nostrip",)
 
+BDB_VERSION ?= $(shell LC_ALL=C dpkg-query -l 'libdb[45].[0-9]-dev' | grep ^ii | sed -e 's|.*\s\libdb\([45]\.[0-9]\)-dev\s.*|\1|')
+
 %:
-	dh  $@
+	dh  $@ --with=ocaml
 
 override_dh_auto_build:
 	dh_auto_build -v --  $(all)
@@ -23,10 +25,8 @@
 	$(MAKE) PREFIX="$(TMP)/usr" MANDIR="$(TMP)/usr/share/man" $(install)
 #	Debian specific
 	cp -a debian/debcfg/* debian/sks/etc/sks
+	echo $(BDB_VERSION) > debian/sks/usr/lib/sks/berkeley_db.txt
 
-override_dh_gencontrol:
-	dh_gencontrol -- -VF:OCamlRun="$(OCAMLRUN)"
-
 # Use override_dh_* targets to customize this.
 # ---------------------------------------------------
 # Followings are the old debian/rules

Modified: sks/trunk/sks/debian/sks.docs
===================================================================
--- sks/trunk/sks/debian/sks.docs	2010-11-22 15:15:35 UTC (rev 222)
+++ sks/trunk/sks/debian/sks.docs	2011-05-31 14:33:30 UTC (rev 223)
@@ -1 +1 @@
-build-tree/*/README
+README

Modified: sks/trunk/sks/debian/sks.postinst
===================================================================
--- sks/trunk/sks/debian/sks.postinst	2010-11-22 15:15:35 UTC (rev 222)
+++ sks/trunk/sks/debian/sks.postinst	2011-05-31 14:33:30 UTC (rev 223)
@@ -68,6 +68,72 @@
 		fi
 	    done
 	fi
+
+	# Read the active Berkeley DB version, fall back to 4.7 if not found
+	if [ -r /var/lib/sks/berkeley_db.active ]; then
+	    OLD_BDB=$(cat /var/lib/sks/berkeley_db.active)
+	else
+	    if dpkg --compare-versions "$2" lt "1.1.1+dpkgv3-1"; then
+		OLD_BDB=4.6
+	    elif dpkg --compare-versions "$2" lt "1.1.1+dpkgv3-6.1"; then
+		OLD_BDB=4.7
+	    else
+		OLD_BDB=4.7
+	    fi
+	fi
+
+	# Read the compiled-in Berkeley DB version
+	NEW_BDB=$(cat /usr/lib/sks/berkeley_db.txt)
+
+	# Upgrade Berkeley DB in place
+	BACKUP_DIR=/var/backup/sks/$(date +%Y%m%d-%H%M%S)
+	SKS_DIR=/var/lib/sks
+	mkdir -p $BACKUP_DIR
+	chown debian-sks:debian-sks ${BACKUP_DIR}
+
+	for DBHOME in DB PTree; do
+
+	    # Don't run if the database directory doesn't exist
+	    [ ! -d ${SKS_DIR}/${DBHOME} ] && continue
+
+	    # Create backup directory
+	    mkdir -p ${BACKUP_DIR}/${DBHOME}
+	    chown debian-sks:debian-sks ${BACKUP_DIR}/${DBHOME}
+
+	    # Make sure we own the files
+	    chown debian-sks:debian-sks -R ${SKS_DIR}/${DBHOME}
+
+	    if [ -x /usr/bin/db${OLD_BDB}_recover ]; then
+	        # Run recover with old tools
+		su debian-sks -c "db${OLD_BDB}_recover -h ${SKS_DIR}/${DBHOME}"
+	        # Backup needed log files
+		LOG_FILES=$(su debian-sks -c "db${OLD_BDB}_archive -h ${SKS_DIR}/${DBHOME} -l")
+	    else
+		# If we don't have the Berkeley DB tools then backup all log files
+		LOG_FILES=$(cd ${SKS_DIR}/${DBHOME}; ls -1 | grep -E "^log\.")
+	    fi
+
+	    # Backup log files
+	    for log_file in ${LOG_FILES}; do
+		cp -a ${SKS_DIR}/${DBHOME}/$log_file ${BACKUP_DIR}/${DBHOME}/
+	    done
+
+	    # Backup & upgrade database files
+	    for db in $(cd ${SKS_DIR}/${DBHOME}; ls -1 | grep -Ev "^(__|log\.)"); do
+		# Backup database file
+		su debian-sks -c "cp ${SKS_DIR}/${DBHOME}/${db} ${BACKUP_DIR}/${DBHOME}/"
+		# Upgrade database file
+    		su debian-sks -c "db${NEW_BDB}_upgrade -h ${SKS_DIR}/${DBHOME} ${SKS_DIR}/${DBHOME}/$db";
+	    done
+    
+	    # Set checkpoint and delete old logfiles
+	    su debian-sks -c "db${NEW_BDB}_checkpoint -h ${SKS_DIR}/${DBHOME} -1"
+	    su debian-sks -c "db${NEW_BDB}_archive -h ${SKS_DIR}/${DBHOME} -d"
+	done
+
+	# Note the active Berkeley DB version
+	cp -f /usr/lib/sks/berkeley_db.txt /var/lib/sks/berkeley_db.active
+
     fi
 fi
 




More information about the Pkg-sks-commit mailing list