--- bzip2-1.0.2.orig/huffman.c +++ bzip2-1.0.2/huffman.c @@ -162,7 +162,24 @@ if (! tooLong) break; - for (i = 1; i < alphaSize; i++) { + /* 17 Oct 04: keep-going condition for the following loop used + to be 'i < alphaSize', which missed the last element, + theoretically leading to the possibility of the compressor + looping. However, this count-scaling step is only needed if + one of the generated Huffman code words is longer than + maxLen, which up to and including version 1.0.2 was 20 bits, + which is extremely unlikely. In version 1.0.3 maxLen was + changed to 17 bits, which has minimal effect on compression + ratio, but does mean this scaling step is used from time to + time, enough to verify that it works. + + This means that bzip2-1.0.3 and later will only produce + Huffman codes with a maximum length of 17 bits. However, in + order to preserve backwards compatibility with bitstreams + produced by versions pre-1.0.3, the decompressor must still + handle lengths of up to 20. */ + + for (i = 1; i <= alphaSize; i++) { j = weight[i] >> 8; j = 1 + (j / 2); weight[i] = j << 8; --- bzip2-1.0.2.orig/compress.c +++ bzip2-1.0.2/compress.c @@ -488,9 +488,11 @@ /*-- Recompute the tables based on the accumulated frequencies. --*/ + /* maxLen was changed from 20 to 17 in bzip2-1.0.3. See + comment in huffman.c for details. */ for (t = 0; t < nGroups; t++) BZ2_hbMakeCodeLengths ( &(s->len[t][0]), &(s->rfreq[t][0]), - alphaSize, 20 ); + alphaSize, 17 /*20*/ ); } @@ -527,7 +529,7 @@ if (s->len[t][i] > maxLen) maxLen = s->len[t][i]; if (s->len[t][i] < minLen) minLen = s->len[t][i]; } - AssertH ( !(maxLen > 20), 3004 ); + AssertH ( !(maxLen > 17 /*20*/ ), 3004 ); AssertH ( !(minLen < 1), 3005 ); BZ2_hbAssignCodes ( &(s->code[t][0]), &(s->len[t][0]), minLen, maxLen, alphaSize ); @@ -651,8 +653,8 @@ if (s->blockNo > 1) s->numZ = 0; if (s->verbosity >= 2) - VPrintf4( " block %d: crc = 0x%8x, " - "combined CRC = 0x%8x, size = %d\n", + VPrintf4( " block %d: crc = 0x%08x, " + "combined CRC = 0x%08x, size = %d\n", s->blockNo, s->blockCRC, s->combinedCRC, s->nblock ); BZ2_blockSort ( s ); @@ -703,7 +705,7 @@ bsPutUChar ( s, 0x50 ); bsPutUChar ( s, 0x90 ); bsPutUInt32 ( s, s->combinedCRC ); if (s->verbosity >= 2) - VPrintf1( " final combined CRC = 0x%x\n ", s->combinedCRC ); + VPrintf1( " final combined CRC = 0x%08x\n ", s->combinedCRC ); bsFinishWrite ( s ); } } --- bzip2-1.0.2.orig/decompress.c +++ bzip2-1.0.2/decompress.c @@ -524,17 +524,23 @@ if (s->origPtr < 0 || s->origPtr >= nblock) RETURN(BZ_DATA_ERROR); + /*-- Set up cftab to facilitate generation of T^(-1) --*/ + s->cftab[0] = 0; + for (i = 1; i <= 256; i++) s->cftab[i] = s->unzftab[i-1]; + for (i = 1; i <= 256; i++) s->cftab[i] += s->cftab[i-1]; + for (i = 0; i <= 256; i++) { + if (s->cftab[i] < 0 || s->cftab[i] > nblock) { + /* s->cftab[i] can legitimately be == nblock */ + RETURN(BZ_DATA_ERROR); + } + } + s->state_out_len = 0; s->state_out_ch = 0; BZ_INITIALISE_CRC ( s->calculatedBlockCRC ); s->state = BZ_X_OUTPUT; if (s->verbosity >= 2) VPrintf0 ( "rt+rld" ); - /*-- Set up cftab to facilitate generation of T^(-1) --*/ - s->cftab[0] = 0; - for (i = 1; i <= 256; i++) s->cftab[i] = s->unzftab[i-1]; - for (i = 1; i <= 256; i++) s->cftab[i] += s->cftab[i-1]; - if (s->smallDecompress) { /*-- Make a copy of cftab, used in generation of T --*/ --- bzip2-1.0.2.orig/bzlib.c +++ bzip2-1.0.2/bzlib.c @@ -574,8 +574,11 @@ /*---------------------------------------------------*/ +/* Return True iff data corruption is discovered. + Returns False if there is no problem. +*/ static -void unRLE_obuf_to_output_FAST ( DState* s ) +Bool unRLE_obuf_to_output_FAST ( DState* s ) { UChar k1; @@ -584,7 +587,7 @@ while (True) { /* try to finish existing run */ while (True) { - if (s->strm->avail_out == 0) return; + if (s->strm->avail_out == 0) return False; if (s->state_out_len == 0) break; *( (UChar*)(s->strm->next_out) ) = s->state_out_ch; BZ_UPDATE_CRC ( s->calculatedBlockCRC, s->state_out_ch ); @@ -594,10 +597,13 @@ s->strm->total_out_lo32++; if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++; } - + /* can a new run be started? */ - if (s->nblock_used == s->save_nblock+1) return; + if (s->nblock_used == s->save_nblock+1) return False; + /* Only caused by corrupt data stream? */ + if (s->nblock_used > s->save_nblock+1) + return True; s->state_out_len = 1; s->state_out_ch = s->k0; @@ -667,6 +673,10 @@ cs_avail_out--; } } + /* Only caused by corrupt data stream? */ + if (c_nblock_used > s_save_nblockPP) + return True; + /* can a new run be started? */ if (c_nblock_used == s_save_nblockPP) { c_state_out_len = 0; goto return_notr; @@ -712,6 +722,7 @@ s->strm->avail_out = cs_avail_out; /* end save */ } + return False; } @@ -732,8 +743,11 @@ /*---------------------------------------------------*/ +/* Return True iff data corruption is discovered. + Returns False if there is no problem. +*/ static -void unRLE_obuf_to_output_SMALL ( DState* s ) +Bool unRLE_obuf_to_output_SMALL ( DState* s ) { UChar k1; @@ -742,7 +756,7 @@ while (True) { /* try to finish existing run */ while (True) { - if (s->strm->avail_out == 0) return; + if (s->strm->avail_out == 0) return False; if (s->state_out_len == 0) break; *( (UChar*)(s->strm->next_out) ) = s->state_out_ch; BZ_UPDATE_CRC ( s->calculatedBlockCRC, s->state_out_ch ); @@ -754,8 +768,11 @@ } /* can a new run be started? */ - if (s->nblock_used == s->save_nblock+1) return; - + if (s->nblock_used == s->save_nblock+1) return False; + + /* Only caused by corrupt data stream? */ + if (s->nblock_used > s->save_nblock+1) + return True; s->state_out_len = 1; s->state_out_ch = s->k0; @@ -788,7 +805,7 @@ while (True) { /* try to finish existing run */ while (True) { - if (s->strm->avail_out == 0) return; + if (s->strm->avail_out == 0) return False; if (s->state_out_len == 0) break; *( (UChar*)(s->strm->next_out) ) = s->state_out_ch; BZ_UPDATE_CRC ( s->calculatedBlockCRC, s->state_out_ch ); @@ -800,7 +817,11 @@ } /* can a new run be started? */ - if (s->nblock_used == s->save_nblock+1) return; + if (s->nblock_used == s->save_nblock+1) return False; + + /* Only caused by corrupt data stream? */ + if (s->nblock_used > s->save_nblock+1) + return True; s->state_out_len = 1; s->state_out_ch = s->k0; @@ -830,6 +851,7 @@ /*---------------------------------------------------*/ int BZ_API(BZ2_bzDecompress) ( bz_stream *strm ) { + Bool corrupt; DState* s; if (strm == NULL) return BZ_PARAM_ERROR; s = strm->state; @@ -840,12 +862,13 @@ if (s->state == BZ_X_IDLE) return BZ_SEQUENCE_ERROR; if (s->state == BZ_X_OUTPUT) { if (s->smallDecompress) - unRLE_obuf_to_output_SMALL ( s ); else - unRLE_obuf_to_output_FAST ( s ); + corrupt = unRLE_obuf_to_output_SMALL ( s ); else + corrupt = unRLE_obuf_to_output_FAST ( s ); + if (corrupt) return BZ_DATA_ERROR; if (s->nblock_used == s->save_nblock+1 && s->state_out_len == 0) { BZ_FINALISE_CRC ( s->calculatedBlockCRC ); if (s->verbosity >= 3) - VPrintf2 ( " {0x%x, 0x%x}", s->storedBlockCRC, + VPrintf2 ( " {0x%08x, 0x%08x}", s->storedBlockCRC, s->calculatedBlockCRC ); if (s->verbosity >= 2) VPrintf0 ( "]" ); if (s->calculatedBlockCRC != s->storedBlockCRC) @@ -863,7 +886,7 @@ Int32 r = BZ2_decompress ( s ); if (r == BZ_STREAM_END) { if (s->verbosity >= 3) - VPrintf2 ( "\n combined CRCs: stored = 0x%x, computed = 0x%x", + VPrintf2 ( "\n combined CRCs: stored = 0x%08x, computed = 0x%08x", s->storedCombinedCRC, s->calculatedCombinedCRC ); if (s->calculatedCombinedCRC != s->storedCombinedCRC) return BZ_DATA_ERROR; --- bzip2-1.0.2.orig/bzip2.c +++ bzip2-1.0.2/bzip2.c @@ -312,6 +312,7 @@ static void copyFileName ( Char*, Char* ); static void* myMalloc ( Int32 ); +static int applySavedFileAttrToOutputFile ( int fd ); @@ -457,6 +458,10 @@ ret = fflush ( zStream ); if (ret == EOF) goto errhandler_io; if (zStream != stdout) { + int fd = fileno ( zStream ); + if (fd < 0) goto errhandler_io; + ret = applySavedFileAttrToOutputFile ( fd ); + if (ret != 0) goto errhandler_io; ret = fclose ( zStream ); outputHandleJustInCase = NULL; if (ret == EOF) goto errhandler_io; @@ -525,6 +530,7 @@ UChar obuf[5000]; UChar unused[BZ_MAX_UNUSED]; Int32 nUnused; + void* unusedTmpV; UChar* unusedTmp; nUnused = 0; @@ -554,9 +560,10 @@ } if (bzerr != BZ_STREAM_END) goto errhandler; - BZ2_bzReadGetUnused ( &bzerr, bzf, (void**)(&unusedTmp), &nUnused ); + BZ2_bzReadGetUnused ( &bzerr, bzf, &unusedTmpV, &nUnused ); if (bzerr != BZ_OK) panic ( "decompress:bzReadGetUnused" ); + unusedTmp = (UChar*)unusedTmpV; for (i = 0; i < nUnused; i++) unused[i] = unusedTmp[i]; BZ2_bzReadClose ( &bzerr, bzf ); @@ -567,6 +574,12 @@ closeok: if (ferror(zStream)) goto errhandler_io; + if ( stream != stdout) { + int fd = fileno ( stream ); + if (fd < 0) goto errhandler_io; + ret = applySavedFileAttrToOutputFile ( fd ); + if (ret != 0) goto errhandler_io; + } ret = fclose ( zStream ); if (ret == EOF) goto errhandler_io; @@ -639,6 +652,7 @@ UChar obuf[5000]; UChar unused[BZ_MAX_UNUSED]; Int32 nUnused; + void* unusedTmpV; UChar* unusedTmp; nUnused = 0; @@ -662,9 +676,10 @@ } if (bzerr != BZ_STREAM_END) goto errhandler; - BZ2_bzReadGetUnused ( &bzerr, bzf, (void**)(&unusedTmp), &nUnused ); + BZ2_bzReadGetUnused ( &bzerr, bzf, &unusedTmpV, &nUnused ); if (bzerr != BZ_OK) panic ( "test:bzReadGetUnused" ); + unusedTmp = (UChar*)unusedTmpV; for (i = 0; i < nUnused; i++) unused[i] = unusedTmp[i]; BZ2_bzReadClose ( &bzerr, bzf ); @@ -1125,7 +1140,7 @@ static -void applySavedMetaInfoToOutputFile ( Char *dstName ) +void applySavedTimeInfoToOutputFile ( Char *dstName ) { # if BZ_UNIX IntNative retVal; @@ -1134,16 +1149,26 @@ uTimBuf.actime = fileMetaInfo.st_atime; uTimBuf.modtime = fileMetaInfo.st_mtime; - retVal = chmod ( dstName, fileMetaInfo.st_mode ); - ERROR_IF_NOT_ZERO ( retVal ); - retVal = utime ( dstName, &uTimBuf ); ERROR_IF_NOT_ZERO ( retVal ); +# endif +} - retVal = chown ( dstName, fileMetaInfo.st_uid, fileMetaInfo.st_gid ); +static +int applySavedFileAttrToOutputFile ( int fd ) +{ +# if BZ_UNIX + IntNative retVal; + + retVal = fchmod ( fd, fileMetaInfo.st_mode ); + if (retVal != 0) + return retVal; + + (void) fchown ( fd, fileMetaInfo.st_uid, fileMetaInfo.st_gid ); /* chown() will in many cases return with EPERM, which can be safely ignored. */ + return 0; # endif } @@ -1366,7 +1391,7 @@ /*--- If there was an I/O error, we won't get here. ---*/ if ( srcMode == SM_F2F ) { - applySavedMetaInfoToOutputFile ( outName ); + applySavedTimeInfoToOutputFile ( outName ); deleteOutputOnInterrupt = False; if ( !keepInputFiles ) { IntNative retVal = remove ( inName ); @@ -1544,7 +1569,7 @@ /*--- If there was an I/O error, we won't get here. ---*/ if ( magicNumberOK ) { if ( srcMode == SM_F2F ) { - applySavedMetaInfoToOutputFile ( outName ); + applySavedTimeInfoToOutputFile ( outName ); deleteOutputOnInterrupt = False; if ( !keepInputFiles ) { IntNative retVal = remove ( inName ); @@ -1959,7 +1984,9 @@ case '8': blockSize100k = 8; break; case '9': blockSize100k = 9; break; case 'V': - case 'L': license(); break; + case 'L': license(); + exit ( 0 ); + break; case 'v': verbosity++; break; case 'h': usage ( progName ); exit ( 0 ); @@ -1985,8 +2012,8 @@ if (ISFLAG("--keep")) keepInputFiles = True; else if (ISFLAG("--small")) smallMode = True; else if (ISFLAG("--quiet")) noisy = False; else - if (ISFLAG("--version")) license(); else - if (ISFLAG("--license")) license(); else + if (ISFLAG("--version")) { license(); exit ( 0 ); } else + if (ISFLAG("--license")) { license(); exit ( 0 ); } else if (ISFLAG("--exponential")) workFactor = 1; else if (ISFLAG("--repetitive-best")) redundant(aa->name); else if (ISFLAG("--repetitive-fast")) redundant(aa->name); else @@ -2072,12 +2099,14 @@ testf ( aa->name ); } } - if (testFailsExist && noisy) { - fprintf ( stderr, - "\n" - "You can use the `bzip2recover' program to attempt to recover\n" - "data from undamaged sections of corrupted files.\n\n" - ); + if (testFailsExist) { + if (noisy) { + fprintf ( stderr, + "\n" + "You can use the `bzip2recover' program to attempt to recover\n" + "data from undamaged sections of corrupted files.\n\n" + ); + } setExit(2); exit(exitValue); } --- bzip2-1.0.2.orig/bzip2recover.c +++ bzip2-1.0.2/bzip2recover.c @@ -56,6 +56,8 @@ #include #include #include +#include +#include /* This program records bit locations in the file to be recovered. @@ -301,6 +303,19 @@ name[n-1] == '2'); } +/*---------------------------------------------*/ +/* Open an output file safely with O_EXCL and good permissions */ +FILE* fopen_output( Char* name, const char* mode ) +{ + FILE *fp; + int fh; + + fh = open(name, O_WRONLY|O_CREAT|O_EXCL, 0600); + if (fh == -1) return NULL; + fp = fdopen(fh, mode); + if (fp == NULL) close(fh); + return fp; +} /*---------------------------------------------------*/ /*--- ---*/ @@ -338,6 +353,7 @@ Int32 b, wrBlock, currBlock, rbCtr; MaybeUInt64 bitsRead; + UInt32 buffHi, buffLo, blockCRC; Char* p; @@ -518,7 +534,7 @@ fprintf ( stderr, " writing block %d to `%s' ...\n", wrBlock+1, outFileName ); - outFile = fopen ( outFileName, "wb" ); + outFile = fopen_output ( outFileName, "wb" ); if (outFile == NULL) { fprintf ( stderr, "%s: can't write `%s'\n", progName, outFileName ); --- bzip2-1.0.2.orig/Makefile +++ bzip2-1.0.2/Makefile @@ -1,4 +1,5 @@ - +somajor=1.0 +sominor=$(somajor).2 SHELL=/bin/sh # To assist in cross-compiling @@ -9,7 +10,7 @@ # Suitably paranoid flags to avoid bugs in gcc-2.7 BIGFILES=-D_FILE_OFFSET_BITS=64 -CFLAGS=-Wall -Winline -O2 -fomit-frame-pointer -fno-strength-reduce $(BIGFILES) +CFLAGS=-Wall -Winline -O2 $(BIGFILES) $(DEBCFLAGS) # Where you want it installed when you do 'make install' PREFIX=/usr @@ -23,9 +24,9 @@ decompress.o \ bzlib.o -all: libbz2.a bzip2 bzip2recover test +all: libbz2.a bzip2 bzip2recover # test -bzip2: libbz2.a bzip2.o +bzip2: libbz2.so bzip2.o $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2 bzip2.o -L. -lbz2 bzip2recover: bzip2recover.o @@ -34,20 +35,42 @@ libbz2.a: $(OBJS) rm -f libbz2.a $(AR) cq libbz2.a $(OBJS) - @if ( test -f $(RANLIB) -o -f /usr/bin/ranlib -o \ - -f /bin/ranlib -o -f /usr/ccs/bin/ranlib ) ; then \ + @if ( test -f $(RANLIB) || test -f /usr/bin/ranlib || \ + test -f /bin/ranlib || test -f /usr/ccs/bin/ranlib ) ; then \ echo $(RANLIB) libbz2.a ; \ $(RANLIB) libbz2.a ; \ fi +libbz2.so: libbz2.so.$(somajor) + ln -sf $^ $@ + +libbz2.so.$(somajor): libbz2.so.$(sominor) + ln -sf $^ $@ + +libbz2.so.$(sominor): $(OBJS:%.o=%.sho) + $(CC) -o libbz2.so.$(sominor) -shared \ + -Wl,-soname,libbz2.so.$(somajor) $^ -lc + +%.sho: %.c + $(CC) $(CFLAGS) -D_REENTRANT -fPIC -o $@ -c $< + +%.o: %.c + $(CC) $(CFLAGS) -D_REENTRANT -o $@ -c $< + check: test test: bzip2 @cat words1 + LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH \ ./bzip2 -1 < sample1.ref > sample1.rb2 + LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH \ ./bzip2 -2 < sample2.ref > sample2.rb2 + LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH \ ./bzip2 -3 < sample3.ref > sample3.rb2 + LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH \ ./bzip2 -d < sample1.bz2 > sample1.tst + LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH \ ./bzip2 -d < sample2.bz2 > sample2.tst + LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH \ ./bzip2 -ds < sample3.bz2 > sample3.tst cmp sample1.bz2 sample1.rb2 cmp sample2.bz2 sample2.rb2 @@ -57,15 +80,15 @@ cmp sample3.tst sample3.ref @cat words3 -install: bzip2 bzip2recover +install: bzip2 bzip2recover libbz2.a if ( test ! -d $(PREFIX)/bin ) ; then mkdir -p $(PREFIX)/bin ; fi if ( test ! -d $(PREFIX)/lib ) ; then mkdir -p $(PREFIX)/lib ; fi if ( test ! -d $(PREFIX)/man ) ; then mkdir -p $(PREFIX)/man ; fi if ( test ! -d $(PREFIX)/man/man1 ) ; then mkdir -p $(PREFIX)/man/man1 ; fi if ( test ! -d $(PREFIX)/include ) ; then mkdir -p $(PREFIX)/include ; fi cp -f bzip2 $(PREFIX)/bin/bzip2 - cp -f bzip2 $(PREFIX)/bin/bunzip2 - cp -f bzip2 $(PREFIX)/bin/bzcat + ln $(PREFIX)/bin/bzip2 $(PREFIX)/bin/bunzip2 + ln $(PREFIX)/bin/bzip2 $(PREFIX)/bin/bzcat cp -f bzip2recover $(PREFIX)/bin/bzip2recover chmod a+x $(PREFIX)/bin/bzip2 chmod a+x $(PREFIX)/bin/bunzip2 @@ -75,8 +98,10 @@ chmod a+r $(PREFIX)/man/man1/bzip2.1 cp -f bzlib.h $(PREFIX)/include chmod a+r $(PREFIX)/include/bzlib.h - cp -f libbz2.a $(PREFIX)/lib + cp -fa libbz2.a libbz2.so* $(PREFIX)/lib chmod a+r $(PREFIX)/lib/libbz2.a + cp -f bzexe $(PREFIX)/bin/bzexe + chmod a+x $(PREFIX)/bin/bzexe cp -f bzgrep $(PREFIX)/bin/bzgrep ln $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzegrep ln $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzfgrep @@ -87,7 +112,8 @@ cp -f bzdiff $(PREFIX)/bin/bzdiff ln $(PREFIX)/bin/bzdiff $(PREFIX)/bin/bzcmp chmod a+x $(PREFIX)/bin/bzdiff - cp -f bzgrep.1 bzmore.1 bzdiff.1 $(PREFIX)/man/man1 + cp -f bzexe.1 bzgrep.1 bzmore.1 bzdiff.1 $(PREFIX)/man/man1 + chmod a+r $(PREFIX)/man/man1/bzexe.1 chmod a+r $(PREFIX)/man/man1/bzgrep.1 chmod a+r $(PREFIX)/man/man1/bzmore.1 chmod a+r $(PREFIX)/man/man1/bzdiff.1 @@ -98,30 +124,10 @@ distclean: clean clean: - rm -f *.o libbz2.a bzip2 bzip2recover \ + rm -f *.o *.sho libbz2.a libbz2.so* bzip2 bzip2recover \ sample1.rb2 sample2.rb2 sample3.rb2 \ sample1.tst sample2.tst sample3.tst -blocksort.o: blocksort.c - @cat words0 - $(CC) $(CFLAGS) -c blocksort.c -huffman.o: huffman.c - $(CC) $(CFLAGS) -c huffman.c -crctable.o: crctable.c - $(CC) $(CFLAGS) -c crctable.c -randtable.o: randtable.c - $(CC) $(CFLAGS) -c randtable.c -compress.o: compress.c - $(CC) $(CFLAGS) -c compress.c -decompress.o: decompress.c - $(CC) $(CFLAGS) -c decompress.c -bzlib.o: bzlib.c - $(CC) $(CFLAGS) -c bzlib.c -bzip2.o: bzip2.c - $(CC) $(CFLAGS) -c bzip2.c -bzip2recover.o: bzip2recover.c - $(CC) $(CFLAGS) -c bzip2recover.c - DISTNAME=bzip2-1.0.2 tarfile: rm -f $(DISTNAME) @@ -173,6 +179,8 @@ $(DISTNAME)/bzdiff.1 \ $(DISTNAME)/bzmore \ $(DISTNAME)/bzmore.1 \ + $(DISTNAME)/bzexe \ + $(DISTNAME)/bzexe.1 \ $(DISTNAME)/bzgrep \ $(DISTNAME)/bzgrep.1 \ $(DISTNAME)/Makefile-libbz2_so --- bzip2-1.0.2.orig/manual.texi +++ bzip2-1.0.2/manual.texi @@ -46,7 +46,7 @@ find it identical to that contained in the file LICENSE in the source distribution. -@bf{------------------ START OF THE LICENSE ------------------} +@emph{------------------ START OF THE LICENSE ------------------} This program, @code{bzip2}, and associated library @code{libbzip2}, are @@ -90,7 +90,7 @@ @code{bzip2}/@code{libbzip2} version 1.0.2 of 30 December 2001. -@bf{------------------ END OF THE LICENSE ------------------} +@emph{------------------ END OF THE LICENSE ------------------} Web sites: --- bzip2-1.0.2.orig/manual_3.html +++ bzip2-1.0.2/manual_3.html @@ -1450,7 +1450,7 @@ int bzerror; int nWritten; -f = fopen ( "myfile.bz2", "r" ); +f = fopen ( "myfile.bz2", "rb" ); if (!f) { /* handle error */ } @@ -1463,7 +1463,7 @@ bzerror = BZ_OK; while (bzerror == BZ_OK && /* arbitrary other conditions */) { nBuf = BZ2_bzRead ( &bzerror, b, buf, /* size of buf */ ); - if (bzerror == BZ_OK) { + if (nBuf) { /* do something with buf[0 .. nBuf-1] */ } } --- bzip2-1.0.2.orig/bzmore +++ bzip2-1.0.2/bzmore @@ -24,10 +24,10 @@ # 'stty min 1' resets eof to ^a on both SunOS and SysV! cb='min 1 -icanon'; ncb='icanon eof ^d' fi -if test $? -eq 0 -a -n "$oldtty"; then - trap 'stty $oldtty 2>/dev/null; exit' 0 2 3 5 10 13 15 +if test $? -eq 0 && test -n "$oldtty"; then + trap 'stty $oldtty 2>/dev/null; exit' 0 INT QUIT TRAP USR1 PIPE TERM else - trap 'stty $ncb echo 2>/dev/null; exit' 0 2 3 5 10 13 15 + trap 'stty $ncb echo 2>/dev/null; exit' 0 INT QUIT TRAP USR1 PIPE TERM fi if test $# = 0; then @@ -46,7 +46,7 @@ ANS=`dd bs=1 count=1 2>/dev/null` stty $ncb echo 2>/dev/null echo " " - if test "$ANS" = 'e' -o "$ANS" = 'q'; then + if test "$ANS" = 'e' || test "$ANS" = 'q'; then exit fi fi --- bzip2-1.0.2.orig/bzgrep +++ bzip2-1.0.2/bzgrep @@ -1,7 +1,8 @@ -#!/bin/sh +#!/bin/bash # Bzgrep wrapped for bzip2, # adapted from zgrep by Philippe Troin for Debian GNU/Linux. +# modified by Anibal Monsalve Salazar on 8 January 2005 ## zgrep notice: ## zgrep -- a wrapper around a grep program that decompresses files as needed ## Adapted from a version sent by Charles Levert @@ -59,11 +60,14 @@ if test $list -eq 1; then bzip2 -cdfq "$i" | $grep $opt "$pat" 2>&1 > /dev/null && echo $i r=$? - elif test $# -eq 1 -o $silent -eq 1; then + elif test $# -eq 1 || test $silent -eq 1; then bzip2 -cdfq "$i" | $grep $opt "$pat" r=$? else - bzip2 -cdfq "$i" | $grep $opt "$pat" | sed "s|^|${i}:|" + p=${i//\\\\/\\\\} + p=${p//|/\\|} + p=${p//&/\\&} + bzip2 -cdfq "$i" | $grep $opt "$pat" | sed "s|^|${p}:|" r=$? fi test "$r" -ne 0 && res="$r" --- bzip2-1.0.2.orig/bzexe.1 +++ bzip2-1.0.2/bzexe.1 @@ -0,0 +1,43 @@ +.TH BZEXE 1 +.SH NAME +bzexe \- compress executable files in place +.SH SYNOPSIS +.B bzexe +[ name ... ] +.SH DESCRIPTION +The +.I bzexe +utility allows you to compress executables in place and have them +automatically uncompress and execute when you run them (at a penalty +in performance). For example if you execute ``bzexe /bin/cat'' it +will create the following two files: +.nf +.br + -r-xr-xr-x 1 root bin 9644 Feb 11 11:16 /bin/cat + -r-xr-xr-x 1 bin bin 24576 Nov 23 13:21 /bin/cat~ +.fi +/bin/cat~ is the original file and /bin/cat is the self-uncompressing +executable file. You can remove /bin/cat~ once you are sure that +/bin/cat works properly. +.PP +This utility is most useful on systems with very small disks. +.SH OPTIONS +.TP +.B \-d +Decompress the given executables instead of compressing them. +.SH "SEE ALSO" +bzip2(1), znew(1), zmore(1), zcmp(1), zforce(1) +.SH CAVEATS +The compressed executable is a shell script. This may create some +security holes. In particular, the compressed executable relies +on the PATH environment variable to find +.I gzip +and some other utilities +.I (tail, chmod, ln, sleep). +.SH "BUGS" +.I bzexe +attempts to retain the original file attributes on the compressed executable, +but you may have to fix them manually in some cases, using +.I chmod +or +.I chown. --- bzip2-1.0.2.orig/bzexe +++ bzip2-1.0.2/bzexe @@ -0,0 +1,182 @@ +#!/bin/sh +# gzexe: compressor for Unix executables. +# Use this only for binaries that you do not use frequently. +# +# The compressed version is a shell script which decompresses itself after +# skipping $skip lines of shell commands. We try invoking the compressed +# executable with the original name (for programs looking at their name). +# We also try to retain the original file permissions on the compressed file. +# For safety reasons, gzexe will not create setuid or setgid shell scripts. + +# WARNING: the first line of this file must be either : or #!/bin/sh +# The : is required for some old versions of csh. +# On Ultrix, /bin/sh is too buggy, change the first line to: #!/bin/sh5 + + +# Copyright (C) 1998, 2002 Free Software Foundation +# Copyright (C) 1993 Jean-loup Gailly + +# 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, 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, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + + +PATH="/usr/bin:$PATH" +x=`basename $0` +if test $# = 0; then + echo compress executables. original file foo is renamed to foo~ + echo usage: ${x} [-d] files... + echo " -d decompress the executables" + exit 1 +fi + +set -C +tmp=gz$$ +trap "rm -f $tmp; exit 1" HUP INT QUIT TRAP USR1 PIPE TERM +: > $tmp || exit 1 + +decomp=0 +res=0 +test "$x" = "ungzexe" && decomp=1 +if test "x$1" = "x-d"; then + decomp=1 + shift +fi + +echo hi > zfoo1$$ || exit 1 +echo hi > zfoo2$$ || exit 1 +if test -z "`(${CPMOD-cpmod} zfoo1$$ zfoo2$$) 2>&1`"; then + cpmod=${CPMOD-cpmod} +fi +rm -f zfoo[12]$$ + +tail="" +IFS="${IFS= }"; saveifs="$IFS"; IFS="${IFS}:" +for dir in $PATH; do + test -z "$dir" && dir=. + if test -f $dir/tail; then + tail="$dir/tail" + break + fi +done +IFS="$saveifs" +if test -z "$tail"; then + echo cannot find tail + exit 1 +fi +case `echo foo | $tail -n +1 2>/dev/null` in +foo) tail="$tail -n";; +esac + +for i do + if test ! -f "$i" ; then + echo ${x}: $i not a file + res=1 + continue + fi + if test $decomp -eq 0; then + if sed -e 1d -e 2q "$i" | grep "^skip=[0-9]*$" >/dev/null; then + echo "${x}: $i is already gzexe'd" + continue + fi + fi + if ls -l "$i" | grep '^...[sS]' > /dev/null; then + echo "${x}: $i has setuid permission, unchanged" + continue + fi + if ls -l "$i" | grep '^......[sS]' > /dev/null; then + echo "${x}: $i has setgid permission, unchanged" + continue + fi + case "`basename $i`" in + bzip2 | tail | sed | chmod | ln | sleep | rm) + echo "${x}: $i would depend on itself"; continue ;; + esac + if test -z "$cpmod"; then + cp -p "$i" $tmp 2>/dev/null || cp "$i" $tmp + if test -w $tmp 2>/dev/null; then + writable=1 + else + writable=0 + chmod u+w $tmp 2>/dev/null + fi + : >| $tmp # truncate the file, ignoring set -C + fi + if test $decomp -eq 0; then + sed 1q $0 >> $tmp + sed "s|^if tail|if $tail|" >> $tmp <<'EOF' +skip=23 +set -C +umask=`umask` +umask 77 +tmpfile=`tempfile -p gztmp -d /tmp` || exit 1 +if tail +$skip "$0" | /usr/bin/bzip2 -cd >> $tmpfile; then + umask $umask + /bin/chmod 700 $tmpfile + prog="`echo $0 | /bin/sed 's|^.*/||'`" + if /bin/ln $tmpfile "/tmp/$prog" 2>/dev/null; then + trap '/bin/rm -f $tmpfile "/tmp/$prog"; exit $res' 0 + (/bin/sleep 5; /bin/rm -f $tmpfile "/tmp/$prog") 2>/dev/null & + /tmp/"$prog" ${1+"$@"}; res=$? + else + trap '/bin/rm -f $tmpfile; exit $res' 0 + (/bin/sleep 5; /bin/rm -f $tmpfile) 2>/dev/null & + $tmpfile ${1+"$@"}; res=$? + fi +else + echo Cannot decompress $0; exit 1 +fi; exit $res +EOF + bzip2 -cv9 "$i" >> $tmp || { + /bin/rm -f $tmp + echo ${x}: compression not possible for $i, file unchanged. + res=1 + continue + } + + else + # decompression + skip=23 + if sed -e 1d -e 2q "$i" | grep "^skip=[0-9]*$" >/dev/null; then + eval `sed -e 1d -e 2q "$i"` + fi + if tail +$skip "$i" | bzip2 -cd > $tmp; then + : + else + echo ${x}: $i probably not in gzexe format, file unchanged. + res=1 + continue + fi + fi + rm -f "$i~" + mv "$i" "$i~" || { + echo ${x}: cannot backup $i as $i~ + rm -f $tmp + res=1 + continue + } + mv $tmp "$i" || cp -p $tmp "$i" 2>/dev/null || cp $tmp "$i" || { + echo ${x}: cannot create $i + rm -f $tmp + res=1 + continue + } + rm -f $tmp + if test -n "$cpmod"; then + $cpmod "$i~" "$i" 2>/dev/null + elif test $writable -eq 0; then + chmod u-w $i 2>/dev/null + fi +done +exit $res --- bzip2-1.0.2.orig/debian/docbase +++ bzip2-1.0.2/debian/docbase @@ -0,0 +1,19 @@ +Document: bzip2 +Title: bzip2 and libbzip2: a program and library for data compression +Author: Julian Seward +Abstract: bzip2 compresses files using the Burrows-Wheeler block-sorting + text compression algorithm, and Huffman coding. Compression is generally + considerably better than that achieved by more conventional + LZ77/LZ78-based compressors, and approaches the performance of the PPM + family of statistical compressors. +Section: Apps/Tools + +Format: html +Index: /usr/share/doc/bzip2/manual_toc.html +Files: /usr/share/doc/bzip2/manual_*.html + +Format: postscript +Files: /usr/share/doc/bzip2/manual.ps.gz + +Format: texinfo +Files: /usr/share/doc/bzip2/manual.texi.gz --- bzip2-1.0.2.orig/debian/copyright.in +++ bzip2-1.0.2/debian/copyright.in @@ -0,0 +1,22 @@ +This package (bzip2) was created by Philippe Troin . +It is currently mantained by +Anibal Monsalve Salazar . +This package is Copyright (C) 1999, 2000, 2001, 2002 Philippe Troin + and Copyright (C) 2004 Anibal Monsalve Salazar +It is licensed under the GNU General Public License +which can be found in /usr/share/common-licenses/GPL. + +It was downloaded from + ftp://sources.redhat.com/pub/bzip2/ + +For more informatino about bzip2, please visit: + http://sources.redhat.com/bzip2/ + +Note: + The archive file format of bzip2 (.bz2) is incompatible with that of its + predecessor, bzip (.bz). + +Author: + Julian Seward + +Copyright: (from LICENSE) --- bzip2-1.0.2.orig/debian/prerm-dev +++ bzip2-1.0.2/debian/prerm-dev @@ -0,0 +1,8 @@ +#!/bin/sh +set -eu + +# FHS +pkg=libbz2-dev +if ( [ "$1" = "upgrade" ] || [ "$1" = "remove" ] ) && [ -L /usr/doc/$pkg ]; then + rm -f /usr/doc/$pkg +fi --- bzip2-1.0.2.orig/debian/prerm-lib +++ bzip2-1.0.2/debian/prerm-lib @@ -0,0 +1,8 @@ +#!/bin/sh +set -eu + +# FHS +pkg=libbz2-1.0 +if ( [ "$1" = "upgrade" ] || [ "$1" = "remove" ] ) && [ -L /usr/doc/$pkg ]; then + rm -f /usr/doc/$pkg +fi --- bzip2-1.0.2.orig/debian/prerm-run +++ bzip2-1.0.2/debian/prerm-run @@ -0,0 +1,16 @@ +#!/bin/sh +set -eu + +# Docbase +if command -v install-docs >/dev/null 2>&1; then + install-docs -r bzip2 +fi + +# Info +install-info --quiet --remove /usr/share/info/bzip2.info + +# FHS +pkg=bzip2 +if ( [ "$1" = "upgrade" ] || [ "$1" = "remove" ] ) && [ -L /usr/doc/$pkg ]; then + rm -f /usr/doc/$pkg +fi --- bzip2-1.0.2.orig/debian/preinst-run +++ bzip2-1.0.2/debian/preinst-run @@ -0,0 +1,20 @@ +#!/bin/sh +set -eu + +# If and only if we are uprading from a version lower than 0.9.5d-3, +# then we want to break the old /usr/share/doc/libbz2 symlink (which was +# pointing to libbz2). +if [ "$1" = "upgrade" ] && dpkg --compare-versions "$2" "<<" "0.9.5d-3" +then + if test -L /usr/share/doc/bzip2 + then + rm -f /usr/share/doc/bzip2 + fi +fi + +# And we should never ever have a directory in /usr/doc/bzip2 +if [ -d /usr/doc/bzip2 ] && [ ! -L /usr/doc/bzip2 ] +then + echo "Cleaning up left-over /usr/doc/bzip2." + rm -fr /usr/doc/bzip2 +fi --- bzip2-1.0.2.orig/debian/postinst-dev +++ bzip2-1.0.2/debian/postinst-dev @@ -0,0 +1,10 @@ +#!/bin/sh +set -eu + +# FHS +#pkg=libbz2-dev +#if [ "$1" = "configure" ]; then +# if [ -d /usr/doc ] && [ ! -e /usr/doc/$pkg ] && [ -d /usr/share/doc/$pkg ]; then +# ln -sf ../share/doc/$pkg /usr/doc/$pkg +# fi +#fi --- bzip2-1.0.2.orig/debian/postinst-lib +++ bzip2-1.0.2/debian/postinst-lib @@ -0,0 +1,15 @@ +#!/bin/sh +set -eu + +# Ldconfig +if [ "$1" = "configure" ]; then + ldconfig +fi + +# FHS +#pkg=libbz2-1.0 +#if [ "$1" = "configure" ]; then +# if [ -d /usr/doc ] && [ ! -e /usr/doc/$pkg ] && [ -d /usr/share/doc/$pkg ]; then +# ln -sf ../share/doc/$pkg /usr/doc/$pkg +# fi +#fi --- bzip2-1.0.2.orig/debian/postinst-run +++ bzip2-1.0.2/debian/postinst-run @@ -0,0 +1,24 @@ +#!/bin/sh +set -eu + +# Doc base +if [ "$1" = "configure" ] ; then +# if command -v install-docs >/dev/null 2>&1; then +# install-docs -i /usr/share/doc-base/bzip2 +# fi + if test -x /usr/sbin/install-docs >/dev/null 2>&1; then + /usr/sbin/install-docs -i /usr/share/doc-base/bzip2 + fi +fi + +# Info +install-info --quiet --section "General Commands" "General Commands" \ + /usr/share/info/bzip2.info + +# FHS +#pkg=bzip2 +#if [ "$1" = "configure" ]; then +# if [ -d /usr/doc ] && [ ! -e /usr/doc/$pkg ] && [ -d /usr/share/doc/$pkg ]; then +# ln -sf ../share/doc/$pkg /usr/doc/$pkg +# fi +#fi --- bzip2-1.0.2.orig/debian/shlibs +++ bzip2-1.0.2/debian/shlibs @@ -0,0 +1 @@ +libbz2 1.0 libbz2-1.0 --- bzip2-1.0.2.orig/debian/postrm-lib +++ bzip2-1.0.2/debian/postrm-lib @@ -0,0 +1,7 @@ +#!/bin/sh +set -eu + +# Ldconfig +if [ "$1" = "remove" ]; then + ldconfig +fi --- bzip2-1.0.2.orig/debian/changelog +++ bzip2-1.0.2/debian/changelog @@ -0,0 +1,346 @@ +bzip2 (1.0.2-10ubuntu1) dapper; urgency=low + + * Resynchronise with Debian. + - Still generate 64 bit packages + + -- Tollef Fog Heen Thu, 10 Nov 2005 15:21:50 +0100 + +bzip2 (1.0.2-10) unstable; urgency=low + + * Fixed "libbz2-1.0: broken .shlibs file", closes #330637. + + -- Anibal Monsalve Salazar Thu, 29 Sep 2005 13:04:47 +1000 + +bzip2 (1.0.2-9) unstable; urgency=low + + * Acknowledge NMU, closes: #321286. + * Fixed dependency problem, closes: #330003. + + -- Anibal Monsalve Salazar Mon, 26 Sep 2005 23:26:55 +1000 + +bzip2 (1.0.2-8.1) unstable; urgency=low + + * NMU + * Patch from Martin Pitt to bzgrep, to properly quote characters that can + break out of the generated sed command, in analogy to the recent zgrep + fix. Fixes CAN-2005-0758. Closes: #321286 + + -- Joey Hess Sun, 4 Sep 2005 16:09:03 -0400 + +bzip2 (1.0.2-8) unstable; urgency=low + + * Fixed priority disparity. Changed priority from standard to important. + * Fixed "libbz2-1.0: missing symlink", closes: #320012. + * Changed upstream homepage, added new uploader. + * Changed Standards-Version to 3.6.2. + + -- Anibal Monsalve Salazar Sat, 30 Jul 2005 22:16:25 +1000 + +bzip2 (1.0.2-7ubuntu2) breezy; urgency=low + + * Build 64bit packages to replace amd64-libs. + * Build 32bit packages on amd64 (currently disabled). + + -- Matthias Klose Fri, 12 Aug 2005 16:39:17 +0200 + +bzip2 (1.0.2-7ubuntu1) breezy; urgency=low + + * SECURITY UPDATE: Fix shell command injection. + * bzgrep: Properly quote characters that can break out of the generated sed + command, in analogy to the recent zgrep fix. + * CAN-2005-0758 + + -- Martin Pitt Thu, 4 Aug 2005 18:46:52 +0200 + +bzip2 (1.0.2-7) unstable; urgency=high + + * Fixed "CAN-2005-1260 decompression bomb vulnerability", closes: #310803. + Patch by Martin Pitt . + * Fixed "Example provided in documentation causes data loss", closes: + #293581. Patch by Adam Borowski . + + -- Anibal Monsalve Salazar Sat, 28 May 2005 14:05:46 +1000 + +bzip2 (1.0.2-6) unstable; urgency=high + + * Fixed RC bug "file permissions modification race (CAN-2005-0953)", closes: + #303300. Patch by Santiago Ruano Rincon . + Original patch available at + http://marc.theaimsgroup.com/?l=bugtraq&m=111352423504277&w=2 + + -- Anibal Monsalve Salazar Wed, 04 May 2005 17:13:20 +1000 + +bzip2 (1.0.2-5) unstable; urgency=low + + * Fixed "missing opening bracket in libbz2-dev.prerm" (Closes: #293673, + #294663). Patches by Joshua Kwan and + Jeremy Laine . + * Fixed "uses #!/bin/sh and command -v" (Closes: #292965). + + -- Anibal Monsalve Salazar Sat, 12 Feb 2005 15:33:23 +1100 + +bzip2 (1.0.2-4) unstable; urgency=low + + * Put back hardlinks for + /usr/bin/{bunzip2,bzcat,bzcmp,bzegrep,bzfgrep,bzless} + * Created script bzexe and its manpage (Closes: #292485). + Patch by Seo Sanghyeon + * New maintainer's email address. + + -- Anibal Monsalve Salazar Wed, 02 Feb 2005 19:50:22 +1100 + +bzip2 (1.0.2-3) unstable; urgency=low + + * Fixed "Overly strict Depends (libc6-dev)" (Closes: #196264). + * Fixed "bzgrep munges filenames with '&' in them" (Closes: #231144). + * Fixed "bunzip2 -qt returns 0 for corrupt archives" (Closes: #279025). + * Fixed "bzip2 --version should exit with success" (Closes: #220374). + * Fixed "Several XSI:isms in package" (Closes: #256251). + Patch by David Weinehall + * Enable bzip2 to cross-build (Closes: #282036). + Patch by NIIBE Yutaka + * Fixed lintian warning "bzip2 libbz2-1.0 libbz2-dev binaries: + postinst-should-not-set-usr-doc-link". + * Fixed lintian warning "bzip2 binary: package-contains-hardlink + usr/bin/{bunzip2,bzcat,bzcmp,bzegrep,bzfgrep,bzless}". + + -- Anibal Monsalve Salazar Sun, 09 Jan 2005 21:48:21 +1100 + +bzip2 (1.0.2-2) unstable; urgency=high + + * New maintainer. + * Updated package to Policy 3.6.1.1. + * The package description does not follow Debian policy + (Closes: #209811, #210074). + + -- Anibal Monsalve Salazar Wed, 27 Oct 2004 06:35:59 +1000 + +bzip2 (1.0.2-1) unstable; urgency=low + + * New upstream version; closes: #132318. Most of our patches merged + upstream. + * Generate copyright automatically from debian/rules. + + -- Philippe Troin Wed, 6 Feb 2002 19:23:15 -0800 + +bzip2 (1.0.1-14) unstable; urgency=low + + * Set SHELL to bash in debian/rules so that we may use bashisms when + building bzip2 on boxes where /bin/sh != /bin/bash; closes: #116807. + + -- Philippe Troin Thu, 29 Nov 2001 15:08:32 -0800 + +bzip2 (1.0.1-13) unstable; urgency=low + + * Fixed upstream version detection in debian/rules. + * Cleanup left-over dhelp-induced /usr/doc/bzip2 in preinst; closes: #107233. + + -- Philippe Troin Mon, 6 Aug 2001 21:18:37 -0700 + +bzip2 (1.0.1-12) unstable; urgency=low + + * Set up the shlib file *before* running dpkg-shlibdeps to generate + correct dependencies for bzip2; closes: #105264. + + -- Philippe Troin Sat, 14 Jul 2001 19:39:07 -0700 + +bzip2 (1.0.1-11) unstable; urgency=low + + * Added support for DEB_BUILD_OPTIONS. + * Added support for debian/rules get-orig-source. + * Ldconfig on postrm and remove per policy. + * Upgraded to policy 3.5.5.0. + + -- Philippe Troin Thu, 12 Jul 2001 18:44:40 -0700 + +bzip2 (1.0.1-10) unstable; urgency=low + + * Fix the /usr/doc compatibility symlink; closes: #102450. + + -- Philippe Troin Mon, 2 Jul 2001 12:25:54 -0700 + +bzip2 (1.0.1-9) unstable; urgency=low + + * Stripping libz2.a does not remove the .comment and .note sections + since this is non portable and more stripping will be needed anyways + after building executables; closes: #95601. + + -- Philippe Troin Sat, 28 Apr 2001 17:00:41 -0700 + +bzip2 (1.0.1-8) unstable; urgency=low + + * Bzip2 -d -f now clobbers output file; closes: #95371. + + -- Philippe Troin Thu, 26 Apr 2001 13:21:02 -0700 + +bzip2 (1.0.1-7) unstable; urgency=low + + * Spelling correction in bzip2.1 manpage; closes: #89315. + * Bzmore manpage comment fix; closes: #90713. + * Added --fast and --best; closes: #92203. + * Remove .note and .comment sections to make lintian happy. + + -- Philippe Troin Tue, 24 Apr 2001 14:46:59 -0700 + +bzip2 (1.0.1-6) unstable; urgency=low + + * Build-depends on texinfo; closes: #88363. + + -- Philippe Troin Sun, 4 Mar 2001 17:16:53 -0800 + +bzip2 (1.0.1-5) unstable; urgency=low + + * Include stdio.h in bzlib.h unconditionnaly; closes: #84096. + + -- Philippe Troin Mon, 29 Jan 2001 22:37:04 -0800 + +bzip2 (1.0.1-4) unstable; urgency=low + + * Fix the test for shell script stripping; closes: #83236. + + -- Philippe Troin Tue, 23 Jan 2001 10:34:21 -0800 + +bzip2 (1.0.1-3) unstable; urgency=low + + * -f really overwrites files (this was introduced in 1.0.1-1 when we + changed the fopen call to be safer with O_EXCL); closes: #81277. + * No more complaints when attempting to uncompress directories if -q + flag is specified; closes #81672. + * Added bz{more,less,{e,f,}grep,diff,cmp} wrapper scripts; + closes: #81113, #69621. + + -- Philippe Troin Sat, 20 Jan 2001 17:51:39 -0800 + +bzip2 (1.0.1-2) unstable; urgency=low + + * Allow shell metacharacters in filenames; closes: #74961. + + -- Philippe Troin Tue, 17 Oct 2000 11:19:55 -0700 + +bzip2 (1.0.1-1) unstable; urgency=low + + * New upstream version; closes: #64269, #72324. + * The new upstream version has a better message when catching a fatal + signal; closes: #58688. + * Versionned replaces for libbz2 and libzz2-dev. + * Fixed unsafe race condition in opening output files (closes: #56386). + Patch provided by Colin Phipps . + * Updated copyright file, fixed URL; closes: #64270, #64271. + * Don't give statistics when no bytes were compressed; closes: #68932. + * Make bzcat and bzip2 -d cat the file if the -f option is set; + closes: #65391. + * Added sections and priorities to packages. + * Bumped standards-version to 3.2.1.0. + * Moved back the ldconfig from the bzip2 postinst to the library + postinst (crept therein 0.9.5d-3). + + -- Philippe Troin Sun, 1 Oct 2000 22:34:39 -0700 + +bzip2 (0.9.5d-3) unstable; urgency=low + + * Moved the bzip2 documentation from the library package to the binary + package in order to roll out bzip2 1.0.x. + + -- Philippe Troin Wed, 13 Sep 2000 23:14:22 -0700 + +bzip2 (0.9.5d-2) unstable; urgency=low + + * Libbz2 and libzz2-dev now replaces bzip2 (overwrite bzip2's files...) + + -- Philippe Troin Sat, 16 Oct 1999 15:51:23 -0700 + +bzip2 (0.9.5d-1) unstable; urgency=low + + * New maintainer. + * New upstream release; closes: #41658, #43557. + * Shared library compiled with -D_REENTRANT. + * Splitted out shared library to new package. + * Binary now linked with shlib. + * Fixed shlibs file; closes: #43656. + * Bzcat now has a manpage; closes: #17604. + + -- Philippe Troin Fri, 15 Oct 1999 18:08:16 -0700 + +bzip2 (0.9.5c-1) unstable; urgency=low + + * New upstream release (closes: Bug#41217). + * bz2cat is no more. Use bzcat instead, as per upstream. + * Updated to Standards-Version 3.0.1: + - Man pages are placed in /usr/share/man. + - debian/copyright now points to /usr/share/common-licenses/GPL + instead of /usr/doc/copyright/GPL + * The bzip2 Home Page is now at http://www.bzip2.org/. + * Thanks to the patch from "Sean 'Shaleh' Perry" , + a shared libbz2 library is here! (closes: Bug#27517, Bug#40804) + + -- Anthony Fok Wed, 25 Aug 1999 00:46:06 -0600 + +bzip2 (0.9.0c-2) frozen unstable; urgency=low + + * Now registers bzip2's HTML and PS manual with doc-base. + Thanks to the suggestion from Wichert Akkerman + (closes: Bug#31166). + + -- Anthony Fok Sun, 27 Dec 1998 00:01:30 -0700 + +bzip2 (0.9.0c-1) frozen unstable; urgency=low + + * New upstream bugfix release. + * [debian/control]: Upgraded to standards version 2.5.0.0 (no changes). + + -- Anthony Fok Sat, 28 Nov 1998 21:36:04 -0700 + +bzip2 (0.9.0-1) unstable; urgency=low + + * New upstream release. + * [debian/rules]: + - bzcat and bz2cat are now both hard-linked to bzip2. + - Likewise, added symlinks bzcat.1.gz and bz2cat1.gz to bzip2.1.gz. + - Install new upstream bzip2 manual.ps and manual*.html. + - Install new upstream /usr/lib/libbz2.a and /usr/include/bzlib.h. + * [debian/copyright]: Replaced the "Copyright" section with the new + BSD-style license found in ./LICENSE. + + -- Anthony Fok Tue, 8 Sep 1998 00:28:02 -0600 + +bzip2 (0.1pl2-5) frozen unstable; urgency=low + + * Removed dh_du from debian/rules. + (Fixed Lintian error: unknown-control-file du) + * Upgraded to standards version 2.4.1.0 (no changes). + * Fixed Lintian error: copyright-refers-to-compressed-license + usr/doc/copyright/GPL.gz + * Removed the note about bzip2's magic numbers in README.Debian. + The new Debian `file' package already includes them. :-) + + -- Anthony Fok Mon, 11 May 1998 05:11:50 -0600 + +bzip2 (0.1pl2-4) unstable; urgency=low + + * Now provides bz2cat, thanks to suggestions from John Goerzen + and Joel Klecker . + (fixes: bug#17222, bug#17484) + * /usr/bin/bunzip2 is now hardlinked to /usr/bin/bzip2. + + -- Anthony Fok Wed, 28 Jan 1998 00:35:52 -0700 + +bzip2 (0.1pl2-3) unstable; urgency=low + + * Updated Standards-Version to 2.3.0.1. + * Revised debian/rules. + * Added a note in README.Debian about some suggested bzip2 magic numbers. + * Changed my maintainer e-mail address to . :) + + -- Anthony Fok Tue, 6 Jan 1998 01:41:15 -0700 + +bzip2 (0.1pl2-2) unstable; urgency=low + + * Added md5sums, thanks to the new debhelper-0.10. + + -- Anthony Fok Tue, 21 Oct 1997 02:06:51 -0600 + +bzip2 (0.1pl2-1) unstable; urgency=low + + * Initial Release. + + -- Anthony Fok Sat, 11 Oct 1997 16:52:07 -0600 --- bzip2-1.0.2.orig/debian/control +++ bzip2-1.0.2/debian/control @@ -0,0 +1,114 @@ +Source: bzip2 +Section: utils +Priority: important +Maintainer: Anibal Monsalve Salazar +Standards-Version: 3.6.1.1 +Build-depends: texinfo, libc6-dev-sparc64 [sparc], libc6-dev-s390x [s390], libc6-dev-ppc64 [powerpc], libc6-dev-i386 [amd64] | ia32-libs-dev [amd64], libc6-dev-amd64 [i386], lib64gcc1 [i386 powerpc sparc s390], lib32gcc1 [amd64] + +Package: libbz2-1.0 +Priority: important +Section: libs +Architecture: any +Depends: ${shlibs:Depends} +Suggests: libbz2-dev, bzip2 +Description: high-quality block-sorting file compressor library - runtime + This package contains libbzip2 which is used by the bzip2 compressor. + . + bzip2 is a freely available, patent free, high-quality data compressor. + It typically compresses files to within 10% to 15% of the best available + techniques, whilst being around twice as fast at compression and six + times faster at decompression. + . + bzip2 compresses files using the Burrows-Wheeler block-sorting text + compression algorithm, and Huffman coding. Compression is generally + considerably better than that achieved by more conventional + LZ77/LZ78-based compressors, and approaches the performance of the PPM + family of statistical compressors. + . + The archive file format of bzip2 (.bz2) is incompatible with that of its + predecessor, bzip (.bz). + . + Homepage: http://www.bzip.org/ + +Package: libbz2-dev +Priority: optional +Section: libdevel +Architecture: any +Depends: libbz2-1.0(=${Source-Version}), libc6-dev | libc-dev +Replaces: bzip2(<<0.9.5d-3) +Description: high-quality block-sorting file compressor library - development + Static libraries and include files for the bzip2 compressor library. + . + bzip2 is a freely available, patent free, high-quality data compressor. + It typically compresses files to within 10% to 15% of the best available + techniques, whilst being around twice as fast at compression and six + times faster at decompression. + . + bzip2 compresses files using the Burrows-Wheeler block-sorting text + compression algorithm, and Huffman coding. Compression is generally + considerably better than that achieved by more conventional + LZ77/LZ78-based compressors, and approaches the performance of the PPM + family of statistical compressors. + . + The archive file format of bzip2 (.bz2) is incompatible with that of its + predecessor, bzip (.bz). + . + Homepage: http://www.bzip.org/ + +Package: bzip2 +Priority: optional +Section: utils +Architecture: any +Depends: libbz2-1.0 (=${Source-Version}) +Replaces: libbz2(<<0.9.5d-3) +Description: high-quality block-sorting file compressor - utilities + bzip2 is a freely available, patent free, high-quality data compressor. + It typically compresses files to within 10% to 15% of the best available + techniques, whilst being around twice as fast at compression and six + times faster at decompression. + . + bzip2 compresses files using the Burrows-Wheeler block-sorting text + compression algorithm, and Huffman coding. Compression is generally + considerably better than that achieved by more conventional + LZ77/LZ78-based compressors, and approaches the performance of the PPM + family of statistical compressors. + . + The archive file format of bzip2 (.bz2) is incompatible with that of its + predecessor, bzip (.bz). + . + Homepage: http://www.bzip.org/ + +Package: lib64bz2-1.0 +Priority: optional +Section: libs +Architecture: i386 powerpc sparc s390 +Depends: ${shlibs:Depends} +Conflicts: amd64-libs +Description: high-quality block-sorting file compressor library - 64bit runtime + This package contains the libbzip2 64bit runtime library. + +Package: lib64bz2-dev +Priority: optional +Section: libdevel +Architecture: i386 powerpc sparc s390 +Depends: lib64bz2-1.0 (=${Source-Version}), libbz2-dev (=${Source-Version}), ${dev:Depends} +Description: high-quality block-sorting file compressor library - 64bit development + Static libraries and include files for the bzip2 compressor library (64bit). + +Package: lib32bz2-1.0 +Priority: optional +Section: libs +Architecture: amd64 ppc64 +Depends: ${shlibs:Depends} +Replaces: ia32-libs +Description: high-quality block-sorting file compressor library - 32bit runtime + This package contains the libbzip2 32bit runtime library. + +Package: lib32bz2-dev +Priority: optional +Section: libdevel +Architecture: amd64 ppc64 +Depends: lib32bz2-1.0 (=${Source-Version}), libbz2-dev (=${Source-Version}), ${dev:Depends} +Replaces: ia32-libs-dev +Description: high-quality block-sorting file compressor library - 32bit development + Static libraries and include files for the bzip2 compressor library (32bit). --- bzip2-1.0.2.orig/debian/rules +++ bzip2-1.0.2/debian/rules @@ -0,0 +1,346 @@ +#!/usr/bin/make -f +# debian/rules file for building the Debian GNU/Linux package bzip2. +# Copyright (C) 2004-2005 Anibal Monsalve Salazar + +SHELL = /bin/bash +package = bzip2 + +testdir=test -x debian/rules && test -f bzip2.c +testroot=test "`id -nu`" = root + +DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) +DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH) + +DEBCFLAGS:= +DEBSTRIP:=strip +WGET=wget +ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) +DEBCFLAGS += -g +endif +ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) +DEBSTRIP:=: +endif + +DEBVERSION:=$(shell head -n 1 debian/changelog \ + | sed -e 's/^[^(]*(\([^)]*\)).*/\1/') +UPVERSION:=$(shell echo $(DEBVERSION) | sed -e 's/-[0-9.]*$$//') + +ifneq (,$(findstring /$(DEB_HOST_ARCH)/,/i386/powerpc/sparc/s390/)) + build64-stamp := build64-stamp + CC64=gcc -m64 +endif +ifeq ($(DEB_HOST_ARCH),i386) + CC64 += -march=x86-64 -mtune=x86-64 +endif + +#ifneq (,$(findstring /$(DEB_HOST_ARCH)/,/amd64/ppc64/)) +# build32-stamp := build32-stamp +#endif + +build: build-stamp $(build32-stamp) $(build64-stamp) +build-stamp: + $(testdir) + # Add here commands to compile the package. + $(MAKE) DEBCFLAGS="$(DEBCFLAGS)" +ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) + $(MAKE) DEBCFLAGS="$(DEBCFLAGS)" test +endif + makeinfo manual.texi + cat debian/copyright.in LICENSE > debian/copyright + touch build-stamp + +build32: build32-stamp +build32-stamp: + $(testdir) + rm -rf 32 + mkdir 32 + cp -p *.h *.c Makefile 32/ + $(MAKE) -C 32 CC="gcc -m32" DEBCFLAGS="$(DEBCFLAGS)" + touch build32-stamp + +build64: build64-stamp +build64-stamp: + $(testdir) + rm -rf 64 + mkdir 64 + cp -p *.h *.c Makefile 64/ + $(MAKE) -C 64 CC="$(CC64)" DEBCFLAGS="$(DEBCFLAGS)" + touch build64-stamp + + +clean: + $(testdir) + rm -f build*-stamp + -$(MAKE) clean + rm -rf 32 64 + rm -f debian/substvars debian/files debian/copyright bzip2.info* + rm -fr debian/tmp* + find . -name "*~" -print0 | xargs -r0 rm -f + +# Build architecture-independent files here. +binary-indep: build +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build + $(testdir) + $(testroot) + rm -fr debian/tmp* + install -d debian/tmp/usr + + $(MAKE) PREFIX=`pwd`/debian/tmp/usr install + + ### Split + + # Development package + install -d debian/tmp-dev/usr/lib + mv debian/tmp/usr/lib/libbz2.{a,so} debian/tmp-dev/usr/lib/ + mv debian/tmp/usr/include debian/tmp-dev/usr/include + + # Library package + install -d debian/tmp-lib/usr/lib + for i in $$(ls debian/tmp/usr/lib/libbz2.so* | sort -r); do \ + (set -x; mv $$i debian/tmp-lib/usr/lib/); \ + done + ln -s libbz2.so.1.0.2 debian/tmp-lib/usr/lib/libbz2.so.1 + chmod -x debian/tmp-lib/usr/lib/* + + # Binary package + install -d debian/tmp-run/usr + mv debian/tmp/usr/bin debian/tmp-run/usr/bin + install -d debian/tmp-run/usr/share + mv debian/tmp/usr/man debian/tmp-run/usr/share/man + + ### Check the install hier + test "$$(find debian/tmp ! -type d -print | wc -l)" -eq 0 + rm -fr debian/tmp + + ### Finalize documentation + + # Man pages + gzip -v9 debian/tmp-run/usr/share/man/man1/*.1 + ( cd debian/tmp-run/usr/share/man/man1 && \ + for i in bunzip2 bzcat bzip2recover; do \ + ln -s bzip2.1.gz $$i.1.gz; \ + done ) + + # Info + install -d debian/tmp-run/usr/share/info + cp bzip2.info* debian/tmp-run/usr/share/info/ + gzip -v9 debian/tmp-run/usr/share/info/* + + # Other docs in lib package + install -d debian/tmp-run/usr/share/doc/bzip2 + cp *.ps *.html *.texi debian/tmp-run/usr/share/doc/bzip2 + gzip -v9 debian/tmp-run/usr/share/doc/bzip2/*.{ps,texi} + cp CHANGES debian/tmp-run/usr/share/doc/bzip2/changelog + cp debian/changelog \ + debian/tmp-run/usr/share/doc/bzip2/changelog.Debian + gzip -v9 debian/tmp-run/usr/share/doc/bzip2/changelog* + cp debian/copyright debian/tmp-run/usr/share/doc/bzip2/ + + # Doc-base support + install -d debian/tmp-run/usr/share/doc-base + cp debian/docbase debian/tmp-run/usr/share/doc-base/bzip2 + + # Library package + install -d debian/tmp-lib/usr/share/doc/libbz2-1.0 + cp debian/copyright debian/tmp-lib/usr/share/doc/libbz2-1.0/ + cp CHANGES debian/tmp-lib/usr/share/doc/libbz2-1.0/changelog + cp debian/changelog \ + debian/tmp-lib/usr/share/doc/libbz2-1.0/changelog.Debian + gzip -v9 debian/tmp-lib/usr/share/doc/libbz2-1.0/changelog* + + # Other packages point to libbz2-1.0 + install -d debian/tmp-dev/usr/share/doc + ln -s libbz2-1.0 debian/tmp-dev/usr/share/doc/libbz2-dev + + ### Package finalize + + # Stripping + for i in debian/tmp-run/usr/bin/*; \ + do \ + if head -n 1 $$i | grep -vq '^#!'; \ + then \ + (set -x; $(DEBSTRIP) -R .note -R .comment $$i); \ + fi; \ + done + $(DEBSTRIP) --strip-unneeded -R .note -R .comment \ + debian/tmp-lib/usr/lib/*.so* + $(DEBSTRIP) --strip-debug debian/tmp-dev/usr/lib/*.a + + # Control files + install -d debian/tmp-{lib,dev,run}/DEBIAN + cp debian/shlibs debian/tmp-lib/DEBIAN/shlibs + + dpkg-shlibdeps debian/tmp-lib/usr/lib/*.so* + dpkg-gencontrol -isp -Pdebian/tmp-lib -plibbz2-1.0 + rm debian/substvars + dpkg-gencontrol -isp -Pdebian/tmp-dev -plibbz2-dev + dpkg-shlibdeps debian/tmp-run/usr/bin/* + dpkg-gencontrol -isp -Pdebian/tmp-run -pbzip2 + + for i in run dev lib; do \ + cp debian/postinst-$$i debian/tmp-$$i/DEBIAN/postinst; \ + cp debian/prerm-$$i debian/tmp-$$i/DEBIAN/prerm; \ + chmod +x debian/tmp-$$i/DEBIAN/postinst; \ + chmod +x debian/tmp-$$i/DEBIAN/prerm; \ + done + cp debian/preinst-run debian/tmp-run/DEBIAN/preinst + cp debian/postrm-lib debian/tmp-lib/DEBIAN/postrm + chmod +x debian/tmp-run/DEBIAN/preinst debian/tmp-lib/DEBIAN/postrm + + # Fix perms + chown -R root.root debian/tmp* + chmod -R a+rX-wts,u+w debian/tmp* + + # Buildit + dpkg --build debian/tmp-run .. + dpkg --build debian/tmp-lib .. + dpkg --build debian/tmp-dev .. + +ifneq (,$(build64-stamp)) + rm -rf debian/tmp-lib64 + rm -rf debian/tmp-dev64 + + install -d debian/tmp-lib64/usr/lib64 + cp -a 64/libbz2.so.* debian/tmp-lib64/usr/lib64/ + chmod -x debian/tmp-lib64/usr/lib64/* + + install -d debian/tmp-dev64/usr/lib64 + cp -a 64/libbz2.so 64/libbz2.a debian/tmp-dev64/usr/lib64/ + chmod -x debian/tmp-dev64/usr/lib64/* + + install -d debian/tmp-lib64/usr/share/doc/lib64bz2-1.0 + cp debian/copyright debian/tmp-lib64/usr/share/doc/lib64bz2-1.0/ + cp debian/changelog \ + debian/tmp-lib64/usr/share/doc/lib64bz2-1.0/changelog.Debian + gzip -v9 debian/tmp-lib64/usr/share/doc/lib64bz2-1.0/changelog* + + install -d debian/tmp-dev64/usr/share/doc + ln -s lib64bz2-1.0 debian/tmp-dev64/usr/share/doc/lib64bz2-dev + + $(DEBSTRIP) --strip-unneeded -R .note -R .comment \ + debian/tmp-lib64/usr/lib64/*.so* + $(DEBSTRIP) --strip-debug debian/tmp-dev64/usr/lib64/*.a + + install -d debian/tmp-{lib,dev}64/DEBIAN + /bin/echo -e 'libbz2\t1.0\tlib64bz2-1.0' > debian/tmp-lib64/DEBIAN/shlibs + + -dpkg-shlibdeps debian/tmp-lib/usr/lib64/*.so* +ifeq ($(DEB_HOST_ARCH),i386) + echo 'shlibs:Depends=libc6-amd64' > debian/substvars +endif +ifeq ($(DEB_HOST_ARCH),powerpc) + echo 'shlibs:Depends=libc6-ppc64' > debian/substvars +endif +#ifeq ($(DEB_HOST_ARCH),s390) +# echo 'shlibs:Depends=libc6-s390x' > debian/substvars +#endif +#ifeq ($(DEB_HOST_ARCH),sparc) +# echo 'shlibs:Depends=libc6-sparc64' > debian/substvars +#endif + dpkg-gencontrol -isp -Pdebian/tmp-lib64 -plib64bz2-1.0 + rm -f debian/substvars + +ifeq ($(DEB_HOST_ARCH),i386) + echo 'dev:Depends=libc6-dev-amd64' > debian/substvars +endif +ifeq ($(DEB_HOST_ARCH),powerpc) + echo 'dev:Depends=libc6-dev-ppc64' > debian/substvars +endif +ifeq ($(DEB_HOST_ARCH),s390) + echo 'dev:Depends=libc6-dev-s390x' > debian/substvars +endif +ifeq ($(DEB_HOST_ARCH),sparc) + echo 'dev:Depends=libc6-dev-sparc64' > debian/substvars +endif + dpkg-gencontrol -isp -Pdebian/tmp-dev64 -plib64bz2-dev + + for i in dev lib; do \ + cp debian/postinst-$$i debian/tmp-$${i}64/DEBIAN/postinst; \ + cp debian/prerm-$$i debian/tmp-$${i}64/DEBIAN/prerm; \ + chmod +x debian/tmp-$${i}64/DEBIAN/postinst; \ + chmod +x debian/tmp-$${i}64/DEBIAN/prerm; \ + done + + chown -R root.root debian/tmp*64 + chmod -R a+rX-wts,u+w debian/tmp*64 + + dpkg --build debian/tmp-lib64 .. + dpkg --build debian/tmp-dev64 .. +endif + +ifneq (,$(build32-stamp)) + rm -rf debian/tmp-lib32 + rm -rf debian/tmp-dev32 + + install -d debian/tmp-lib32/usr/lib32 + cp -a 32/libbz2.so.* debian/tmp-lib32/usr/lib32/ + chmod -x debian/tmp-lib32/usr/lib32/* + + install -d debian/tmp-dev32/usr/lib32 + cp -a 32/libbz2.so 32/libbz2.a debian/tmp-dev32/usr/lib32/ + chmod -x debian/tmp-dev32/usr/lib32/* + + install -d debian/tmp-lib32/usr/share/doc/lib32bz2-1.0 + cp debian/copyright debian/tmp-lib32/usr/share/doc/lib32bz2-1.0/ + cp debian/changelog \ + debian/tmp-lib32/usr/share/doc/lib32bz2-1.0/changelog.Debian + gzip -v9 debian/tmp-lib32/usr/share/doc/lib32bz2-1.0/changelog* + + install -d debian/tmp-dev32/usr/share/doc + ln -s lib32bz2-1.0 debian/tmp-dev32/usr/share/doc/lib32bz2-dev + + $(DEBSTRIP) --strip-unneeded -R .note -R .comment \ + debian/tmp-lib32/usr/lib32/*.so* + $(DEBSTRIP) --strip-debug debian/tmp-dev32/usr/lib32/*.a + + install -d debian/tmp-{lib,dev}32/DEBIAN + /bin/echo -e 'libbz2\t1.0\tlib32bz2-1.0' > debian/tmp-lib32/DEBIAN/shlibs + + -dpkg-shlibdeps debian/tmp-lib/usr/lib32/*.so* +ifeq ($(DEB_HOST_ARCH),amd64) + echo 'shlibs:Depends=libc6-i386 | ia32-libs' > debian/substvars +endif +ifeq ($(DEB_HOST_ARCH),ppc64) + echo 'shlibs:Depends=libc6-powerpc' > debian/substvars +endif + dpkg-gencontrol -isp -Pdebian/tmp-lib32 -plib32bz2-1.0 + rm -f debian/substvars + +ifeq ($(DEB_HOST_ARCH),amd64) + echo 'dev:Depends=libc6-dev-i386 | ia32-libs-dev' > debian/substvars +endif +ifeq ($(DEB_HOST_ARCH),ppc64) + echo 'shlibs:Depends=libc6-dev-powerpc' > debian/substvars +endif + dpkg-gencontrol -isp -Pdebian/tmp-dev32 -plib32bz2-dev + + for i in dev lib; do \ + cp debian/postinst-$$i debian/tmp-$${i}32/DEBIAN/postinst; \ + cp debian/prerm-$$i debian/tmp-$${i}32/DEBIAN/prerm; \ + chmod +x debian/tmp-$${i}32/DEBIAN/postinst; \ + chmod +x debian/tmp-$${i}32/DEBIAN/prerm; \ + done + + chown -R root.root debian/tmp*32 + chmod -R a+rX-wts,u+w debian/tmp*32 + + dpkg --build debian/tmp-lib32 .. + dpkg --build debian/tmp-dev32 .. +endif + +print-version: + @@echo "Debian version: $(DEBVERSION)" + @@echo "Upstream version: $(UPVERSION)" + +get-orig-source: + $(WGET) -O bzip2_$(UPVERSION).orig.tar.gz \ + ftp://sourceware.cygnus.com/pub/bzip2/v100/bzip2-$(UPVERSION).tar.gz + +binary: binary-indep binary-arch + +.PHONY: build clean binary-indep binary-arch binary print-version \ + get-orig-source