From 80fec14a15fc5058d0ad2415329e435b12d3c42c Mon Sep 17 00:00:00 2001 From: Adam Schubert Date: Mon, 11 May 2015 02:26:59 +0200 Subject: move check-rdiff into tests --- README.RPM | 8 ++++ check-rdiff | 44 ---------------------- debian/changelog | 46 +++++++++++++++++++++++ debian/control | 30 +++++++++++++++ debian/copyright | 12 ++++++ debian/dirs | 2 + debian/docs | 5 +++ debian/librsync-dev.dirs | 2 + debian/librsync-dev.files | 4 ++ debian/librsync1.dirs | 1 + debian/librsync1.files | 2 + debian/rdiff.files | 2 + debian/rules | 95 +++++++++++++++++++++++++++++++++++++++++++++++ debian/watch | 6 +++ tests/check-rdiff | 44 ++++++++++++++++++++++ 15 files changed, 259 insertions(+), 44 deletions(-) create mode 100644 README.RPM delete mode 100755 check-rdiff create mode 100644 debian/changelog create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/dirs create mode 100644 debian/docs create mode 100644 debian/librsync-dev.dirs create mode 100644 debian/librsync-dev.files create mode 100644 debian/librsync1.dirs create mode 100644 debian/librsync1.files create mode 100644 debian/rdiff.files create mode 100755 debian/rules create mode 100644 debian/watch create mode 100755 tests/check-rdiff diff --git a/README.RPM b/README.RPM new file mode 100644 index 0000000..4a7c385 --- /dev/null +++ b/README.RPM @@ -0,0 +1,8 @@ +librsync now comes with an RPM .spec file contributed by Peter Braam +and Shirish Hemant Phatak that will allow you to build an RPM package. + +To do this, simply execute the command: + + rpm -ta librsync-0.9.3.tar.gz + +$Id$ diff --git a/check-rdiff b/check-rdiff deleted file mode 100755 index eb6f9b8..0000000 --- a/check-rdiff +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/perl -# Creates a pair of semi-random files and check if rdiff -# correctlys updates the first to the second. - -# script is "./g" - -$size = 5 << 30; -$blocklen = 6000; - -use Getopt::Long; -GetOptions("size=i" => \$size, - "blocklen=i" => \$blocklen); - -$runlen = $blocklen / 3; - -sub makefile { # Make a moderately random $size-byte file - ($fname,$size)=@_; - print "Creating: $fname ($size bytes)\n"; - open OUT,">$fname" or die "Can't open $fname"; - for $i (1..$size/$runlen) { - $ch = chr(32+int(rand(127))) ; - print OUT ($ch x $runlen); - } - $ch = chr(32+int(rand(127))) ; - print OUT ($ch x ($size % $runlen)); -} - -sub run { - ($cmd)=@_; - print "Running: $cmd\n"; - system($cmd)==0 or die "FAILED!"; -} - -srand(0); -makefile('old',$size); -makefile('new',$size); -run("time rdiff signature -b $blocklen old old.sig"); -run("time rdiff delta -s old.sig new delta"); -run("time rdiff patch -s old delta new2"); -print "Comparing MD5 hashes...\n"; -$sum1 = `md5sum < new`; die 'Failed 1' unless $?==0; print $sum1; -$sum2 = `md5sum < new2`; die 'Failed 2' unless $?==0; print $sum2; -die "DIFFERENT\n" unless $sum1==$sum2; -print "SUCCESS\n" diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..5c43fc5 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,46 @@ +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 Mon, 18 Aug 2003 11:25:03 -0500 + +librsync (0.9.6-1) unstable; urgency=low + + * New upstream release + + -- John Goerzen 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 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 Wed, 5 Feb 2003 15:00:55 -0600 + +librsync (0.9.5.1-1) unstable; urgency=low + + * New upstream release + + -- John Goerzen 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 Fri, 26 Jul 2002 15:05:42 -0500 + +librsync (0.9.5-1) unstable; urgency=low + + * Initial Release, lintian-clean. Closes: #133441. + + -- John Goerzen Mon, 11 Feb 2002 13:03:19 -0500 + diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..fc89e01 --- /dev/null +++ b/debian/control @@ -0,0 +1,30 @@ +Source: librsync +Section: utils +Priority: optional +Maintainer: John Goerzen +Build-Depends: debhelper (>> 3.0.0), libpopt-dev (>= 1.6.2), zlib1g-dev, autoconf2.13 +Standards-Version: 3.5.2 + +Package: librsync1 +Section: libs +Architecture: any +Depends: ${shlibs:Depends} +Description: Binary diff library based on the rsync algorithm + librsync is the next generation of librsync, and provides flexible + checksum-based differencing. The main application at the moment in + rproxy, but the library should eventually be generally useful. + +Package: librsync-dev +Section: devel +Architecture: any +Depends: librsync1 (= ${Source-Version}), libc6-dev +Description: Binary diff library based on the rsync algorithm + These are the development files for librsync1. + +Package: rdiff +Section: utils +Architecture: any +Depends: ${shlibs: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. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..d14ca09 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,12 @@ +This package was debianized by John Goerzen on +Mon, 11 Feb 2002 13:03:19 -0500. + +The homepage is http://librsync.sourcefrog.net/. + +Upstream Author(s): Martin Pool +Andrew Tridgell + + +Copyright: + +GNU LGPL version 2.1, found at /usr/share/common-licenses/LGPL-2.1 diff --git a/debian/dirs b/debian/dirs new file mode 100644 index 0000000..ca882bb --- /dev/null +++ b/debian/dirs @@ -0,0 +1,2 @@ +usr/bin +usr/sbin diff --git a/debian/docs b/debian/docs new file mode 100644 index 0000000..e7769c9 --- /dev/null +++ b/debian/docs @@ -0,0 +1,5 @@ +NEWS +README +README.CVS +TODO +libversions.txt diff --git a/debian/librsync-dev.dirs b/debian/librsync-dev.dirs new file mode 100644 index 0000000..4418816 --- /dev/null +++ b/debian/librsync-dev.dirs @@ -0,0 +1,2 @@ +usr/lib +usr/include diff --git a/debian/librsync-dev.files b/debian/librsync-dev.files new file mode 100644 index 0000000..55f55ea --- /dev/null +++ b/debian/librsync-dev.files @@ -0,0 +1,4 @@ +usr/include/* +usr/lib/lib*.a +usr/lib/lib*.la +usr/lib/lib*.so diff --git a/debian/librsync1.dirs b/debian/librsync1.dirs new file mode 100644 index 0000000..6845771 --- /dev/null +++ b/debian/librsync1.dirs @@ -0,0 +1 @@ +usr/lib diff --git a/debian/librsync1.files b/debian/librsync1.files new file mode 100644 index 0000000..1ff7a2f --- /dev/null +++ b/debian/librsync1.files @@ -0,0 +1,2 @@ +usr/lib/lib*.so.* +usr/share/man/man3/* diff --git a/debian/rdiff.files b/debian/rdiff.files new file mode 100644 index 0000000..68671de --- /dev/null +++ b/debian/rdiff.files @@ -0,0 +1,2 @@ +usr/bin/* +usr/share/man/man1/* diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..566b7d5 --- /dev/null +++ b/debian/rules @@ -0,0 +1,95 @@ +#!/usr/bin/make -f +# 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 + +# This is the debhelper compatability version to use. +export DH_COMPAT=3 + +# shared library versions, option 1 +version=2.0.5 +major=2 +# option 2, assuming the library is created as src/.libs/libfoo.so.2.0.5 or so +#version=`ls src/.libs/lib*.so.* | \ +# awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) print substr($$0,RSTART)}'` +#major=`ls src/.libs/lib*.so.* | \ +# awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'` + +configure: configure-stamp +configure-stamp: + dh_testdir + # Add here commands to configure the package. + ./configure --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --enable-shared + + touch configure-stamp + +build: build-stamp +build-stamp: configure-stamp + dh_testdir + + # Add here commands to compile the package. + $(MAKE) all check + + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + + # Add here commands to clean up after the build process. + -$(MAKE) distclean + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/tmp + $(MAKE) install prefix=$(CURDIR)/debian/tmp/usr + -mkdir debian/tmp/usr/bin + cp .libs/rdiff debian/tmp/usr/bin + +# 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_movefiles + +# dh_installdebconf + dh_installdocs + dh_installexamples + dh_installmenu +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_installinit + dh_installcron + dh_installman + dh_installinfo +# dh_undocumented + dh_installchangelogs NEWS + dh_link + dh_strip + dh_compress + dh_fixperms + dh_makeshlibs + dh_installdeb +# dh_perl + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure diff --git a/debian/watch b/debian/watch new file mode 100644 index 0000000..25b4595 --- /dev/null +++ b/debian/watch @@ -0,0 +1,6 @@ +# Example watch control file for uscan +# Rename this file to "watch" and then you can run the "uscan" command +# to check for upstream updates and more. +# Site Directory Pattern Version Script +#sunsite.unc.edu /pub/Linux/Incoming librsync-(.*)\.tar\.gz debian uupdate +ftp.sourceforge.net /pub/sourceforge/rproxy librsync-(.*)\.tar\.gz debian uupdate diff --git a/tests/check-rdiff b/tests/check-rdiff new file mode 100755 index 0000000..eb6f9b8 --- /dev/null +++ b/tests/check-rdiff @@ -0,0 +1,44 @@ +#!/usr/bin/perl +# Creates a pair of semi-random files and check if rdiff +# correctlys updates the first to the second. + +# script is "./g" + +$size = 5 << 30; +$blocklen = 6000; + +use Getopt::Long; +GetOptions("size=i" => \$size, + "blocklen=i" => \$blocklen); + +$runlen = $blocklen / 3; + +sub makefile { # Make a moderately random $size-byte file + ($fname,$size)=@_; + print "Creating: $fname ($size bytes)\n"; + open OUT,">$fname" or die "Can't open $fname"; + for $i (1..$size/$runlen) { + $ch = chr(32+int(rand(127))) ; + print OUT ($ch x $runlen); + } + $ch = chr(32+int(rand(127))) ; + print OUT ($ch x ($size % $runlen)); +} + +sub run { + ($cmd)=@_; + print "Running: $cmd\n"; + system($cmd)==0 or die "FAILED!"; +} + +srand(0); +makefile('old',$size); +makefile('new',$size); +run("time rdiff signature -b $blocklen old old.sig"); +run("time rdiff delta -s old.sig new delta"); +run("time rdiff patch -s old delta new2"); +print "Comparing MD5 hashes...\n"; +$sum1 = `md5sum < new`; die 'Failed 1' unless $?==0; print $sum1; +$sum2 = `md5sum < new2`; die 'Failed 2' unless $?==0; print $sum2; +die "DIFFERENT\n" unless $sum1==$sum2; +print "SUCCESS\n" -- cgit v1.2.1