--- bcrypt-1.1.orig/debian/compat
+++ bcrypt-1.1/debian/compat
@@ -0,0 +1 @@
+7
--- bcrypt-1.1.orig/debian/copyright
+++ bcrypt-1.1/debian/copyright
@@ -0,0 +1,43 @@
+This package was debianized by Samuele Giovanni Tonon <samu@debian.org> on
+Wed, 17 Dec 2003 21:50:47 +0100.
+
+It was downloaded from http://bcrypt.sourceforge.net/index.html
+
+Upstream Author: Johnny Shelley <jshelley@cahaus.com>
+
+License:
+
+Copyright (c) 2002 Johnny Shelley
+
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions are
+    met:
+
+    1. Redistributions of source code must retain the above copyright notice,
+    this list of conditions and the following disclaimer.
+
+    2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.
+
+    3. Neither the name of the author nor any contributors may be used to
+    endorse or promote products derived from this software without specific
+    prior written permission.
+
+    THIS SOFTWARE IS PROVIDED BY COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
+    AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+    PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+    CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+    LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+    OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+    SUCH DAMAGE.
+
+On Debian systems, the complete text of the BSD License can be found in
+/usr/share/common-licenses/BSD.
+
+The Debian packaging is (C) 2007, Kevin Coyner <kcoyner@debian.org> and
+is licensed under the GPL, see `/usr/share/common-licenses/GPL'.
--- bcrypt-1.1.orig/debian/watch
+++ bcrypt-1.1/debian/watch
@@ -0,0 +1,2 @@
+version=3
+http://sf.net/bcrypt/bcrypt-(.*)\.tar\.gz
--- bcrypt-1.1.orig/debian/control
+++ bcrypt-1.1/debian/control
@@ -0,0 +1,19 @@
+Source: bcrypt
+Section: utils
+Priority: optional
+Maintainer: Kevin Coyner <kcoyner@debian.org>
+Build-Depends: debhelper (>= 7.4~), libz-dev, dpatch
+Homepage: http://bcrypt.sourceforge.net/
+Standards-Version: 3.8.3
+
+Package: bcrypt
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Cross platform file encryption utility using blowfish
+ Bcrypt is a cross platform file encryption utility.  Encrypted files are
+ portable across all supported operating systems and processors.  In addition
+ to encrypting your data, bcrypt will by default overwrite the original input
+ file with random garbage three times before deleting it in order to thwart
+ data recovery attempts by persons who may gain access to your computer.
+ Bcrypt uses the blowfish encryption algorithm published by Bruce Schneier in
+ 1993.
--- bcrypt-1.1.orig/debian/README.source
+++ bcrypt-1.1/debian/README.source
@@ -0,0 +1 @@
+Please see /usr/share/doc/dpatch/README.source.gz
--- bcrypt-1.1.orig/debian/rules
+++ bcrypt-1.1/debian/rules
@@ -0,0 +1,82 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# GNU copyright 1997 to 1999 by Joey Hess.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+CFLAGS = -Wall -g
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+	CFLAGS += -O0
+else
+	CFLAGS += -O2
+endif
+ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
+	INSTALL_PROGRAM += -s
+endif
+
+configure: configure-stamp
+configure-stamp:
+	dh_testdir
+	touch configure-stamp
+
+build: patch build-stamp
+
+build-stamp: configure-stamp
+	dh_testdir
+	$(MAKE)
+	dh_auto_clean
+	touch build-stamp
+
+clean: clean-patched unpatch
+
+clean-patched:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp configure-stamp
+	[ ! -f Makefile ] || $(MAKE) clean
+	dh_clean
+
+patch: patch-stamp
+
+patch-stamp:
+	dpatch apply-all
+	dpatch cat-all >patch-stamp
+
+unpatch:
+	dpatch deapply-all
+	rm -rf patch-stamp debian/patched
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_prep
+	dh_installdirs
+	$(MAKE) install DESTDIR=$(CURDIR)/debian/bcrypt
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+	dh_testdir
+	dh_testroot
+	dh_installchangelogs
+	dh_installdocs README
+	dh_installexamples
+	dh_installman
+	dh_link
+	dh_strip
+	dh_compress
+	dh_fixperms
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
--- bcrypt-1.1.orig/debian/changelog
+++ bcrypt-1.1/debian/changelog
@@ -0,0 +1,58 @@
+bcrypt (1.1-6) unstable; urgency=low
+
+  * Applied patch to deal with memory problem on amd64 platforms. Closes:
+    #494469 
+  * debian/control:
+    + Moved homepage from description to its own header.
+    + Added dpatch to Build-Depends.
+    + Bumped Standards-Version to 3.8.3.
+    + Bumped debhelper version to 7.4~.
+  * debian/rules:
+    + Added dpatch entries.
+    + Added dh_auto_clean to build stanza.
+    + Changed dh_clean -k to dh_prep in install stanza.
+  * Added new file debian/README.source per Debian Policy.
+  * Bumped debian/compat to 7 from 5.
+
+ -- Kevin Coyner <kcoyner@debian.org>  Thu, 08 Oct 2009 21:42:59 -0400
+
+bcrypt (1.1-5) unstable; urgency=low
+
+  * New maintainer e-mail address in debian/control, copyright and changelog.
+  * Changed a clean invocation in debian/rules.
+
+ -- Kevin Coyner <kcoyner@debian.org>  Sun, 05 Aug 2007 16:32:57 -0400
+
+bcrypt (1.1-4) unstable; urgency=low
+
+  * New maintainer. Closes: #424712
+  * Cleaned up debian/rules.
+  * Bumped debian/compat to 5.
+  * Bumped debhelper to version 5 and Standards-Version to 3.7.2 in
+    debian/control. Added homepage URL in the description.
+  * Removed debian/docs and listed file to be installed in debian/rules.
+  * Removed unneeded debian/dirs file.
+  * Reformatted debian/copyright file.
+  * Added debian/watch file.
+  * Added lintian source overrides file for CVS in source package.
+
+ -- Kevin Coyner <kevin@rustybear.com>  Wed, 16 May 2007 21:20:47 -0400
+
+bcrypt (1.1-3) unstable; urgency=low
+
+  * Added a better description (Closes: #354605)
+
+ -- Samuele Giovanni Tonon <samu@debian.org>  Fri, 17 Mar 2006 12:42:22 +0100
+
+bcrypt (1.1-2) unstable; urgency=low
+
+  * Fixed Missing Build Depends
+
+ -- Samuele Giovanni Tonon <samu@debian.org>  Mon, 19 Jan 2004 09:42:36 +0100
+
+bcrypt (1.1-1) unstable; urgency=low
+
+  * Initial Release.
+
+ -- Samuele Giovanni Tonon <samu@debian.org>  Wed, 17 Dec 2003 21:50:47 +0100
+
--- bcrypt-1.1.orig/debian/source.lintian-overrides
+++ bcrypt-1.1/debian/source.lintian-overrides
@@ -0,0 +1 @@
+bcrypt source: source-contains-CVS-dir
--- bcrypt-1.1.orig/debian/patches/10_amd_memory.dpatch
+++ bcrypt-1.1/debian/patches/10_amd_memory.dpatch
@@ -0,0 +1,20 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 10_amd_memory.dpatch by Kevin Coyner <kcoyner@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+@DPATCH@
+diff -urNad bcrypt-1.1~/wrapbf.c bcrypt-1.1/wrapbf.c
+--- bcrypt-1.1~/wrapbf.c	2009-10-08 23:02:14.000000000 -0400
++++ bcrypt-1.1/wrapbf.c	2009-10-18 20:43:14.000000000 -0400
+@@ -21,6 +21,9 @@
+ 
+   getEndian(&myEndian);
+ 
++  if ((*input = realloc(*input, sz + 2)) == NULL)
++    memerror();
++
+   memmove(*input+2, *input, sz);
+ 
+   memcpy(*input, myEndian, 1);
--- bcrypt-1.1.orig/debian/patches/00list
+++ bcrypt-1.1/debian/patches/00list
@@ -0,0 +1 @@
+10_amd_memory
