--- edb-1.31.orig/debian/docs
+++ edb-1.31/debian/docs
@@ -0,0 +1,8 @@
+AUTHORS
+BUGS
+BUGS.edb
+HACKING
+NEWS
+README
+THANKS
+TODO
--- edb-1.31.orig/debian/watch
+++ edb-1.31/debian/watch
@@ -0,0 +1,2 @@
+version=3
+http://www.gnuvola.org/software/edb/ .*edb-([\d.]+).tar.gz
--- edb-1.31.orig/debian/compat
+++ edb-1.31/debian/compat
@@ -0,0 +1 @@
+7
--- edb-1.31.orig/debian/dirs
+++ edb-1.31/debian/dirs
@@ -0,0 +1,3 @@
+etc/emacs/site-start.d
+usr/share/info
+usr/share/emacs/site-lisp/edb
--- edb-1.31.orig/debian/README.Debian
+++ edb-1.31/debian/README.Debian
@@ -0,0 +1,22 @@
+README.Debian for edb
+---------------------
+
+EDB is Emacs Database, which can use text files for data storage. The
+default Debian install adds a function to `find-file-hook' which
+detects if the file's first line starts with:
+
+    ;; Database file written by EDB
+
+You can try EDB by loading one of the examples:
+
+    C-x C-f /usr/share/doc/edb/examples/btxdb/journals.dat
+
+For more information, consult info pages in Emacs <C-h i>. For quick
+introduction[*], start from section "Three types of EDB file" in
+/usr/share/doc/edb/examples/intro-and-addr.gz
+
+[*] Pay no attention to file's example Emacs code section in "end EDB
+    and Two column entry for .emacs file". The file is from year 1993
+    and does not reflect current EDB.
+
+ -- 2009-08-19 Jari Aalto <jari.aalto@cante.net>
--- edb-1.31.orig/debian/NEWS.Debian
+++ edb-1.31/debian/NEWS.Debian
@@ -0,0 +1,21 @@
+edb (1.31-1) unstable; urgency=low
+
+  * NEW UPSTREAM VERSION
+  - The new package has very little common with the old package. Please
+    not following changes
+  - If you have written custom function that made use of EDB functions,
+    expect that the code no longer work with 1.31. There is nothing that
+    can be do to prevent that; the upstream has implemented many new
+    features and removed some old functions. See list of changed functions
+    and variables in /usr/share/doc/edb/changelog.gz
+
+  [ Debian specific changes in /etc/emacs/site-start.d/*edb.el ]
+  * load-database
+    - This interactive function is no longer in 1.31. Use 'db-find-file'.
+  * inhibit-edb
+    - Variable has been renamed to 'edb-debian-inhibit-edb'.
+  * edb-after-find-file
+    - Function has been renamed to 'edb-debian-after-find-file'.
+      It is installed to 'find-file-hooks'.
+
+ -- Jari Aalto <jari.aalto@cante.net>  Wed, 19 Aug 2009 15:34:39 +0000
--- edb-1.31.orig/debian/emacsen-startup
+++ edb-1.31/debian/emacsen-startup
@@ -0,0 +1,65 @@
+;; -*-emacs-lisp-*-
+;;
+;; Emacs startup file for the Debian GNU/Linux edb package
+;;
+;; 2009-08-30 rewritten by Jari Aalto <jari.aalto@cante.net> for the 1.31.
+;; Adapted for dh-make by Jim Van Zandt <jrv@vanzandt.mv.com>
+;; Modified by Dirk Eddelbuettel <edd@debian.org>
+;; Originally contributed by Nils Naumann <naumann@unileoben.ac.at>
+;;
+;; The edb package follows the Debian/GNU Linux 'emacsen' policy and
+;; byte-compiles its elisp files for each 'emacs flavor' (emacs<NN>).
+;; The compiled code is then installed in a subdirectory of the
+;; respective site-lisp directory.
+
+(defvar edb-directory)
+
+;; Add this to the load-path:
+
+(let* ((flavor (if (boundp 'debian-emacs-flavor)
+		   (symbol-name debian-emacs-flavor)
+		 "emacs"))
+       (package-dir
+	(format "/usr/share/%s/site-lisp/edb" flavor)))
+
+  ;; If package-dir does not exist, the package must have
+  ;; been removed but not purged, and we should skip the setup.
+  (when (file-directory-p package-dir)
+
+    (if (fboundp 'debian-pkg-add-load-path-item)
+	(debian-pkg-add-load-path-item package-dir)
+      (setq load-path (cons package-dir load-path)))
+
+    (setq edb-directory
+	  (format "/usr/share/%s/site-lisp/edb" flavor))
+
+    (autoload 'edb-version		    "database" "EDB database package" t)
+    (autoload 'edb-interact		    "database" "EDB database package" t)
+    (autoload 'db-view-mode		    "edbcore"  "EDB database package" t)
+    (autoload 'db-find-file		    "edbcore"  "EDB database package" t)
+    (autoload 'db-edit-mode		    "edbcore"  "EDB database package" nil)
+    (autoload 'database-mode	    "edbcore"  "EDB database package" nil)
+    (autoload 'database-summary-mode    "edbcore"  "EDB database package" nil)
+
+    (defvar edb-debian-inhibit-edb nil
+      "*If non-nil, disable `edb-debian-after-find-file' in `find-file-hook'.")
+
+    (add-hook 'find-file-hook 'edb-debian-after-find-file)
+
+    (defun edb-debian-after-find-file ()
+      "Turn on EDB if first like is ';; Database file written by EDB'.
+This function is normally placed in `find-file-hooks'."
+      ;; When called, point is at the beginning of the buffer.
+      (when (and (not edb-debian-inhibit-edb)
+		 (looking-at ";; Database file written by EDB"))
+	(let ((file (buffer-file-name))
+	      (find-file-hook find-file-hook))
+	  ;; - We're already in the FILE, so kill buffer
+	  ;;   and let db-* functions to load the file again
+	  ;; - BUT disable ourselves while db-* runs
+	  (kill-buffer (current-buffer))
+	  (delq 'edb-debian-after-find-file find-file-hook)
+	  (message "%s" find-file-hook)
+	  (db-find-file file))))
+
+)) ;; End let-when
--- edb-1.31.orig/debian/copyright
+++ edb-1.31/debian/copyright
@@ -0,0 +1,46 @@
+This package was debianized by Takao KAWAMURA <kawamura@debian.org> on
+1999-05-23 21:58:27+09 Sun.
+
+It was downloaded from:
+
+    http://www.gnuvola.org/software/edb/
+
+    See also
+    http://www.emacswiki.org/cgi-bin/wiki/EmacsDataBase
+
+Upstream Author:
+
+    Thien-Thi Nguyen <ttn@gnuvola.org>
+
+Copyright:
+
+    Copyright (C) 2004-2008 Thien-Thi Nguyen
+    Copyright (C) 1991-1995 Michael D. Ernst <mernst@theory.lcs.mit.edu>
+
+License: GPL
+
+    EDB is distributed under the same conditions as GNU Emacs.
+
+    GNU Emacs is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2, or (at your option)
+    any later version.
+
+    This package is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with GNU Emacs; see the file COPYING.  If not, write to the
+    Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+
+The Debian packaging is licensed under the GPL-2 or later, see below,
+and is:
+
+    Copyright (C) 2006-2009 Jari Aalto <jari.aalto@cante.net>
+    Copyright (C) 1998-2004 Takao KAWAMURA <kawamura@debian.org>
+
+On Debian systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licenses/GPL-2'.
--- edb-1.31.orig/debian/changelog
+++ edb-1.31/debian/changelog
@@ -0,0 +1,227 @@
+edb (1.31-2.4.201403211042) ucs4-0-0-0; urgency=low
+
+  * UCS auto build. No patches were applied to the original source package
+
+ -- Univention builddaemon <buildd@univention.de>  Fri, 21 Mar 2014 10:42:32 +0100
+
+edb (1.31-2) unstable; urgency=low
+
+  * debian/docs
+    - New. Install README, NEWS etc. (Closes: #544283).
+  * debian/emacsen-startup
+    - (edb-debian-inhibit-edb): Add documentation string.
+    - (edb-debian-after-find-file): Improve documentation string.
+  * debian/control
+    - (Depends): Add emacs.
+    - (Section): Change misc to lisp.
+  * debian/emacsen-install
+    - (Install): Adjust displayed message.
+  * debian/rules
+    - (clean): remove BYTE-COMPILE.el.
+
+ -- Jari Aalto <jari.aalto@cante.net>  Wed, 02 Dec 2009 09:42:06 +0000
+
+edb (1.31-1) unstable; urgency=low
+
+  [ Jari Aalto ]
+  * GENERAL INFORMATION
+    - Read NEWS.Debian for incompatible changes.
+  * New upstream release (Closes: #303785).
+    - Compilation errors on install (Closes: #242105).
+    - Please add info-dir-section to your info files (Closes: #528870).
+      Included in original file doc/edb.texi,
+  * debian/control
+    - (Build-Depends): Update to debhelper 7. Remove dpatch.
+    - (Build-Depends-Indep): Add emacs23 | emacs22 | emacs-snapshot.
+      Remove emacs21.
+    - (Depends): Add make. Add emacs23 (Closes: #542206), remove emacs21.
+      emacs23 | emacs22 | emacs-snapshot.
+    - (Depends): Add make. Move emacs* packages to Build-Depends-Indep.
+      Add ${misc:Depends} (lintian).
+      Add "dpkg (>= 1.15.4) | install-info" (lintian).
+    - (Homepage): New field. Point to current upstream.
+    - (Standards-Version): update to 3.8.3.
+    - (Vcs-*): New fields.
+  * debian/copyright
+    - Update upstream information: current upstream and URL.
+    - Adjust layout to match latest dh-make template.
+    - Corrected Copyright from GPL-2 to GPL as this is the right
+      edb license.
+    - Spell out GPL-2 (lintian).
+  * debian/emacsen-install
+    - Rewrite for new upstream version.
+  * debian/emacsen-remove
+    - Adjust variable syntax and FLAVOR test.
+  * debian/emacsen-startup
+    - Rewrite for new upstream version.
+    - Rename custom functions and variables to clean
+      name space 'edb-debian-*'.
+  * debian/{patches,patches-original}/
+    - Discard all old patches; start from fresh with new edb.
+  * debian/{prerm,postinst}
+    - Delete; not needed with debhelper 7.
+  * debian/README.Debian
+    - Remove old patch information to previous releases.
+    - Add introduction to EDB.
+  * debian/rules
+    - Adjust to new upstream release.
+    - (install): use dh_prep (lintian).
+
+  [ Tatsuya Kinoshita ]
+  * debian/emacsen-startup
+    - Define edb-debian-inhibit-edb to prevent a void-variable error.
+
+ -- Tatsuya Kinoshita <tats@debian.org>  Sun, 30 Aug 2009 15:04:09 +0900
+
+edb (1.21-17) unstable; urgency=low
+
+  * OVERALL
+    - Convert hand written patch system to dpatch.
+  * debian/*
+    - Remove trailing whitespaces from all files.
+  * debian/README.Debian-source
+    - New. Explain what changed after package adoption.
+  * debian/compat
+     - New file.
+  * debian/control
+    - (Build-Depands): Added dpatch.
+    - (Depends): Add emacs22 to the beginning. (Closes: #433974).
+  * debian/copyright
+    - Update download URL; old one non-existent.
+  * debian/patches/*
+    - One single dpatch to include all previous changes.
+  * debian/patches-original/*
+    - Store the original paches including
+      some email messages for historial reference.
+  * debian/rules
+    - Remove DH_COMPAT, use dpatch and *.mk files.
+  * debian/watch
+    - New file.
+
+ -- Jari Aalto <jari.aalto@cante.net>  Thu, 13 Sep 2007 10:11:49 +0300
+
+edb (1.21-16) unstable; urgency=low
+
+  * debian/control
+    - (Section): Change from 'utils' => 'misc' according to ftp-masters
+      message: 'package says section is utils, override says misc'.
+
+ -- Jari Aalto <jari.aalto@cante.net>  Sun, 19 Nov 2006 18:43:20 +0200
+
+edb (1.21-15) unstable; urgency=low
+
+  * New maintainer (Orphaned; Closes: #353629).
+  * Apply patch by Tatsuya Kinoshita <tats@debian.org> to fix
+    debian/control (Build-Depends, Build-Depends-Indep, Depends),
+    debian/copyright (Proper copyright year, author, license),
+    debian/emacsen-install (added "-q" during byte compilation and
+    *.elc cleanup), debian/emacsen-remove (simplified "emacs" treatment),
+    debian/emacsen-startup (better init implementation)
+  * debian/conffiles
+    - Remove file. Had entry "/etc/emacs/site-start.d/50edb.el". This is
+      automatically added by debhelper.
+
+ -- Jari Aalto <jari.aalto@cante.net>  Tue, 24 Oct 2006 20:07:51 +0300
+
+edb (1.21-14) unstable; urgency=low
+
+  * debian/control: standards 3.6.2.
+    (Build-Depends): Added version number to debhelper, this fixes lintian
+    warning package-uses-deprecated-debhelper-compat-version
+  * debian/rules: use install(1) and not cp(1) for *.el files.
+  * debian/copyright: improved layout. Added copyright holder.
+
+ -- Jari Aalto <jari.aalto@cante.net>  Tue,  4 Apr 2006 13:08:33 +0300
+
+edb (1.21-13) unstable; urgency=low
+
+  * Removed emacs20 from Depends. (Closes: Bug#232750)
+  * Updated to Standards-Version 3.6.1.
+
+ -- Takao KAWAMURA <kawamura@debian.org>  Tue, 23 Mar 2004 18:28:00 +0900
+
+edb (1.21-12) unstable; urgency=low
+
+  * debian/control: Build-Depends-Indep: Added texinfo. (Closes: Bug#134910)
+
+ -- Takao KAWAMURA <kawamura@debian.org>  Wed,  3 Apr 2002 13:11:16 +0900
+
+edb (1.21-11) unstable; urgency=low
+
+  * 50edb.el was marked as a conffile (Closes: Bug#132165).
+
+ -- Takao KAWAMURA <kawamura@debian.org>  Thu,  7 Feb 2002 11:10:40 +0900
+
+edb (1.21-10) unstable; urgency=low
+
+  * db-time.el: Rename `parse-time-string' to `db-parse-time-string' to
+    work with Gnus 5.8.7-1. (Bug#70890)
+  * emacsen-install: Ignore xemacs21.
+
+ -- Takao KAWAMURA <kawamura@debian.org>  Wed, 20 Sep 2000 11:50:26 +0900
+
+edb (1.21-9) frozen unstable; urgency=high
+
+  * Applied a patch for y2k and other minor fixes written by
+    Phil.Nitschke@caemrad.com.au. (Bug#58153)
+    The y2k fix is so important that this version should go into
+    frozen. (See debian/nitschke.patch)
+
+ -- Takao KAWAMURA <kawamura@debian.org>  Wed, 16 Feb 2000 11:01:03 +0900
+
+edb (1.21-8) unstable; urgency=low
+
+  * FHS-compliant
+
+ -- Takao KAWAMURA <kawamura@debian.org>  Sun, 19 Sep 1999 11:36:09 +0900
+
+edb (1.21-7) unstable; urgency=low
+
+  * Added a variable `inhibit-edb' which if non-nil will load an EDB
+    database file normally rather than as a database by
+    swift@alum.mit.edu. (Bug#43046)
+
+ -- Takao KAWAMURA <kawamura@debian.org>  Mon, 16 Aug 1999 15:49:15 +0900
+
+edb (1.21-6) unstable; urgency=low
+
+  * Included edb-fixes-1.21.el written by swift@alum.mit.edu to fix bugs
+    in EDB v1.21. (Bug#41922)
+
+ -- Takao KAWAMURA <kawamura@debian.org>  Thu, 29 Jul 1999 15:34:04 +0900
+
+edb (1.21-5) unstable; urgency=low
+
+  * Initial Release for Debian (previous versions were uploaded to Debian
+    JP Project).
+  * Changed maintainer's email address.
+  * Updated to Standards-Version 2.5.1.0.
+
+ -- Takao KAWAMURA <kawamura@debian.org>  Sun, 23 May 1999 22:05:34 +0900
+
+edb (1.21-4) unstable-jp; urgency=low
+
+  * Applied a patch by kawamura@debian.or.jp to make edb work with XEmacs.
+
+ -- Takao KAWAMURA <kawamura@debian.or.jp>  Sun, 10 Jan 1999 21:00:02 +0900
+
+edb (1.21-3) frozen-jp unstable-jp; urgency=low
+
+  * Applied a patch by ksakai@netwk.ntt-at.co.jp to make edb work with
+    Emacs 20.3.(Bug#JP/696)
+  * The short description has changed not to start with the package name.(Bug#JP/710)
+
+ -- Takao KAWAMURA <kawamura@debian.or.jp>  Sat, 26 Dec 1998 01:06:37 +0900
+
+edb (1.21-2) frozen-jp; urgency=low
+
+  * (control): Removed XEmacs from the Depends field.
+  * CompilationLog.gz holds the log of byte-compilation.
+
+ -- Takao KAWAMURA <kawamura@debian.or.jp>  Thu, 11 Jun 1998 12:39:51 +0900
+
+edb (1.21-1) unstable-jp; urgency=low
+
+  * Initial Release.
+
+ -- Takao KAWAMURA <kawamura@debian.or.jp>  Sun, 31 May 1998 17:34:21 +0900
--- edb-1.31.orig/debian/emacsen-install
+++ edb-1.31/debian/emacsen-install
@@ -0,0 +1,98 @@
+#!/bin/sh
+# Synopsis: [DEBIAN_EL_DEBUG=1] emacsen-install [--test] emacs23 ...
+
+set -e
+
+if [ "$DEBIAN_EL_DEBUG" ]; then
+    set -x
+fi
+
+PACKAGE=edb
+MESSAGE="install/$PACKAGE:"
+unset test
+
+Run ()
+{
+    ${test+echo} "$@"
+}
+
+Install ()
+{
+    # set ARGS and FLAVOR before calling
+
+    ELDIR=/usr/share/emacs/site-lisp/$PACKAGE
+    ELCDIR=/usr/share/$FLAVOR/site-lisp/$PACKAGE
+
+    BYTECOMP=BYTE-COMPILE.el
+    EL_LIBS="-l ./$BYTECOMP -l bfuncs -l database.el"
+    EL_FLAGS="-batch -q -no-site-file"
+    EMACS="$FLAVOR $EL_LIBS $EL_FLAGS"
+
+    echo "install/$PACKAGE: Handling install of emacsen flavor $FLAVOR"
+
+    case "$FLAVOR" in
+	xemacs*)
+	    echo "$MESSAGE [xemacs*] ignored."
+	    ;;
+
+	*)
+	    echo "$MESSAGE Byte-Compiling in dir $ELDIR/ ..."
+
+	    Run install -m 755 -d $ELCDIR
+	    Run rm -f $ELCDIR/*.el $ELCDIR/*.elc
+
+	    Run cd $ELDIR
+
+	    cat << EOF > $BYTECOMP
+(setq load-path (cons "." load-path))
+(setq edb-directory ".")
+EOF
+
+	    Run $EMACS \
+		-f edb-bfunc-make-all \
+		-f batch-byte-compile \
+		   database.el
+
+	    rm -f $BYTECOMP
+	    Run mv -f *.elc $ELCDIR/
+
+	    for file in $ELDIR/*.el
+	    do
+		if [ ! -f $file ]; then
+		    echo "$MESSAGE [ERROR] No $file in $(pwd)"
+		    exit 1
+		fi
+
+		Run ln -sf $file $ELCDIR
+	    done
+
+	    echo "$MESSAGE Byte-Compiling... done."
+	    ;;
+    esac
+}
+
+Main ()
+{
+    ARGS="$*"
+
+    if [ "$1" = "--test" ]; then
+	test="test-mode"
+	echo "$MESSAGE [TEST MODE $1] No real commands run"
+	shift
+    fi
+
+    FLAVOR=$1
+    [ ! "$1" ] || shift
+
+    if [ "$FLAVOR" = emacs ]; then
+	return 0
+    fi
+
+    Install $FLAVOR
+
+    exit 0
+}
+
+Main  "$@"
+
+# Endo file
--- edb-1.31.orig/debian/debian-vars.mk
+++ edb-1.31/debian/debian-vars.mk
@@ -0,0 +1,103 @@
+# debian-vars.mk -- Common variables
+#
+#   Copyright
+#
+#	Copyright (C) 2005-2009 Jari Aalto <jari.aalto@cante.net>
+#
+#   License
+#
+#	This program is free software; you can redistribute it and or
+#	modify it under the terms of the GNU General Public License as
+#	published by the Free Software Foundation; either version 2 of
+#	the License, or (at your option) any later version.
+#
+#	This program is distributed in the hope that it will be useful, but
+#	WITHOUT ANY WARRANTY; without even the implied warranty of
+#	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+#	General Public License for more details at
+#	<http://www.gnu.org/copyleft/gpl.html>.
+#
+#   Description
+#
+#	This is GNU makefile part, that defines common variables and
+#	macros to be used from debian/rules. To install, add this:
+#
+#	    PACKAGE = foo
+#	    include debian/debian-vars.mk
+
+ifneq (,)
+    This makefile requires GNU Make.
+endif
+
+PACKAGE		?= foo
+TOPDIR		:= $(shell pwd)
+PKGDIR		= $(CURDIR)/debian/$(PACKAGE)
+
+SHAREROOTDIR	= $(PKGDIR)/usr/share
+SHAREDIR	= $(SHAREROOTDIR)/$(PACKAGE)
+DOCROOTDIR	= $(SHAREROOTDIR)/doc
+PKGDOCDIR	= $(SHAREROOTDIR)/doc/$(PACKAGE)
+SITELISPDIR	= $(SHAREROOTDIR)/emacs/site-lisp
+PKGLISPDIR	= $(SITELISPDIR)/$(PACKAGE)
+DESKTOPDIR	= $(SHAREROOTDIR)/applications
+LOCALEDIR	= $(SHAREROOTDIR)/locale
+INFODIR		= $(SHAREROOTDIR)/info
+PIXDIR		= $(SHAREROOTDIR)/pixmaps
+
+MANROOTDIR	= $(SHAREROOTDIR)/man
+MAN1DIR		= $(MANROOTDIR)/man1
+MAN5DIR		= $(MANROOTDIR)/man5
+MAN8DIR		= $(MANROOTDIR)/man8
+
+LIBROOTDIR	= $(PKGDIR)/usr/lib
+LIBDIR		= $(LIBROOTDIR)/$(PACKAGE)
+LIBPERLDIR	= $(LIBROOTDIR)/perl
+
+BINDIR		= $(PKGDIR)/usr/bin
+SBINDIR		= $(PKGDIR)/usr/sbin
+
+INSTALL		?= /usr/bin/install
+INSTALL_DATA	= $(INSTALL) -p -m 644
+INSTALL_SCRIPT	= $(INSTALL) -p -m 755
+INSTALL_BIN	= $(INSTALL) -p -m 755
+INSTALL_DIR	= $(INSTALL) -m 755 -d
+
+#######################################################################
+# These are used for cross-compiling and for saving the configure script
+# from having to guess our platform (since we know it already)
+#
+# [Add this]
+# config.status: configure
+#	...
+#	./configure --host=$(DEB_HOST_GNU_TYPE) \
+#		    --build=$(DEB_BUILD_GNU_TYPE) \
+
+DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+
+#######################################################################
+# [Add this to use multiple CPU cores]
+#	build-stamp:
+#		$(MAKE) $(MAKE_FLAGS)
+
+ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
+    INSTALL_BIN += -s
+endif
+
+CFLAGS		= -Wall -g
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+    CFLAGS += -O0
+else
+    CFLAGS += -O2
+endif
+
+MAKE_FLAGS	=
+CPU_COUNT	:= $(shell fgrep -c processor /proc/cpuinfo 2> /dev/null | \
+		     egrep "^[2-9]$$|^[0-9][0-9]$$")
+
+ifneq ($(CPU_COUNT),)
+    MAKE_FLAGS	+= -j$(CPU_COUNT)
+endif
+
+# End of Makefile part
--- edb-1.31.orig/debian/control
+++ edb-1.31/debian/control
@@ -0,0 +1,19 @@
+Source: edb
+Section: lisp
+Priority: optional
+Maintainer: Jari Aalto <jari.aalto@cante.net>
+Uploaders: Tatsuya Kinoshita <tats@debian.org>
+Build-Depends: debhelper (>= 7)
+Build-Depends-Indep: texinfo, emacs23 | emacs22 | emacs-snapshot
+Standards-Version: 3.8.3
+Vcs-Browser: http://git.debian.org/?p=collab-maint/edb.git
+Vcs-Git: git://git.debian.org/git/collab-maint/edb.git
+Homepage: http://www.gnuvola.org/software/edb
+
+Package: edb
+Architecture: all
+Depends: ${misc:Depends}, emacs23 | emacs22 | emacs-snapshot | emacs, make, dpkg (>= 1.15.4) | install-info
+Description: database program for GNU Emacs
+ EDB is a database program for GNU Emacs. It permits you to
+ manipulate structured (or not-so-structured) data within
+ Emacs and provides many of the usual database features.
--- edb-1.31.orig/debian/emacsen-remove
+++ edb-1.31/debian/emacsen-remove
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+set -e
+
+FLAVOR=$1
+PACKAGE=edb
+
+[ ! "$FLAVOR" = emacs ] || exit 0
+
+echo "remove/$PACKAGE: Handling removal of emacsen flavor $FLAVOR"
+echo "remove/$PACKAGE: Purging byte-compiled files for $FLAVOR"
+
+rm -rf /usr/share/$FLAVOR/site-lisp/$PACKAGE
+
+exit 0
--- edb-1.31.orig/debian/rules
+++ edb-1.31/debian/rules
@@ -0,0 +1,123 @@
+#!/usr/bin/make -f
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+PACKAGE = edb
+
+include debian/debian-vars.mk
+
+config.status: configure
+	# target: config.status
+	dh_testdir
+	./configure --prefix=$(PKGDIR)/usr
+
+build-stamp: config.status
+	# target: build-stamp
+	dh_testdir
+
+	# Reset *any* jobserver -j options. Won't compile in parallel
+	$(MAKE) MAKEFLAGS= MFLAGS=
+
+	touch build-stamp
+
+build: build-stamp
+
+clean:
+	# target: clean
+	dh_testdir
+	dh_testroot
+	rm -rf build-stamp $(PKGDIR)
+
+	[ ! -f GNUMakefile ] || $(MAKE) clean
+
+	find . -name GNUmakefile \
+		-o -name "*[#~]*" \
+		| xargs -r rm
+
+	rm -f lisp/*.elc \
+		debian/BYTE*.el
+
+	# Generated files
+	rm -f lisp/edbcore.el
+	rm -f doc/refcard.aux doc/refcard.log
+
+	rm -f config.log config.status \
+		examples/null examples/passwd \
+		tests/ebatch
+
+	dh_clean
+
+install: build
+	# target: install
+	dh_testdir
+	dh_testroot
+	dh_prep
+
+	# target: install call make
+	$(MAKE) install
+
+	# Don't need compiled files
+	rm -f $(PKGLISPDIR)/*.elc
+
+	# The 'make install' doesn't install all files. Do it by hand.
+	install -m 644 lisp/*.el  $(PKGLISPDIR)
+	# But do not include these, which are not edb-* namespace
+	rm 	$(PKGLISPDIR)/connection.el \
+		$(PKGLISPDIR)/state.el \
+		$(PKGLISPDIR)/system.el
+
+	# We need these in emacsen-install
+	#
+	# The byte compilation is real strange.
+	# The bfuncs::edb-bfunc-make-all calls 'make', which reads GNUmakefile
+	# with some hackery to print out variables (*.el file lists) stored there.
+	# So GNUmakefile must be avalable for 'edb-bfunc-make-all'.
+
+	install -m 644 lisp/bfuncs lisp/GNUmakefile $(PKGLISPDIR)
+
+	# debhelper will handle this
+	rm -f $(INFODIR)/dir*
+
+	# Install examples
+
+	install -m 755 -d $(PKGDOCDIR)
+	tar -cf - examples | tar -C $(PKGDOCDIR) -xf -
+
+# Build architecture-independent files here.
+binary-indep: build install
+	# target: binary-indep
+
+	dh_testdir
+	dh_testroot
+	dh_installdirs
+	dh_installinfo doc/edb.info
+	dh_installdocs
+#	dh_installexamples
+#	dh_installmenu
+	dh_installemacsen
+#	dh_installinit
+#	dh_installcron
+#	dh_installmanpages
+#	dh_undocumented
+	dh_installchangelogs
+#	dh_strip
+
+	# Do not compress EDB example data files
+	dh_compress -X.edb -X.dba -X.fmt -X.dat
+
+	dh_fixperms
+#	dh_suidregister
+	dh_installdeb
+#	dh_shlibdeps
+	dh_gencontrol
+#	dh_makeshlibs
+	dh_md5sums
+	dh_builddeb
+
+# Build architecture-dependent files here.
+binary-arch: build
+	# We have nothing to do.
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary
