debian/0000755000000000000000000000000011410354265007167 5ustar debian/compat0000644000000000000000000000000211403164726010370 0ustar 7 debian/control0000644000000000000000000000211711403164726010576 0ustar Source: zp Section: utils Priority: optional Maintainer: Jari Aalto Build-Depends: debhelper (>= 7.1) Standards-Version: 3.8.4 Vcs-Browser: http://git.debian.org/?p=collab-maint/zp.git Vcs-Git: git://git.debian.org/git/collab-maint/zp.git Homepage: http://mattmahoney.net/dc Package: zp Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: ZPAQ open standard maximum compressor (prebuilt levels) PAQ family is a series of open source data compression archivers that have evolved through collaborative development to top rankings on several benchmarks measuring compression ratio although at the expense of speed and memory usage. . This package includes program zp (a ZPAQ archiver), a proposed standard format for highly compressed data that allows new compression algorithms to be developed without breaking compatibility with older programs. . Note: zp is the "user friendly" version of zpaq(1) archiver. Zp comes with 3 prebuilt and optimized compression levels. It does not require configuration file for min, med, max compression levels. debian/zp.1.pod0000644000000000000000000002122111410354201010447 0ustar # Copyright # # Copyright (C) 2010 Jari Aalto # # 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 3 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. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # Description # # To learn what TOP LEVEL section to use in manual pages, # see POSIX/Susv standard and "tility Description Defaults" at # http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap01.html#tag_01_11 # # This is manual page in Perl POD format. Read more at # http://perldoc.perl.org/perlpod.html or run command: # # perldoc perlpod | less # # To check the syntax: # # podchecker *.pod # # Create manual page with command: # # pod2man PAGE.N.pod > PAGE.N =pod =head1 NAME zp - ZPAQ open standard maximum compressor with prebuilt compression levels =head1 SYNOPSIS create : zp cN archive.zpaq file [file ...] append : zp aN archive.zpaq file [file ...] list : zp l archive.zpaq extract: zp [ex][N] archive.zpaq =head1 DESCRIPTION =head2 General PAQ family was a series of open source data compression archivers that have evolved through collaborative development to top rankings on several benchmarks measuring compression ratio although at the expense of speed and memory usage. ZPAQ ia a proposed standard format for highly compressed data that allows new compression algorithms to be developed without breaking compatibility with older programs. Zp is based on PAQ-like context mixing algorithms which are top ranked on many benchmarks. The format supports archivers, single file compressors, and memory to memory compression. Zp's goal is a high compression ratio in an open format without loss of compatibility between versions as advanced compression techniques are discovered. If you compress in Windows and extract in Linux, then the program will change "\" to "/" during extraction and vice versa. Slashes can be stored with either convention. The program guesses the operating system by counting "/" and "\" in the I environment variable. If this heuristic fails (I not defined) then no slash translation is done. Paths must be relative to the current directory. The program will warn if you store an absolute path. You can only extract such files with command B or by overriding the filename. zp c archive.zpaq /dir/file (Warning: starts with "/") zp x archive.zpaq (Error: bad filename) zp e archive.zpaq (OK: extracts file1 to current directory) zp x archive.zpaq newfile (OK: extracts newfile to current directory) zp x archive.zpaq /dir/file (OK: creates /dir if needed) Also, the same rule applies to file names containing control characters, or longer than 511 characters, or that start with a drive letter like C or contain relative C<..> paths. If this program is run in Linux or UNIX or compiled with g++ in Windows then it will interpret wildcards on the command line in the usual way. A * matches any string and ? matches any character. zp c archive.zpaq * will compress all files in the current directory to C. However, it will not recurse directories. You need to specify the files in each directory that you want to add. The program does not save file timestamps or permissions like some other archivers do. Extracted files are dated from the time of extraction with default permissions. If you need these capabilities, then create a tar file and compress that instead. The compression option 1, 2, or 3 means compress fast, medium, or best respectively. Better compression requires more time and memory. Decompression speed and memory are the same as for compression. Speed (T3200, 2.0 GHz) and memory usage are as follows. The following table shows comparison to C compression All modes compress better but slower than zip. Memory Speed Calgary corpus ------ ----------- --------------- 1 (fast) 38 MB 0.7 sec/MB 807,214 bytes 2 (default) 111 MB 2.3 sec/MB 699,586 bytes 3 (small) 246 MB 6.4 sec/MB 644,545 bytes zip -9 <1 MB 0.13 sec/MB 1,020,719 bytes zp(1) uses compiled ZPAQL (generated by C) to compress and extract in each of the 3 modes about twice as fast as using interpreted code. It automatically recognizes these configurations even if they are produced by other programs. The default compression is the same as the default produced by zpaq(1) and zpipe(1). If another program produces a different configuration, then this program will still correctly decompress it by interpreting the code, which is slower. Also, zpaq(1), unzpaq(1), and zpipe(1) can decompress archives produced by this program. The program stores a filename, comment, and SHA-1 checksum for each file. Other programs may omit these, but this program will still be able to decompress them. This program follows the convention that if the name is omitted, then the contents should be appended to the previous file. If the first filename is omitted, then you must supply it on the command line during extraction. Each filename on the command line replaces one named file in the archive. head2 Commands =over 4 =item B Append to archive. Value N regulates the speed of compression using the specified digit: 1 (fast, less compression), 2 (medium, default), 3 (best, highest compression). =item B Create archive. Value N regulates the speed of compression using the specified digit: 1 (fast, less compression), 2 (medium, default), 3 (best, highest compression). =item B Extract to current directory. With N, extract only block N (1, 2, 3...), where 1 is the first block. Otherwise all blocks are extracted. The B command shows which files are in each block. =item B List contents of archive. =item B Extract with full path names (files... overrides stored names). With N, extract only block N (1, 2, 3...), where 1 is the first block. Otherwise all blocks are extracted. The B command shows which files are in each block. =back =head1 OPTIONS None. =head1 EXAMPLES =head2 Create The archive name must end with I<.zpaq>. All commands will add the extension automatically if you don't specify it. To create an archive: zp c3 archive.zpaq files ... File names are stored in the archive as they appear on the command line. If you specify a path to a different directory, the path is stored, and created during extraction. The B command extracts to the current directory. =head2 Append To (a)ppend to an existing archive. If the archive does not exist then it is created as with the c command. The files are grouped into blocks (solid archive) for each command (see B command). zp a3 archive.zpaq files ... =head2 List To list the contents of an archive. Files are listed in the same block order they were added: zp l archive.zpaq =head2 Extract To extract the contents of the archive: zp x archive.zpaq To extract specific block (see B command output): zp x1 archive.zpaq Blocks are "solid" which means you cannot extract files within a block without extracting the earlier files. To extract first file in block under another name: zp x1 archive.zpaq other-name Program will not overwrite existing files during extraction unless you specify the filenames on the command line: zp x archive.zpaq (Error: file1 exists) zp x archive.zpaq file1 file2 (Overwrite file1, file2) =head1 ENVIRONMENT I is checked for detecting if slash conversions are required. An empty value will disable conversions. =head1 FILES None. =head1 STANDARDS See zpaq*.pdf (ZPAQ Level 1 and later) in section AVAILABILITY. It is anticipated that future levels (ZPAQ-2, ZPAQ-3, etc.) will be backward compatible, such that newer levels can read archives produced by older programs. =head1 AVAILABILITY http://mattmahoney.net/dc =head1 SEE ALSO bzip2(1) gzip(1) lzma(1) lzop(1) p7zip(1) rzip(1) unace(1) unrar(1) unzip(1) zip(1) zpaq(1) =head1 AUTHORS Program was written by Matt Mahoney This manual page was written by Jari Aalto . Released under license GNU GPL version 3 or (at your option) any later version. For more information about license, visit . =cut debian/install0000644000000000000000000000001311403164726010555 0ustar zp usr/bin debian/repack.sh0000755000000000000000000001622711403164726011006 0ustar #!/bin/sh # # Copyright # # Copyright (C) 2008-2010 Jari Aalto # # 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. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . set -e set -u DIR="" Initialize () { # Check depends [ -x /bin/mktemp ] || Die "[ERROR]: mktemp (pkg: coreutils) not installed." [ -x /bin/bzip2 ] || Die "[ERROR]: bzip2 (pkg: bzip2) not installed." [ -x /bin/gzip ] || Die "[ERROR]: gzip (pkg: gzip) not installed." [ -x /bin/tar ] || Die "[ERROR]: tar (pkg: tar) not installed." } InitializeZip () { [ -x /usr/bin/unzip ] || Die "[ERROR]: unzip (pkg: unzip) not installed." } InitializeRar () { [ -x /usr/bin/unrar ] || Die "[ERROR]: unrar (pkg: unrar) not installed." } Help () { echo " SYNOPSIS repack.sh [--upstream-source] [PACKAGE] DESCRIPTION Repackage upstream source. The command line arguments are according to to uscan(1) order. The PACKAGE argument is optional. Can also repack *.zip and *.rar files. OPTIONS --upstream-source Option is ignored. It is passed from uscan(1) when debian/watch file is read. EXAMPLES To manually repack original upstream source foo-1.1.tar.gz to bar-1.10.orig.tar.gz: repack.sh 1.10 foo-1.1.tar.gz bar Save this file to debian/repack.sh and add following line to debian/watch: version=3 http://example.com .*package-(.+).tar.gz debian debian/repack.sh AUTHOR Copyright (C) 2008-2010 Jari Aalto Released under 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." exit 0 } Run () { if [ "${test+test_mode}" = "test_mode" ]; then echo "$@" else [ "${verbose+verbose_mode}" = "verbose_mode" ] && echo "$@" >&2 "$@" fi } Warn () { echo "$*" >&2 } Die () { Warn "$*" exit 1 } AtExit () { if [ "$DIR" ]; then [ -d "$DIR" ] && rm -rf "$DIR" fi } DebianVersion () { # No version conversions yet echo $1 } DebianTar () { local ver=$1 local dver=$2 local file=$3 local pkg=$4 # Convert suffixes file=$(echo $file | sed -e 's,\(tgz\|zip\|rar\)$,tar.gz,' ) # If version is same, use original file if [ "$ver" = "$dver" ]; then if [ "$pkg" ]; then echo $file | sed "s,.*$ver,${pkg}_$ver.orig," else echo $file fi return 0 fi if [ "$pkg" ]; then echo $file | sed -e "s,.*$ver,${pkg}_$dver.orig," else # replace with new version echo $file | sed -e "s,$ver,$dver.orig," fi } Pkg () { local file=$1 if [ -f debian/changelog ]; then dpkg-parsechangelog | awk '/^Source:/ {print $2}' else # package-1.1.tar.gz => package echo $file | sed "s,-[0-9].*,," fi } Version () { local file=$1 local pkg=$(Pkg $file) if [ ! "$pkg" ]; then Die "[ERROR] Internal error. 'pkg' variable not set. Run with debug (-x)" fi echo $file | sed -e "s,\.tar.*,," \ -e "s,\.tgz,," \ -e "s,\.tbz,," \ -e "s,\.tbz2,," \ -e "s,\.zip,," \ -e "s,\.7z,," \ -e "s,\.rar,," \ -e "s,\.lzma,," \ -e "s,\.xz,," \ -e "s,$pkg[-_],," } Cleanup () { [ "$1" ] || return 1 local dir dir=$1 find "$dir" \ \( \ -iname "*.exe" \ -o -name "*.swp" \ -o -name "DEADJOE" \ -o -name "*.[~#]" \ -o -name ".gitignore" \ -o -name ".bzrignore" \ -o -name ".svnignore" \ -o -name ".cvsignore" \ -o -path "*/debian/*" \ -o -path "*/CVS/*" \ -o -path "*/.svn/*" \ -o -path "*/.darcs/*" \ -o -path "*/.bzr/*" \ -o -path "*/.hg/*" \ -o -path "*/.git/*" \ \) \ -print0 | xargs --null --no-run-if-empty rm -rf --verbose # Remove executables find "$dir" -type f -print0 | xargs --null --no-run-if-empty file | awk -F: '$2 ~ /ELF|COFF|LSB exe/ {print $1}' | xargs --no-run-if-empty rm --verbose } Main () { if [ $# -eq 0 ]; then Help fi Initialize case "$1" in --help|-h) Help ;; --*) shift # Ignore uscan(1) argument --upstream-version in $1 ;; esac VER="$1" FILENAME="$2" DIR= if [ ! -f "$FILENAME" ]; then Die "[ERROR] Arg 2. File does not exist: $FILENAME" fi FILE_DIR=$(dirname $FILENAME) FILE=$(basename $FILENAME) PKG=${3:-$(Pkg $FILE)} if [ ! "$PKG" ]; then Die "[ERROR] Internal error. PKG not set. Run with debug (-x)" fi CURVER=$(Version $FILE) if [ ! "$CURVER" ]; then Die "[ERROR] Internal error. CURVER not set. Run with debug (-x)" fi DVER=$(DebianVersion "$VER") DFILE=$(DebianTar "$CURVER" "$DVER" "$FILE" $PKG) # Debian Developer's Reference 6.7.8.2 Repackaged upstream source REPACK_DIR="$PKG-$DVER.orig" DIR=$(mktemp -d ./tmp.repack.XXXXXX) if [ ! "$DIR" ]; then Die "[INTERNAL ERROR] mktemp(1) failed. Debug with 'sh -x PROGRAM'" fi echo "Repacking $FILENAME as $PKG-$DVER" # Create an extra directory to cope with tarballs that # do not have root/ directory UP_BASE="$DIR/unpack" Run mkdir "$UP_BASE" curdir=$(pwd) case "$FILENAME" in *.gz | *.bz2 ) Run tar -C "$UP_BASE" -xf "$FILENAME" ;; *.zip) InitializeZip adir=$(dirname $FILENAME) name=$(basename $FILENAME) Run cd "$UP_BASE" Run unzip "$curdir/$adir/$name" || return 1 cd $curdir ;; *.rar) InitializeRar adir=$(dirname $FILENAME) name=$(basename $FILENAME) Run cd "$UP_BASE" Run unrar x "$curdir/$adir/$name" || return 1 cd $curdir ;; *) Die "Unknonw file format: $FILENAME" ;; esac if [ $(ls -1 "$UP_BASE" | wc -l) -eq 1 ]; then # Tarball does contain a root directory UP_BASE="$UP_BASE/$(ls -1 "$UP_BASE")" fi if [ ! "$UP_BASE" ]; then Die "[INTERNAL ERROR] UP_BASE not set" fi Cleanup "$UP_BASE" # Repack Run mv "$UP_BASE" "$DIR/$REPACK_DIR" # Don't use pipes. Errors are not handled well with them. Run tar -C "$DIR" -cf "$DIR/repacked.tar" "$REPACK_DIR" # The .orig file must use gzip compression tar="$DIR/repacked.tar" case "$DFILE" in *.bz2) DFILE=$(echo $DFILE | sed "s/.bz2/.gz/") ;; *.gz) ;; *.zip) DFILE=$(echo $DFILE | sed "s/.zip/.gz/") ;; *.rar) DFILE=$(echo $DFILE | sed "s/.rar/.gz/") ;; *) Die "Unknown *.suffix in $DFILE" ;; esac suffix=".gz" Run gzip --best "$tar" if [ -f "$DFILE" ]; then echo "Warning, overwriting $DFILE" fi Run mv "$tar$suffix" "$DFILE" echo "Done $DFILE" } trap AtExit QUIT INT EXIT Main "$@" # End of file debian/changelog0000644000000000000000000000022111403164726011037 0ustar zp (1.0-1) unstable; urgency=low * Initial release (Closes: #583584). -- Jari Aalto Fri, 28 May 2010 16:28:22 +0300 debian/watch0000644000000000000000000000015711403164726010226 0ustar version=3 opts="uversionmangle=s/^(.)/$1./" \ http://mattmahoney.net/dc .*zp(\d+).zip debian debian/repack.sh debian/rules0000755000000000000000000000073611403164726010260 0ustar #!/usr/bin/make -f PACKAGE = zp CXX = g++ # -DOPT Do not use (Upstream's note) # -DNDEBUG removes run time checks for better speed. LIBS = -lm CXXFLAGS += -I. -Wall -pedantic -Dunix -DNDEBUG -fomit-frame-pointer man: $(MAKE) -C debian -f pod2man.mk PACKAGE=$(PACKAGE) makeman override_dh_installchangelogs: dh_installchangelogs $(CHANGELOG) override_dh_auto_build: man $(CXX) $(CXXFLAGS) -o $(PACKAGE) $(PACKAGE).cpp $(LIBS) %: dh $@ .PHONY: man # End of file debian/copyright0000644000000000000000000000704211410354201011113 0ustar This work was packaged for Debian by: Jari Aalto on 2010-05-20 16:06:57+0300 It was downloaded from: http://mattmahoney.net/dc The original *.zip was repacked with debian/repack.sh (run automatically from debian/watch). Modifications: remove *.exe file. Upstream Author: Matt Mahoney Copyright: Copyright (C) 2010 Matt Mahoney and Ocarina Networks Inc Copyright (C) 2001 The Internet Society License: This package 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 3 of the License, 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 this program. If not, see - - - [From "LICENSE"] LICENSE description added by Matt Mahoney on May 23, 2010. All code with the exception of the SHA1 class is Copyright (C), Ocarina Networks Inc, as dated in the source code, and is licensed under the GNU General Public License, version 3. The SHA1 class is derived from code in RFC-3174, which is Copyright (C), 2001, The Internet Society. Both licenses are included below. -------------------------------------------------------------------------- License for code derived from RFC-3174 (class SHA1). Source: http://datatracker.ietf.org/doc/rfc3174/ Copyright (C) The Internet Society (2001). All Rights Reserved. This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other than English. The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns. This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The Debian packaging is licensed under the GPL version 2, or (at your option), any later version, and is: Copyright (C) 2010 Jari Aalto On Debian systems, the complete text of the GNU General Public License can be found in "/usr/share/common-licenses/GPL-2". debian/source/0000755000000000000000000000000011403164726010472 5ustar debian/source/format0000644000000000000000000000001411403164726011700 0ustar 3.0 (quilt) debian/pod2man.mk0000644000000000000000000000334611403164726011071 0ustar # pod2man.mk -- Makefile portion to convert *.pod files to manual pages # # Copyright information # # Copyright (C) 2008-2010 Jari Aalto # # 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. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # Description # # Convert *.pod files to manual pages. Write this to 'install' # target: # # install: build $(MANPAGE) ifneq (,) This makefile requires GNU Make. endif # This variable *must* be set when called PACKAGE ?= package # Optional variables to set MANSECT ?= 1 PODCENTER ?= User Commands PODDATE = $$(date "+%Y-%m-%d") # Directories MANSRC = MANDEST = $(MANSRC) MANPOD = $(MANSRC)$(PACKAGE).$(MANSECT).pod MANPAGE = $(MANDEST)$(PACKAGE).$(MANSECT) POD2MAN = pod2man POD2MAN_FLAGS = --utf8 makeman: $(MANPAGE) $(MANPAGE): $(MANPOD) # make target - create manual page from a *.pod page podchecker $(MANPOD) LC_ALL= LANG=C $(POD2MAN) $(POD2MAN_FLAGS) \ --center="$(PODCENTER)" \ --date="$(PODDATE)" \ --name="$(PACKAGE)" \ --section="$(MANSECT)" \ $(MANPOD) \ | sed 's,[Pp]erl v[0-9.]\+,$(PACKAGE),' \ > $(MANPAGE) && \ rm -f pod*.tmp # End of of Makefile part debian/clean0000644000000000000000000000001611403164726010174 0ustar zp debian/*.1 debian/manpages0000644000000000000000000000001311403164726010702 0ustar debian/*.1