--- librsync-0.9.7.orig/debian/librsync1.install
+++ librsync-0.9.7/debian/librsync1.install
@@ -0,0 +1,2 @@
+/usr/lib/*.so.*
+/usr/share/man/man3
--- librsync-0.9.7.orig/debian/librsync-dev.install
+++ librsync-0.9.7/debian/librsync-dev.install
@@ -0,0 +1,4 @@
+/usr/include/*
+/usr/lib/*.a
+/usr/lib/*.la
+/usr/lib/*.so
--- librsync-0.9.7.orig/debian/compat
+++ librsync-0.9.7/debian/compat
@@ -0,0 +1 @@
+7
--- librsync-0.9.7.orig/debian/rdiff.install
+++ librsync-0.9.7/debian/rdiff.install
@@ -0,0 +1,2 @@
+/usr/bin
+/usr/share/man/man1
--- librsync-0.9.7.orig/debian/librsync1.shlibs
+++ librsync-0.9.7/debian/librsync1.shlibs
@@ -0,0 +1 @@
+librsync 1 librsync1 (>= 0.9.6)
--- librsync-0.9.7.orig/debian/rules
+++ librsync-0.9.7/debian/rules
@@ -0,0 +1,74 @@
+#!/usr/bin/make -f
+
+include /usr/share/dpatch/dpatch.make
+
+DEB_HOST_GNU_TYPE	?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILD_GNU_TYPE	?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+
+ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
+	CROSS=CC=$(DEB_HOST_GNU_TYPE)-gcc
+else
+	CROSS=
+endif
+
+CFLAGS += -D_LARGEFILE_SOURCE
+
+clean: unpatch
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp
+	rm -f config.guess config.sub
+
+	[ ! -f Makefile ] || $(MAKE) distclean
+
+	dh_clean
+
+config.status: configure patch-stamp
+	dh_testdir
+
+ifneq "$(wildcard /usr/share/misc/config.sub)" ""
+	cp -f /usr/share/misc/config.sub config.sub
+endif
+ifneq "$(wildcard /usr/share/misc/config.guess)" ""
+	cp -f /usr/share/misc/config.guess config.guess
+endif
+
+	CFLAGS="$(CFLAGS)" ./configure $(CROSS) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --enable-shared
+
+build: build-stamp
+build-stamp: config.status
+	dh_testdir
+
+	$(MAKE) all check
+
+	touch build-stamp
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_clean -k
+	dh_installdirs
+
+	$(MAKE) install prefix=$(CURDIR)/debian/tmp/usr
+
+	install -D -m 0755 .libs/rdiff debian/tmp/usr/bin/rdiff
+
+binary: binary-arch
+
+binary-arch: build install
+	dh_testdir
+	dh_testroot
+	dh_installchangelogs ChangeLog
+	dh_installdocs
+	dh_install --fail-missing --sourcedir=debian/tmp
+	dh_strip --dbg-package=librsync-dbg
+	dh_compress
+	dh_fixperms
+	dh_makeshlibs
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+.PHONY: clean configure build install binary binary-arch binary-indep
--- librsync-0.9.7.orig/debian/changelog
+++ librsync-0.9.7/debian/changelog
@@ -0,0 +1,163 @@
+librsync (0.9.7-5~bpo40+1) etch-backports; urgency=low
+
+  * Backport testing version for backports.org (no changes)
+
+ -- Micah Anderson <micah@debian.org>  Mon,  6 Oct 2008 10:12:27 -0600
+
+librsync (0.9.7-5) unstable; urgency=medium
+
+  * Adding patch to make rdiff aware of -i and -z (Closes: #435894).
+
+ -- Daniel Baumann <daniel@debian.org>  Tue,  1 Jul 2008 15:33:00 +0200
+
+librsync (0.9.7-4) unstable; urgency=high
+
+  * Adding patch from upstream to fix problem when transfering >4GB from
+    a 32bit to 64bit host (Closes: #355178).
+  * Updating manpage patch to remove dead link to Linuxcare Australia
+    (Closes: #288758).
+
+ -- Daniel Baumann <daniel@debian.org>  Tue, 24 Jun 2008 10:29:00 +0200
+
+librsync (0.9.7-3) unstable; urgency=medium
+
+  * Adding debug package.
+
+ -- Daniel Baumann <daniel@debian.org>  Fri, 20 Jun 2008 13:59:00 +0200
+
+librsync (0.9.7-2) unstable; urgency=low
+
+  * New maintainer (Closes: #487131).
+  * Redone debian packaging from scratch.
+
+ -- Daniel Baumann <daniel@debian.org>  Fri, 20 Jun 2008 13:14:00 +0200
+
+librsync (0.9.7-1) unstable; urgency=low
+
+  * New upstream release.
+    - Large files are now supported.  (Closes: Bug#277032)
+  * Fix description of librsync1.  (Closes: Bug#230839)
+  * Describe how to use rdiff.  (Closes: Bug#228005, Bug#156457)
+  * Trust upstream's autoconfiscation.
+
+ -- Simon Law <sfllaw@debian.org>  Sun, 28 Nov 2004 18:54:00 -0500
+
+librsync (0.9.6-13) unstable; urgency=high
+
+  * Fix FTBFS with a patch from Steinar H. Gunderston.  (Closes: Bug#262463)
+
+ -- Simon Law <sfllaw@debian.org>  Sat, 28 Aug 2004 11:48:05 -0400
+
+librsync (0.9.6-12) unstable; urgency=low
+
+  * librsync-dev should be in libdevel
+
+ -- Simon Law <sfllaw@debian.org>  Fri, 30 Jul 2004 20:19:20 -0400
+
+librsync (0.9.6-11) unstable; urgency=low
+
+  * New Maintainer.  (Closes: Bug#261580)
+
+ -- Simon Law <sfllaw@debian.org>  Fri, 30 Jul 2004 09:21:47 -0400
+
+librsync (0.9.6-10) unstable; urgency=low
+
+  * Orphaning this package.
+
+ -- John Goerzen <jgoerzen@complete.org>  Mon, 26 Jul 2004 14:58:38 -0500
+
+librsync (0.9.6-9) unstable; urgency=low
+
+  * Made autoconf build-dep versioned.  Closes: #252959.
+
+ -- John Goerzen <jgoerzen@complete.org>  Mon, 26 Jul 2004 09:09:45 -0500
+
+librsync (0.9.6-8) unstable; urgency=low
+
+  * Try using just autoconf now, and drop the other build-deps.
+    Was still seeing some errors after -7.
+
+ -- John Goerzen <jgoerzen@complete.org>  Tue, 21 Oct 2003 16:41:41 -0500
+
+librsync (0.9.6-7) unstable; urgency=low
+
+  * Added build-dep on libbz2-dev.
+  * Add -a to many debhelper calls.
+  * Tightened dh_makeshlibs call in debian/rules.
+
+ -- John Goerzen <jgoerzen@complete.org>  Sat, 11 Oct 2003 22:59:25 -0500
+
+librsync (0.9.6-6) unstable; urgency=low
+
+  * Backed out calls to aclocal, autoconf, automake since they
+    somehow caused files to be generated without the .so extension
+    sometimes.  Closes: #215289.
+
+ -- John Goerzen <jgoerzen@complete.org>  Sat, 11 Oct 2003 22:47:28 -0500
+
+librsync (0.9.6-5) unstable; urgency=low
+
+  * Fixed clean target so that the Debian diff doesn't have so much junk.
+  * Update build-deps on autoconf and automake.
+
+ -- John Goerzen <jgoerzen@complete.org>  Fri, 10 Oct 2003 22:31:53 -0500
+
+librsync (0.9.6-4) unstable; urgency=low
+
+  * Extended description for dev package.  Closes: #210136.
+  * configure target runs aclocal, preventing errors.
+
+ -- John Goerzen <jgoerzen@complete.org>  Thu,  9 Oct 2003 16:58:23 -0500
+
+librsync (0.9.6-3) unstable; urgency=low
+
+  * Add CFLAGS=-D_LARGEFILE_SOURCE to configure command line per suggestion
+    from upstream to fix tests on hppa.  Closes: #207457.
+
+ -- John Goerzen <jgoerzen@complete.org>  Fri, 29 Aug 2003 08:20:02 -0500
+
+librsync (0.9.6-2) unstable; urgency=low
+
+  * Manually install the rdiff bin because it wasn't anymore.
+    Closes: #205469.
+  * Fixed description.  Closes: #191658.
+
+ -- John Goerzen <jgoerzen@complete.org>  Mon, 18 Aug 2003 11:25:03 -0500
+
+librsync (0.9.6-1) unstable; urgency=low
+
+  * New upstream release
+
+ -- John Goerzen <jgoerzen@complete.org>  Mon, 11 Aug 2003 17:36:26 -0500
+
+librsync (0.9.5.1-3) unstable; urgency=low
+
+  * Ran autoreconf --force, then rebuilt.  Should make mips even happier
+    now.  Closes: #180005.
+
+ -- John Goerzen <jgoerzen@complete.org>  Fri,  7 Feb 2003 14:06:35 -0600
+
+librsync (0.9.5.1-2) unstable; urgency=low
+
+  * Copied /usr/share/misc/config.{guess,sub} over the package defaults.
+    This is apparently needed for the mips arch.  Closes: #172497.
+
+ -- John Goerzen <jgoerzen@complete.org>  Wed,  5 Feb 2003 15:00:55 -0600
+
+librsync (0.9.5.1-1) unstable; urgency=low
+
+  * New upstream release
+
+ -- John Goerzen <jgoerzen@complete.org>  Tue,  3 Dec 2002 15:04:04 -0600
+
+librsync (0.9.5-2) unstable; urgency=low
+
+  * Applied patch from Mark van Walraven.  Closes: #149267.
+
+ -- John Goerzen <jgoerzen@complete.org>  Fri, 26 Jul 2002 15:05:42 -0500
+
+librsync (0.9.5-1) unstable; urgency=low
+
+  * Initial Release, lintian-clean.  Closes: #133441.
+
+ -- John Goerzen <jgoerzen@complete.org>  Mon, 11 Feb 2002 13:03:19 -0500
--- librsync-0.9.7.orig/debian/librsync1.docs
+++ librsync-0.9.7/debian/librsync1.docs
@@ -0,0 +1,4 @@
+NEWS
+THANKS
+TODO
+libversions.txt
--- librsync-0.9.7.orig/debian/control
+++ librsync-0.9.7/debian/control
@@ -0,0 +1,62 @@
+Source: librsync
+Section: utils
+Priority: optional
+Maintainer: Daniel Baumann <daniel@debian.org>
+Build-Depends: debhelper (> 7), dpatch, autotools-dev, libbz2-dev, libpopt-dev, zlib1g-dev
+Standards-Version: 3.8.0
+Homepage: http://librsync.sourceforge.net/
+Vcs-Browser: http://git.debian.net/?p=librsync.git
+Vcs-Git: git://git.debian.net/git/librsync.git
+
+Package: librsync1
+Section: libs
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: rsync remote-delta algorithm library
+ librsync implements the rsync remote-delta algorithm, which allows for
+ efficient remote updates of a file, without requiring the old and new versions
+ to both be present at the transmitter. The library uses a stream-based designed
+ so that it can be easily embedded into network applications.
+ .
+ The main application at the moment is rproxy, but the library should eventually
+ be generally useful.
+
+Package: librsync-dev
+Section: libdevel
+Architecture: any
+Depends: librsync1 (= ${binary:Version}), libbz2-dev, libpopt-dev, zlib1g-dev
+Description: rsync remote-delta algorithm library (development)
+ librsync implements the rsync remote-delta algorithm, which allows for
+ efficient remote updates of a file, without requiring the old and new versions
+ to both be present at the transmitter. The library uses a stream-based designed
+ so that it can be easily embedded into network applications.
+ .
+ This package contains the development files.
+
+Package: librsync-dbg
+Section: devel
+Priority: extra
+Architecture: any
+Depends: librsync1 (= ${binary:Version}), librsync-dev (= ${binary:Version})
+Description: rsync remote-delta algorithm library (debug)
+ librsync implements the rsync remote-delta algorithm, which allows for
+ efficient remote updates of a file, without requiring the old and new versions
+ to both be present at the transmitter. The library uses a stream-based designed
+ so that it can be easily embedded into network applications.
+ .
+ This package contains the debugging symbols.
+
+Package: rdiff
+Section: utils
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Binary diff tool for signature-based differences
+ rdiff is a little like diff and patch all rolled into one, with support for
+ binary files. Since it takes advantage of the rsync remote-delta algorithm, you
+ do not need the source file in the same place as your destination file.
+ .
+ To use it, you generate a "signature" of the original file and copy the
+ signature (which is very small) to the same location as the modified file. Then
+ you generate a "delta" which describes the changes required to turn the source
+ file into the modified file. The small delta file can then be used to "patch"
+ the original file, to transform it into the modified file.
--- librsync-0.9.7.orig/debian/copyright
+++ librsync-0.9.7/debian/copyright
@@ -0,0 +1,47 @@
+Authors:
+ Martin Pool <mbp@samba.org>
+ Andrew Tridgell <tridge@samba.org>
+ Donovan Baarda <abo@minkirri.apana.org.au>
+Download: http://librsync.sourceforge.net/
+
+Files: *
+Copyright:
+ (C) 1997-2004 Martin Pool <mbp@samba.org>
+ (C) 1997-2004 Andrew Tridgell <tridge@samba.org>
+License: LGPL-2.1+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+ .
+ This library 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
+ Library General Public License for more details.
+ .
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ .
+ On Debian systems, the complete text of the GNU Library General Public License
+ can be found in /usr/share/common-licenses/LGPL-2 file.
+
+Files: debian/*
+Copyright: (C) 2008 Daniel Baumann <daniel@debian.org>
+License: LGPL-2.1+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+ .
+ This library 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
+ Library General Public License for more details.
+ .
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ .
+ On Debian systems, the complete text of the GNU Library General Public License
+ can be found in /usr/share/common-licenses/LGPL-2 file.
--- librsync-0.9.7.orig/debian/patches/02-4gb.dpatch
+++ librsync-0.9.7/debian/patches/02-4gb.dpatch
@@ -0,0 +1,39 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+## 02-4gb.dpatch
+##
+## DP: Fixes problem when transfering >4GB from a 32bit to 64bit host
+## DP: (Closes: #355178).
+
+@DPATCH@
+
+diff -Naurp librsync.orig/mdfour.h librsync/mdfour.h
+--- librsync.orig/mdfour.h	2008-06-21 14:50:55.000000000 +0200
++++ librsync/mdfour.h	2008-06-24 10:26:49.000000000 +0200
+@@ -24,7 +24,7 @@
+ #include "types.h"
+ 
+ struct rs_mdfour {
+-    int                 A, B, C, D;
++    unsigned int        A, B, C, D;
+ #if HAVE_UINT64
+     uint64_t            totalN;
+ #else
+diff -Naurp librsync.orig/patch.c librsync/patch.c
+--- librsync.orig/patch.c	2008-06-21 14:50:55.000000000 +0200
++++ librsync/patch.c	2008-06-24 10:26:49.000000000 +0200
+@@ -214,12 +214,12 @@ static rs_result rs_patch_s_copying(rs_j
+     void            *buf, *ptr;
+     rs_buffers_t    *buffs = job->stream;
+ 
+-    len = job->basis_len;
+-    
+     /* copy only as much as will fit in the output buffer, so that we
+      * don't have to block or store the input. */
+-    if (len > buffs->avail_out)
++    if (job->basis_len > buffs->avail_out)
+         len = buffs->avail_out;
++    else
++        len = job->basis_len;
+ 
+     if (!len)
+         return RS_BLOCKED;
--- librsync-0.9.7.orig/debian/patches/00list
+++ librsync-0.9.7/debian/patches/00list
@@ -0,0 +1,3 @@
+01-manpage.dpatch
+02-4gb.dpatch
+03-getopt.dpatch
--- librsync-0.9.7.orig/debian/patches/03-getopt.dpatch
+++ librsync-0.9.7/debian/patches/03-getopt.dpatch
@@ -0,0 +1,22 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+## 03-getopt.dpatch by Daniel Baumann <daniel@debian.org>
+##
+## DP: Makes rdiff aware of the -i and -z shortcuts for --gzip and --bzip2
+## DP: options (Closes: #435894).
+
+@DPATCH@
+
+diff -Naurp librsync.orig/rdiff.c librsync/rdiff.c
+--- librsync.orig/rdiff.c	2008-07-01 15:29:15.000000000 +0200
++++ librsync/rdiff.c	2008-07-01 15:25:17.000000000 +0200
+@@ -97,8 +97,8 @@ const struct poptOption opts[] = {
+     { "sum-size",    'S', POPT_ARG_INT,  &strong_len },
+     { "statistics",  's', POPT_ARG_NONE, &show_stats },
+     { "stats",        0,  POPT_ARG_NONE, &show_stats },
+-    { "gzip",         0,  POPT_ARG_NONE, 0,             OPT_GZIP },
+-    { "bzip2",        0,  POPT_ARG_NONE, 0,             OPT_BZIP2 },
++    { "gzip",        'z', POPT_ARG_NONE, 0,             OPT_GZIP },
++    { "bzip2",       'i', POPT_ARG_NONE, 0,             OPT_BZIP2 },
+     { "paranoia",     0,  POPT_ARG_NONE, &rs_roll_paranoia },
+     { 0 }
+ };
--- librsync-0.9.7.orig/debian/patches/01-manpage.dpatch
+++ librsync-0.9.7/debian/patches/01-manpage.dpatch
@@ -0,0 +1,41 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+## 01-manpage.dpatch
+##
+## DP: Improving manpage.
+
+@DPATCH@
+
+diff -Naurp librsync.orig/doc/rdiff.1 librsync/doc/rdiff.1
+--- librsync.orig/doc/rdiff.1	2008-06-20 11:10:01.000000000 +0000
++++ librsync/doc/rdiff.1	2008-06-20 11:29:58.000000000 +0000
+@@ -29,10 +29,17 @@ rdiff \- compute and apply signature-bas
+ .PP
+ \fBrdiff\fP [\fIoptions\fP] \fBpatch\fP \fIbasis-file delta-file new-file\fP
+ .fi
++.SH USAGE
++You can use \fBrdiff\fP to update files, much like \fBrsync\fP does.
++However, unlike \fBrsync\fP, \fBrdiff\fP puts you in control.  There
++are three steps to updating a file: \fBsignature\fP, \fBdelta\fP, and
++\fBpatch\fP.
+ .SH DESCRIPTION
+ In every case where a filename must be specified, \- may be used
+ instead to mean either standard input or standard output as
+-appropriate.
++appropriate.  Be aware that if you do this, you'll need to terminate your
++\fIoptions\fP with \-\- or \fBrdiff\fP will think you are passing it
++an empty option.
+ .SH "RETURN VALUE"
+ 0 for successful completion, 1 for environmental problems (file not
+ found, invalid options, IO error, etc), 2 for a corrupt file and 3 for
+diff -Naurp librsync.orig/doc/librsync.3 librsync/doc/librsync.3
+--- librsync.orig/doc/librsync.3	2008-06-21 14:50:55.000000000 +0200
++++ librsync/doc/librsync.3	2008-06-24 10:22:49.000000000 +0200
+@@ -53,7 +53,7 @@ scriptable access to rsync functions.
+ .PP
+ .I rdiff and librsync Manual
+ .PP
+-\fIhttp://rproxy.sourceforge.net/\fP or \fIhttp://linuxcare.com.au/rproxy/\fP.
++\fIhttp://rproxy.sourceforge.net/\fP.
+ .PP
+ \fIdraft-pool-rsync\fP
+ .SH BUGS
