debian/0000755000000000000000000000000011744003320007160 5ustar debian/dirs0000644000000000000000000000001011161535243010042 0ustar usr/bin debian/manpages0000644000000000000000000000001611161535243010702 0ustar debian/ppmd.1 debian/watch0000644000000000000000000000041211611777673010234 0ustar # Site Directory Pattern Version Script version=3 # Map a-z in version number to the ordinals 1 to 27 opts="uversionmangle=s/([a-z])/$1./;tr/a-i/1-9/;s/([j-s])/1$1/;tr/j-s/0-9/;s/([t-z])/2$1/;tr/t-z/0-6/" \ http://compression.ru/ds/ ppmd(.*)\.rar debian uupdate debian/patches/0000755000000000000000000000000011744001516010614 5ustar debian/patches/series0000644000000000000000000000016311656016667012050 0ustar 00_makefile.patch 01_upstream.patch 02_non-intel.patch 03_hardlink.patch 04_warnings.patch 05_no_copy_dirent.patch debian/patches/03_hardlink.patch0000644000000000000000000000104311744001303013723 0ustar Author: Guillem Jover --- PPMd.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/PPMd.cpp +++ b/PPMd.cpp @@ -179,8 +179,7 @@ struct ENV_FILE_FINDER { return (fnmatch(name.c_str(),de->d_name,FNM_NOESCAPE) == 0 && stat((getDir(string(pPattern)) + "/" + de->d_name).c_str(),&st) == 0 && - (st.st_mode & S_IRUSR) != 0 && - st.st_nlink == 1); + (st.st_mode & S_IRUSR) != 0); } BOOL findFirst(const char* Pattern) { debian/patches/05_no_copy_dirent.patch0000644000000000000000000000202711744001316015153 0ustar Author: Guillem Jover --- PPMd.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) --- a/PPMd.cpp +++ b/PPMd.cpp @@ -135,10 +135,10 @@ inline void EnvSetDateTimeAttr(const cha utime(WrkStr,&t); chmod(WrkStr,ai.attrib); } struct ENV_FIND_RESULT { - dirent de; struct stat st; + char* filename; char* fullpath; - const char* getFName() const { return de.d_name; } + const char* getFName() const { return filename; } const char* getFullPath() const {return fullpath;} void copyDateTimeAttr() const { ai.attrib=st.st_mode; @@ -152,7 +152,8 @@ struct ENV_FILE_FINDER { struct stat st; ENV_FIND_RESULT getResult() { ENV_FIND_RESULT Rslt; - Rslt.de=*de; Rslt.st=st; + Rslt.st=st; + Rslt.filename= strdup(de->d_name); string fullpath = getDir(string(pPattern))+"/"+de->d_name; Rslt.fullpath= strdup(fullpath.c_str()); return Rslt; debian/patches/00_makefile.patch0000644000000000000000000000220711744001515013711 0ustar Author: Magnus Ekdahl Author: Guillem Jover --- Makefile | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) --- /dev/null +++ b/Makefile @@ -0,0 +1,39 @@ +## Take a look at PPMdType.h for additional compiler & environment options + +TARGET = ppmd +OBJS = PPMd.o Model.o + +prefix = /usr/local +bindir = $(prefix)/bin + +INSTALL = install +INSTALL_PROGRAM = $(INSTALL) -m 755 + +CXXFLAGS = -g -fno-exceptions -fno-rtti -pedantic -Wall \ + -Wno-unknown-pragmas -Wno-sign-compare -Wno-conversion \ + -O2 -fomit-frame-pointer -fstrict-aliasing + +$(TARGET): $(OBJS) + $(CXX) -o $@ $^ + +Model.o: Model.cpp PPMdType.h PPMd.h SubAlloc.hpp Coder.hpp +PPMd.o: PPMd.cpp PPMdType.h PPMd.h + +clean: + $(RM) $(OBJS) + $(RM) $(TARGET) + $(RM) read_me.out read_me.pmd + +test: $(TARGET) + @rm -f read_me.pmd + @cp read_me.txt read_me.out + $(CURDIR)/$(TARGET) e read_me.out + @rm -f read_me.out + $(CURDIR)/$(TARGET) d read_me.pmd + cmp read_me.out read_me.txt + @rm -f read_me.out read_me.pmd + +install: + $(INSTALL_PROGRAM) $(TARGET) $(DESTDIR)$(bindir) + +.PHONY: clean install debian/patches/04_warnings.patch0000644000000000000000000000321211744001312013760 0ustar Author: Guillem Jover --- Coder.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/Coder.hpp +++ b/Coder.hpp @@ -61,8 +61,8 @@ static _THREAD1 DWORD _THREAD low, _THRE inline void rcInitEncoder() { low=0; range=DWORD(-1); } #define RC_ENC_NORMALIZE(stream) { \ - while ((low ^ (low+range)) < TOP || range < BOT && \ - ((range= -low & (BOT-1)),1)) { \ + while ((low ^ (low+range)) < TOP || \ + (range < BOT && ((range= -low & (BOT-1)),1))) { \ _PPMD_E_PUTC(low >> 24,stream); \ range <<= 8; low <<= 8; \ } \ @@ -84,8 +84,8 @@ inline void rcInitDecoder(FILE* stream) code=(code << 8) | _PPMD_D_GETC(stream); } #define RC_DEC_NORMALIZE(stream) { \ - while ((low ^ (low+range)) < TOP || range < BOT && \ - ((range= -low & (BOT-1)),1)) { \ + while ((low ^ (low+range)) < TOP || \ + (range < BOT && ((range= -low & (BOT-1)),1))) { \ code=(code << 8) | _PPMD_D_GETC(stream); \ range <<= 8; low <<= 8; \ } \ debian/patches/01_upstream.patch0000644000000000000000000002542611744001511014001 0ustar Author: Magnus Ekdahl Author: Guillem Jover --- PPMd.cpp | 91 ++++++++++++++++++++++++++++++++++++++++++++++++------------- PPMdType.h | 6 ++-- 2 files changed, 75 insertions(+), 22 deletions(-) --- a/PPMdType.h +++ b/PPMdType.h @@ -11,9 +11,9 @@ #include #include -#define _WIN32_ENVIRONMENT_ +//#define _WIN32_ENVIRONMENT_ //#define _DOS32_ENVIRONMENT_ -//#define _POSIX_ENVIRONMENT_ +#define _POSIX_ENVIRONMENT_ //#define _UNKNOWN_ENVIRONMENT_ #if defined(_WIN32_ENVIRONMENT_)+defined(_DOS32_ENVIRONMENT_)+defined(_POSIX_ENVIRONMENT_)+defined(_UNKNOWN_ENVIRONMENT_) != 1 #error Only one environment must be defined @@ -32,7 +32,7 @@ typedef unsigned long QWORD; typedef unsigned int UINT; #endif /* defined(_WIN32_ENVIRONMENT_) */ /* Optimal definitions for processors: */ -#define _32_NORMAL /* IA-32 */ +//#define _32_NORMAL /* IA-32 */ //#define _64_NORMAL /* AMD64/EM64T */ //#define _32_EXOTIC /* with request for 32bit alignment for uint32_t */ //#define _64_EXOTIC /* some unknown to me processors */ --- a/PPMd.cpp +++ b/PPMd.cpp @@ -5,6 +5,9 @@ * Contents: main routine * * Comments: system & compiler dependent file * ****************************************************************************/ +#include +#include +#include #include #include #include @@ -13,15 +16,29 @@ #define BACKSLASH '\\' #define USAGE_STR "Usage: PPMd [switches] \n" + +using namespace std; static const char* pFName; static DWORD StartFilePosition; static BOOL EncodeFlag; +bool silent=false; static clock_t StartClock; static struct ARC_INFO { // FileLength & CRC? Hmm, maybe in another times... DWORD signature,attrib; WORD info,FNLen,time,date; } ai; +extern "C" void printsilent(const char *fmt, ...) +{ + va_list argp; + if(silent == false) + { + va_start(argp, fmt); + vprintf(fmt, argp); + va_end(argp); + } +} + #if defined(_WIN32_ENVIRONMENT_) #include @@ -120,7 +137,9 @@ inline void EnvSetDateTimeAttr(const cha struct ENV_FIND_RESULT { dirent de; struct stat st; + char* fullpath; const char* getFName() const { return de.d_name; } + const char* getFullPath() const {return fullpath;} void copyDateTimeAttr() const { ai.attrib=st.st_mode; ai.time=st.st_mtime & 0xFFFF; ai.date=st.st_mtime >> 16; @@ -134,16 +153,40 @@ struct ENV_FILE_FINDER { ENV_FIND_RESULT getResult() { ENV_FIND_RESULT Rslt; Rslt.de=*de; Rslt.st=st; + string fullpath = getDir(string(pPattern))+"/"+de->d_name; + Rslt.fullpath= strdup(fullpath.c_str()); return Rslt; } + string getName(string FullPath) + { + int i = FullPath.length()-2; + while(i > 0 && FullPath[i] != '/') i--; + + if(i<=0 || i+1>= FullPath.length()-1) return FullPath; + else return FullPath.substr(i+1,FullPath.length()-1); + } + string getDir(string FullPath) + { + string name = getName(FullPath); + if(FullPath.size() == name.size()) + return string("."); + else + return FullPath.substr(0,FullPath.size()-1-name.size()); + } + BOOL isFileValid() { - return (fnmatch(pPattern,de->d_name,FNM_NOESCAPE) == 0 && - stat(de->d_name,&st) == 0 && (st.st_mode & S_IRUSR) != 0 && + string name = getName(string(pPattern)); + + return (fnmatch(name.c_str(),de->d_name,FNM_NOESCAPE) == 0 && + stat((getDir(string(pPattern)) + "/" + de->d_name).c_str(),&st) == 0 && + (st.st_mode & S_IRUSR) != 0 && st.st_nlink == 1); } + BOOL findFirst(const char* Pattern) { pPattern=Pattern; - return ((dir=opendir(".")) && (de=readdir(dir)) != NULL); + return ((dir=opendir(getDir(string(pPattern)).c_str())) && + (de=readdir(dir)) != NULL); } BOOL findNext() { return ((de=readdir(dir)) != NULL); } void findStop() { closedir(dir); } @@ -185,7 +228,9 @@ static const char* const MTxt[] = { "Can "User break\n", "unknown command: %s\n", "unknown switch: %s\n", "designed and written by Dmitry Shkarin \n" USAGE_STR - "Switches (for encoding only):\n" + "Switches \n" + "\t-s - be silent\n\n" + "(for encoding only):\n" "\t-d - delete file[s] after processing, default: disabled\n" "\t-fName - set output file name to Name\n" "\t-mN - use N MB memory - [1,256], default: %d\n" @@ -213,7 +258,7 @@ void _STDCALL PrintInfo(_PPMD_FILE* Deco if ( !EncodeFlag ) SWAP(NDec,NEnc); sprintf(WrkStr,"%14s:%7d >%7d, %1d.%02d bpb, used:%3d.%1dMB, speed: %d KB/sec", pFName,NDec,NEnc,n1,n2,m1,m2,Speed); - printf("%-79.79s\r",WrkStr); fflush(stdout); + printsilent("%-79.79s\r",WrkStr); fflush(stdout); } static char* _STDCALL ChangeExtRare(const char* In,char* Out,const char* Ext) { @@ -235,7 +280,7 @@ static BOOL YesToAll=FALSE; FILE* fp=fopen(FName,"rb"); if ( !fp ) return TRUE; fclose(fp); - if ( YesToAll ) return RemoveFile(FName); + if ( YesToAll || silent == true) return RemoveFile(FName); printf("%s already exists, overwrite?: es, o, ll, uit?",FName); for ( ; ; ) switch ( toupper(EnvGetCh()) ) { @@ -248,13 +293,13 @@ static BOOL YesToAll=FALSE; static FILE* FOpen(const char* FName,const char* mode) { FILE* fp=fopen(FName,mode); - if ( !fp ) { printf(MTxt[0],FName); exit(-1); } + if ( !fp ) { printsilent(MTxt[0],FName); exit(-1); } setvbuf(fp,NULL,_IOFBF,64*1024); return fp; } inline void PrepareCoding(int SASize,FILE* fp) { if ( !StartSubAllocator(SASize) ) { - printf(MTxt[2]); exit(-1); + printsilent(MTxt[2]); exit(-1); } StartClock=clock(); StartFilePosition=ftell(fp); } @@ -264,7 +309,8 @@ inline void EncodeFile(const ENV_FIND_RE strcpy(WrkStr,ArcName); if (!WrkStr[0] && !TestAccessRare(ChangeExtRare(efr.getFName(),WrkStr,"pmd"))) return; - FILE* fpIn = FOpen(efr.getFName(),"rb"), * fpOut = FOpen(WrkStr,"a+b"); + printsilent("opening in: -%s-, out: -%s-",efr.getFName(),WrkStr); + FILE* fpIn = FOpen(efr.getFullPath(),"rb"), * fpOut = FOpen(WrkStr,"a+b"); pFName=strrchr(efr.getFName(),BACKSLASH); pFName=( pFName )?(pFName+1):(efr.getFName()); efr.copyDateTimeAttr(); @@ -274,7 +320,7 @@ inline void EncodeFile(const ENV_FIND_RE PrepareCoding(SASize,fpOut); EncodeFile(fpOut,fpIn,MaxOrder,CutOff); putchar('\n'); if (ferror(fpOut) || ferror(fpIn)) { - printf(MTxt[1],efr.getFName(),WrkStr); + printsilent(MTxt[1],efr.getFName(),WrkStr); exit(-1); } fclose(fpIn); fclose(fpOut); @@ -293,12 +339,12 @@ inline BOOL DecodeOneFile(FILE* fpIn) MaxOrder=(ai.info & 0x0F)+1; SASize=((ai.info >> 4) & 0xFF)+1; DWORD Variant=(ai.info >> 12)+'A'; if (ai.signature != PPMdSignature || Variant != PROG_VAR) { - printf(MTxt[0],WrkStr); exit(-1); + printsilent(MTxt[0],WrkStr); exit(-1); } PrepareCoding(SASize,fpIn); DecodeFile(fpOut,fpIn,MaxOrder,CutOff); putchar('\n'); if (ferror(fpOut) || ferror(fpIn) || feof(fpIn)) { - printf(MTxt[1],WrkStr,WrkStr); exit(-1); + printsilent(MTxt[1],WrkStr,WrkStr); exit(-1); } fclose(fpOut); EnvSetDateTimeAttr(WrkStr); return TRUE; @@ -322,7 +368,7 @@ inline void TestArchive(char* ArcName,co if ( fp ) { if (!fread(&ai,sizeof(ai),1,fp) || ai.signature != PPMdSignature || (ai.info >> 12)+'A' != PROG_VAR) { - printf(MTxt[0],ArcName); exit(-1); + printsilent(MTxt[0],ArcName); exit(-1); } fclose(fp); } @@ -344,14 +390,17 @@ int main(int argc, char *argv[]) char ArcName[260]; BOOL DeleteFile=FALSE, CutOff=FALSE; int i, MaxOrder=4, SASize=10; - printf("Fast PPMII compressor for textual data, variant %c, "__DATE__"\n",PROG_VAR); - if (argc < 3) { printf(MTxt[6],SASize,MAX_O,MaxOrder); return -1; } + if (argc < 3) { printsilent(MTxt[6],SASize,MAX_O,MaxOrder); return -1; } switch ( toupper(argv[1][0]) ) { case 'E': EncodeFlag=TRUE; break; case 'D': EncodeFlag=FALSE; break; - default : printf(MTxt[4],argv[1]); return -1; + default : printsilent(MTxt[4],argv[1]); return -1; } - for (ArcName[0]=0,i=2;i < argc && (argv[i][0] == '-' || argv[i][0] == '/');i++) + for (ArcName[0]=0,i=2;i < argc && (argv[i][0] == '-' +#ifndef _POSIX_ENVIRONMENT_ + || argv[i][0] == '/' +#endif + );i++) switch ( toupper(argv[i][1]) ) { case 'D': DeleteFile=TRUE; break; case 'F': TestArchive(ArcName,argv[i]+2); break; @@ -359,8 +408,12 @@ int main(int argc, char *argv[]) case 'O': MaxOrder=CLAMP(atoi(argv[i]+2),2,int(MAX_O)); break; case 'R': CutOff=CLAMP(atoi(argv[i]+2),0,1); break; - default : printf(MTxt[5],argv[i]); return -1; + case 'S': silent = true; break; + default : printsilent(MTxt[5],argv[i]); return -1; } + + printsilent("Fast PPMII compressor for textual data, variant %c, "__DATE__"\n",PROG_VAR); + FILE_LIST_NODE* pNode, * pFirstNode=NULL, ** ppNode=&pFirstNode; for (ENV_FILE_FINDER eff;i < argc;i++) { if ( eff.findFirst(argv[i]) ) @@ -368,7 +421,7 @@ int main(int argc, char *argv[]) if ( eff.isFileValid() ) { pNode = new FILE_LIST_NODE(eff.getResult(),ppNode); if ( !pNode ) { - printf(MTxt[2]); return -1; + printsilent(MTxt[2]); return -1; } ppNode=&(pNode->next); } debian/patches/02_non-intel.patch0000644000000000000000000000417611744001276014054 0ustar Author: Guillem Jover --- Model.cpp | 8 ++++---- PPMdType.h | 9 +++++---- SubAlloc.hpp | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) --- a/SubAlloc.hpp +++ b/SubAlloc.hpp @@ -53,7 +53,7 @@ inline void BLK_NODE::insert(void* pv,in p->Stamp=~_DWORD(0); p->NU=NU; Stamp++; } -inline UINT U2B(UINT NU) { return 8*NU+4*NU; } +inline UINT U2B(UINT NU) { return sizeof(DWORD)*2*NU + sizeof(DWORD)*NU; } inline void SplitBlock(void* pv,UINT OldIndx,UINT NewIndx) { UINT i, k, UDiff=Indx2Units[OldIndx]-Indx2Units[NewIndx]; --- a/PPMdType.h +++ b/PPMdType.h @@ -22,13 +22,14 @@ #if defined(_WIN32_ENVIRONMENT_) #include #else /* _DOS32_ENVIRONMENT_ || _POSIX_ENVIRONMENT_ || _UNKNOWN_ENVIRONMENT_ */ +#include typedef int BOOL; #define FALSE 0 #define TRUE 1 -typedef unsigned char BYTE; // it must be equal to uint8_t -typedef unsigned short WORD; // it must be equal to uint16_t -typedef unsigned int DWORD; // it must be equal to uint32_t -typedef unsigned long QWORD; // it must be equal to uint64_t +typedef uint8_t BYTE; +typedef uint16_t WORD; +typedef uint32_t DWORD; +typedef uint64_t QWORD; typedef unsigned int UINT; #endif /* defined(_WIN32_ENVIRONMENT_) */ /* Optimal definitions for processors: */ --- a/Model.cpp +++ b/Model.cpp @@ -66,12 +66,12 @@ static _THREAD1 WORD _THREAD BinSumm[25] static _THREAD1 BOOL _THREAD CutOff; inline void SWAP(PPM_CONTEXT::STATE& s1,PPM_CONTEXT::STATE& s2) { - _WORD t1=(_WORD&)s1; _DWORD t2=s1.iSuccessor; - (_WORD&)s1 = (_WORD&)s2; s1.iSuccessor=s2.iSuccessor; - (_WORD&)s2 = t1; s2.iSuccessor=t2; + PPM_CONTEXT::STATE t1 = s1; + s1 = s2; + s2 = t1; } inline void StateCpy(PPM_CONTEXT::STATE& s1,const PPM_CONTEXT::STATE& s2) { - (_WORD&)s1 = (_WORD&)s2; s1.iSuccessor=s2.iSuccessor; + s1 = s2; } void SEE2_CONTEXT::setShift_rare() { debian/README.source0000644000000000000000000000034711744002240011343 0ustar This is PPMd version j1. Due to policy the debian version number is 10.1-N. PPMonster.exe has been removed, since it's licensed differently than the rest of the package. The rest of the *.exe binary files have also been removed. debian/control0000644000000000000000000000126311744003017010570 0ustar Source: ppmd Section: utils Priority: optional Maintainer: Debian QA Group Vcs-Browser: http://git.hadrons.org/?p=debian/pkgs/ppmd.git Vcs-Git: git://git.hadrons.org/git/debian/pkgs/ppmd.git Build-Depends: debhelper (>= 7) Standards-Version: 3.9.3 Package: ppmd Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: fast archiver program with good compression ratio ppmd predicts the probability of a given character based on the characters that immediately precede it (as all PPM compressors, see also Markov Chains and Context Modeling). This archiver should be better than zip, gzip, bzip2, zzip, szip and ppmz(2) at compressing files. debian/links0000644000000000000000000000011611161535243010230 0ustar usr/bin/ppmd usr/bin/PPMd usr/share/man/man1/ppmd.1 usr/share/man/man1/PPMd.1 debian/ppmd.10000644000000000000000000000474511613205370010220 0ustar .TH ppmd 1 "2011-07-25" "10.1" "utils" .SH "NAME" .LP ppmd \- file-to-file compressor .SH "SYNTAX" .LP .B ppmd [\fBe\fP|\fBd\fP] [\fIswitches\fP] \fIfilename...\fP|\fIwildcard...\fP .SH "DESCRIPTION" .LP It is written for embedding in user programs mainly and it is not intended for immediate use. I was interested in speed and performance improvements of abstract PPM model [1\-6] only, without tuning it to particular data types, therefore compressor works good enough for texts, but it is not so good for nonhomogeneous files (executables) and for noisy analog data (sounds, pictures etc.). Program is very memory consuming, you can choose balance between execution speed and memory economy, on one hand, and compression performance, on another hand, with the help of model order selection option (\-o). .SH "OPTIONS" .LP .TP .B \-d Delete file[s] after processing, default: disabled. .TP .B \-s Silent mode. .TP .BI \-f Name Set output file name to Name. .TP .BI \-m N Use \fIN\fP MB memory \- [1,256], default: \fI10\fP. The PPMII algorithm might need a lot of memory, especially when used on large files and/or used with large model order. If ppmd needs more memory than you give it, the compression will be worse. The exact effect is dependent on the \-r option. .TP .BI \-o N Set model order to \fIN\fP \- [2,16], default: \fI4\fP. Bigger model orders almost surely results in better compression and surely more memory and CPU usage. .TP .BI \-r {0,1,2} Methods of restoration of model correctness at memory insufficiency: '\-r0 \- restart model from scratch'. This method is not optimal for any type of data sources, but it works fast and efficient in average, so it is the recommended method (default). '\-r1 \- cut off model'. This method is optimal for quasistationary sources when the period of stationarity is much larger than period between cutoffs. As a rule, it gives better results, but it is slower than other methods and it is unstable against fragmentation of memory heap at high model orders and low memory. '\-r2 \- freeze model'. This method is optimal for stationary sources (show me such source when You will find it ;\-)). It is fast and efficient for such sources. .SH "EXAMPLES" .LP To run this program the standard way type: .LP .B "ppmd e /tmp/myfile" .LP Alternatively you can run it as: .LP .B "ppmd \-e \-o 16 /tmp/myfile" .SH "AUTHORS" .LP PPMd was written by Dmitry Shkarin and Dmitry Subbotin. .SH "SEE ALSO" .LP .BR gzip "(1), " bzip2 "(1), " lzma (1). debian/source/0000755000000000000000000000000011611671033010465 5ustar debian/source/format0000644000000000000000000000001411275717324011705 0ustar 3.0 (quilt) debian/compat0000644000000000000000000000000211161535243010365 0ustar 7 debian/rules0000755000000000000000000000370311620101274010243 0ustar #!/usr/bin/make -f # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 DESTDIR := $(CURDIR)/debian/ppmd DEB_HOST_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU) DEB_HOST_ARCH_BITS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_BITS) CXXFLAGS = -Wall -g ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS))) CXXFLAGS += -O0 else # FIXME: Use this workaround for now, otherwise with g++ >= 4.1 the code # segfaults, thus FTBFS. Upstream uses -O1 on optimized builds. ifneq (,$(filter $(DEB_HOST_ARCH_CPU),powerpc sparc)) CXXFLAGS += -O1 else CXXFLAGS += -O2 endif endif # Define architecture type depending on the word size, and lax (NORMAL) or # strict (EXOTIC) alginment rules. Always default to strict alignment, as # it's the safest choice, although it might consume more memory. ifeq (32,$(DEB_HOST_ARCH_BITS)) ifneq (,$(filter $(DEB_HOST_ARCH_CPU),i386 avr32 m68k powerpc s390)) CXXFLAGS += -D_32_NORMAL else CXXFLAGS += -D_32_EXOTIC endif else ifneq (,$(filter $(DEB_HOST_ARCH_CPU),amd64 s390)) CXXFLAGS += -D_64_NORMAL else CXXFLAGS += -D_64_EXOTIC endif endif build-indep: build-arch: dh_testdir $(MAKE) CXXFLAGS="$(CXXFLAGS)" build: build-indep build-arch clean: dh_testdir dh_testroot [ ! -f Makefile ] || $(MAKE) clean dh_clean install: check dh_testdir dh_testroot dh_prep dh_installdirs $(MAKE) install DESTDIR=$(DESTDIR) prefix=/usr check: build ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) @echo "Testing if ppmd works on this architecture" $(MAKE) test endif .PHONY: build-indep build-arch build install check clean binary-indep: # Nothing to do. binary-arch: install dh_testdir dh_testroot dh_installdocs dh_installexamples dh_installman dh_installchangelogs dh_install dh_link dh_strip dh_compress dh_fixperms dh_installdeb dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb binary: binary-indep binary-arch .PHONY: binary-indep binary-arch binary debian/docs0000644000000000000000000000007211161535243010041 0ustar read_me.txt debian/Sources_comparison.txt debian/PPMZ.txt debian/PPMZ.txt0000644000000000000000000000422111611671760010522 0ustar Since PPMZ uses a lot of memory/CPU its hard to evaluate it on the debian source packages. Instead it has been evaluated on 29 randomly picked (source) packages. Size: FILE: Tar PPMd PPMZ PPMonstr libnet-ipnetmember-perl_1.00.orig.tar 30720 5029 5078 popularity-contest_1.3-1.1.tar 51200 9330 9421 liblogfile-rotate-perl_1.04.orig.tar 81920 10254 10120 9660 libroxen-popdrop_1.9.orig.tar 51200 10517 10698 galrey_0.5.4-3.tar 81920 16032 16409 xonix-jahu_1.1.orig 112640 23328 24059 slrnface_2.1.1.orig.tar 102400 23350 23989 chase_0.5.orig.tar 133120 27371 28137 ctklight_0.22.2.orig.tar 153600 30907 31846 libhtml-clean-perl_0.8.orig.tar 204800 37108 38223 lib3ds_1.2.0.orig.tar 788480 93063 97185 devmapper_0.96.07.orig.tar 768000 96455 96595 waili_19990723.orig.tar 665600 103438 107891 cweb_3.64.orig.tar 737280 137835 142537 dvipdfm_0.13.2c.orig.tar 921600 145656 152236 gnome-objc_1.0.40.orig.tar 1648640 166359 169168 hwdata_0.64.orig.tar 911360 168677 174532 axyftp_0.5.1.orig.tar 2529280 188027 183509 170732 m4_1.4.orig.tar 1239040 211226 220963 zsh30_3.0.8.orig.tar 2375680 437417 457820 chasen_2.2.9.orig.tar 1505280 475422 476336 manpages-fr_0.9.7.orig.tar 5560320 608556 636652 unzip_5.50.orig.tar 4751360 630058 650473 postfix-snap_1.1.11-20021115.orig.tar 6062080 676614 N/A youbin_3.4.orig.tar 1310720 864727 846722 836893 lg-issue18_6.orig.tar 2877440 1318292 1297317 1287244 scalapack_1.7.orig.tar 31938560 1369437 N/A torch_2.orig.tar.ppmz 4567040 1675610 1661365 1616614 isdnutils_3.2pre1.orig 15667200 4589378 N/A PPMZ is indeed very good. It ain't easy to find a compressor that matches so evenly with PPMd as PPMZ. PPMd = PPMd -o16 -m220 PPMZ = ppmz -b PPMonstr = PPMonster.exe -o16 -m220 N/A = PPMZ can't compress the file in reasonable time using reasonable amounts of memory. PPMonster is an unfree version of PPMd “with time consuming extras”, that has been removed from the Debian source package to avoid main/non-free mixing problems. Its available from: PPMd: 24 wins vs 5 wins for PPMZ. PPMonster: 29 wins vs 0 wins for PPMZ debian/Sources_comparison.txt0000644000000000000000000000327411611671551013616 0ustar A comparison based on the debian source packages. Performed the summer 2002. Packer Total size Compression Improvement Loss from best Time (s) ------ ---------- ----------- ----------- -------------- -------- tar 25764.5Mb 0 -2.42284 0.786226 0 gzip 7527.25Mb 0.707845 0 0.268287 41010.3 zzip 5987.13Mb 0.767621 0.204605 0.0800635 441934 szip 6501.28Mb 0.747666 0.1363 0.152816 37523.5 bzip2 6479.37Mb 0.748516 0.139211 0.149951 43998.6 PPMd2 8631.81Mb 0.664973 -0.146742 0.36192 36657.1 PPMd3 7199.65Mb 0.72056 0.0435215 0.234993 39515.3 PPMd4 6549.61Mb 0.74579 0.129879 0.159067 41225.7 PPMd5 6223.04Mb 0.758465 0.173265 0.114937 43005 PPMd6 6027.49Mb 0.766055 0.199245 0.0862218 44711.3 PPMd7 5892.44Mb 0.771297 0.217185 0.0652795 46276.5 PPMd8 5796.15Mb 0.775034 0.229978 0.0497504 47621.4 PPMd9 5731.01Mb 0.777562 0.238631 0.0389513 48880.5 PPMd10 5688.98Mb 0.779193 0.244215 0.0318506 50777.1 PPMd11 5661.65Mb 0.780254 0.247846 0.0271773 50990.6 PPMd12 5638.57Mb 0.78115 0.250912 0.0231944 51868.9 PPMd13 5625.2Mb 0.781669 0.252688 0.0208738 52697.2 PPMd14 5613.63Mb 0.782118 0.254225 0.0188553 53441 PPMd15 5609.34Mb 0.782285 0.254795 0.0181046 54141.2 PPMd16 5605.05Mb 0.782451 0.255366 0.0173525 54776.9 Legend ~~~~~~ bzip2 = bzip2 -9 PPMdx = ppmd -o x -m220 Compression = Relative compression. Improvement = Relative improvement from gzip compression. Loss from best = Relative size difference compared to using different compressors for each package and using the individually best compressor for each package. Time (s) = Total compression time, in seconds. For more info about the internals of PPMd, see Dmitry Shkarin's article: debian/changelog0000644000000000000000000002005511744003320011034 0ustar ppmd (10.1-5) unstable; urgency=low * Orphan package, set maintainer to Debian QA Group. * Rename README.Debian to README.source. * Update README.source information. * Now using Standards-Version 3.9.3 (no changes needed). -- Guillem Jover Thu, 19 Apr 2012 14:36:31 +0200 ppmd (10.1-4) unstable; urgency=low * Do not assuming struct dirent has a constant size, just strdup() the d_name member instead of partially copying the struct. This fixes the program and thus the build test suite for GNU/Hurd. * Use strdup() instead of malloc()+strcpy() in 01_upstream.patch. -- Guillem Jover Mon, 07 Nov 2011 19:21:05 +0100 ppmd (10.1-3) unstable; urgency=low * Remove intermediate test suite files on clean and test targets. * Use -O1 on sparc to workaround a «Bus Error» on Model.cpp. -- Guillem Jover Tue, 09 Aug 2011 02:44:57 +0200 ppmd (10.1-2) unstable; urgency=low * Define _32_EXOTIC and _64_EXOTIC by default instead of _32_NORMAL and _64_NORMAL, and define the later only on architectures known to not need strict alignment rules, avoiding segfaults but consuming more memory. -- Guillem Jover Mon, 01 Aug 2011 06:16:50 +0200 ppmd (10.1-1) unstable; urgency=low * New upstream release. - Add support for 64-bit architectures. Closes: #178840, #186873, #370419, #462405 * Add ${misc:Depends} to ppmd Depends field. * Do not use perl functions in the uversionmangle watch file opts variable. * Add build-indep and build-arch debian/rules targets. * Do not fail on hardlinked files. Closes: #378039 * Fix some compilation warnings. * Now using Standards-Version 3.9.2. -- Guillem Jover Mon, 25 Jul 2011 08:19:39 +0200 ppmd (9.1-16) unstable; urgency=low * Switch to debhelper compatibility level 7. * Use dh_prep instead of “dh_clean -k”. * Use $(filter ...) instead of $(findstring ...) to extract space separated options from DEB_BUILD_OPTIONS in debian/rules. * Switch to source format “3.0 (quilt)”: - Remove quilt from Build-Depends. - Remove quilt.make include from debian/rules. - Remove patch and unpatch targets from debian/rules. - Remove now unneeded debian/README.source. * Honour nocheck in DEB_BUILD_OPTIONS. * Now using Standards-Version 3.8.3. -- Guillem Jover Wed, 02 Dec 2009 22:42:37 +0100 ppmd (9.1-15) unstable; urgency=low * Add Vcs-Brwoser and Vcs-Git fields. * Add a debian/README.source file. * Now using Standards-Version 3.8.0. * Cleanup debian/copyright: - Remove packaging svn information. - Change 'Upstream Authors' to 'Copyright Holders'. - Add missing copyright years and UTF-8 copyright symbol. * Mangle the Debian version in the watch file. -- Guillem Jover Sun, 22 Jun 2008 06:04:11 +0300 ppmd (9.1-14) unstable; urgency=low * Do not ignore make errors on 'debian/rules clean'. * Switch to quilt: - Remove now unused debian/patch.mk. - Replace include of patch.mk with quilt.make in debian/rules. - Add Build-Depends on 'quilt (>= 0.40)'. * Now using Standards-Version 3.7.3 (no changes needed). * Remove commented debhelper commands. * Remove unused DEB_HOST_GNU_TYPE and DEB_BUILD_GNU_TYPE variables. * Remove dependencies in binary-indep target, and build dependency in binary-arch. * Cleanup and reformat ppmd.1. * Define BYTE, WORD and DWORD based on stdint types to fixed 8 16 and 32 bit types, making the code 64-bit clean. (Closes: #178840, #186873, #370419) - debian/patches/02_non-intel.patch: Update. -- Guillem Jover Tue, 18 Dec 2007 05:23:38 +0200 ppmd (9.1-13) unstable; urgency=low * Fix more non 64-bit clean problems. * Switch to debhelper compativility level 5. * Now using Standards-Version 3.7.2 (no changes needed). * Indent paragraphs in debian/copyright with 4 spaces. * Build with -O1 as a workaround for powerpc, otherwise the code segfaults when using g++-4.1. (Closes: #366753) -- Guillem Jover Sun, 4 Jun 2006 19:50:30 +0300 ppmd (9.1-12) unstable; urgency=low * Add a full test to make sure the program works. * Fix unaligned access and hardcoded endian handling. As a side effect revert the removal of the inline keyword that was causing problems with newer gcc compilers. (Closes: #319152) -- Guillem Jover Thu, 21 Jul 2005 07:50:07 +0300 ppmd (9.1-11) unstable; urgency=low * Now using Standards-Version 3.6.2 (no changes needed). * Update watch file to version 3 (no changes needed). * Pass CXXFLAGS to the Makefile so it is really used. * Cosmetic fixes to the upstream location text. * Lower-case the binary and the manpage filenames. Provide compatilibity symlinks. (Closes: #300089) * Fix cleaning after build. * C++ ABI transition. -- Guillem Jover Thu, 7 Jul 2005 03:58:40 +0300 ppmd (9.1-10) unstable; urgency=low * Remove build stamp file handling. * Fix Subversion repository address. * Fix typos in ppmd manpage. (Closes: #286229) Thanks to Tommaso Moroni . -- Guillem Jover Tue, 1 Feb 2005 07:52:19 +0100 ppmd (9.1-9) unstable; urgency=low * Split patches into debian/patches/: - 00_makefile.patch. - 01_upstream.patch. * Use "License:" instead of missused "Copyright:" in debian/copyright. * Switch from autotools to plain makefile. * Now that it is not using autoconf change debian/rules accordingly. * Moved and cleaned man page from base source dir to debian/. * Cleaned debian/rules from unused cruft. * Removed usr/sbin from debian/dirs file. * Do not use stamp files for the build targets. * Added the location of the Subversion repo. -- Guillem Jover Mon, 15 Nov 2004 11:20:25 +0100 ppmd (9.1-8) unstable; urgency=low * New Maintainer. (Closes: #228937) * Cleaned and regenerated autothings. * Moved debian/ppmd.install contents to debian/docs. * Renamed debian/ppmd.manpages to debian/manpages. * Some minor fixes to package description. * Reformatted the copyright file. * Added debian/watch file. * Switch to debhelper compativility level 4 and use debian/compat instead. * Honour correct DEB_BUILD_OPTIONS. * Cleaned debian/rules a bit. * Now using Standards-Version 3.6.1. -- Guillem Jover Fri, 23 Jan 2004 06:52:04 +0100 ppmd (9.1-7) unstable; urgency=low * Made some build scripts executable from debian/rules (closes:Bug#208958) -- Magnus Ekdahl Sun, 7 Sep 2003 08:47:31 +0200 ppmd (9.1-6) unstable; urgency=low * Made ppmd work with g++-3.3 (closes:Bug#195016). Either g++ has an inline bug or ppmd has a really hard caught bug I cannot find. -- Magnus Ekdahl Tue, 2 Sep 2003 19:57:31 +0200 ppmd (9.1-5) unstable; urgency=low * Using g++-2.95 instead of g++ -- Magnus Ekdahl Fri, 22 Aug 2003 19:19:25 +0200 ppmd (9.1-4) unstable; urgency=low * changed the arch field to any and made the build process fail if ppmd doesn't work on that architecture (closes: Bug#183783) -- Magnus Ekdahl Fri, 22 Aug 2003 19:15:51 +0200 ppmd (9.1-3) unstable; urgency=low * Included file name in upstream URL for clarity (closes: Bug#181647) * Made the manpage somewhat possible to understand (closes: Bug#181665) -- Magnus Ekdahl Sat, 22 Feb 2003 18:20:28 +0100 ppmd (9.1-2) unstable; urgency=low * Description improvment (new ideas by Drew Scott Daniels) * Added compression comparisons * fixed arch field in control (ppmd isn`t 64bit clean) -- Magnus Ekdahl Wed, 12 Feb 2003 23:25:39 +0100 ppmd (9.1-1) unstable; urgency=low * Initial Release. * added silent (-s) switch * wrote man page * fixed absolute pathname on posix systems * changed CLK_TCK to CLOCKS_PER_SEC, updating to newer posix standard and fixing g++ 3.1 compile problem -- Magnus Ekdahl Sun, 12 Jan 2003 12:35:43 +0100 debian/copyright0000644000000000000000000000150311744002347011122 0ustar This package was debianized by Magnus Ekdahl on Sat, 17 Aug 2002 12:34:52 +0200. Then maintained by Guillem Jover . The upstream source was downloaded from: Copyright Holders: Copyright © 1997, 1999-2002, 2006 Dmitry Shkarin Copyright © 1999 Dmitry Subbotin License: You can not misattribute authorship on algorithm or code sources, You can not patent algorithm or its parts, all other things are allowed and welcomed. Dmitry Subbotin and me have authorship rights on code sources. Dmitry Subbotin owns authorship rights on his variation of rangecoder algorithm and I own authorship rights on my variation of PPM algorithm. This variation is named PPMII (PPM with Information Inheritance).