171e7ee59SPeter Avalos 271e7ee59SPeter AvalosThis is the README for bzip2/libzip2. 371e7ee59SPeter AvalosThis version is fully compatible with the previous public releases. 471e7ee59SPeter Avalos 571e7ee59SPeter Avalos------------------------------------------------------------------ 671e7ee59SPeter AvalosThis file is part of bzip2/libbzip2, a program and library for 771e7ee59SPeter Avaloslossless, block-sorting data compression. 871e7ee59SPeter Avalos 9*86954436SDaniel Fojtbzip2/libbzip2 version 1.0.8 of 13 July 2019 10*86954436SDaniel FojtCopyright (C) 1996-2019 Julian Seward <jseward@acm.org> 1171e7ee59SPeter Avalos 1271e7ee59SPeter AvalosPlease read the WARNING, DISCLAIMER and PATENTS sections in this file. 1371e7ee59SPeter Avalos 1471e7ee59SPeter AvalosThis program is released under the terms of the license contained 1571e7ee59SPeter Avalosin the file LICENSE. 1671e7ee59SPeter Avalos------------------------------------------------------------------ 1771e7ee59SPeter Avalos 1871e7ee59SPeter AvalosComplete documentation is available in Postscript form (manual.ps), 1971e7ee59SPeter AvalosPDF (manual.pdf) or html (manual.html). A plain-text version of the 2071e7ee59SPeter Avalosmanual page is available as bzip2.txt. 2171e7ee59SPeter Avalos 2271e7ee59SPeter Avalos 2371e7ee59SPeter AvalosHOW TO BUILD -- UNIX 2471e7ee59SPeter Avalos 2571e7ee59SPeter AvalosType 'make'. This builds the library libbz2.a and then the programs 2671e7ee59SPeter Avalosbzip2 and bzip2recover. Six self-tests are run. If the self-tests 2771e7ee59SPeter Avaloscomplete ok, carry on to installation: 2871e7ee59SPeter Avalos 2971e7ee59SPeter AvalosTo install in /usr/local/bin, /usr/local/lib, /usr/local/man and 3071e7ee59SPeter Avalos/usr/local/include, type 3171e7ee59SPeter Avalos 3271e7ee59SPeter Avalos make install 3371e7ee59SPeter Avalos 3471e7ee59SPeter AvalosTo install somewhere else, eg, /xxx/yyy/{bin,lib,man,include}, type 3571e7ee59SPeter Avalos 3671e7ee59SPeter Avalos make install PREFIX=/xxx/yyy 3771e7ee59SPeter Avalos 3871e7ee59SPeter AvalosIf you are (justifiably) paranoid and want to see what 'make install' 3971e7ee59SPeter Avalosis going to do, you can first do 4071e7ee59SPeter Avalos 4171e7ee59SPeter Avalos make -n install or 4271e7ee59SPeter Avalos make -n install PREFIX=/xxx/yyy respectively. 4371e7ee59SPeter Avalos 4471e7ee59SPeter AvalosThe -n instructs make to show the commands it would execute, but not 4571e7ee59SPeter Avalosactually execute them. 4671e7ee59SPeter Avalos 4771e7ee59SPeter Avalos 4871e7ee59SPeter AvalosHOW TO BUILD -- UNIX, shared library libbz2.so. 4971e7ee59SPeter Avalos 5071e7ee59SPeter AvalosDo 'make -f Makefile-libbz2_so'. This Makefile seems to work for 5171e7ee59SPeter AvalosLinux-ELF (RedHat 7.2 on an x86 box), with gcc. I make no claims 5271e7ee59SPeter Avalosthat it works for any other platform, though I suspect it probably 5371e7ee59SPeter Avaloswill work for most platforms employing both ELF and gcc. 5471e7ee59SPeter Avalos 5571e7ee59SPeter Avalosbzip2-shared, a client of the shared library, is also built, but not 5671e7ee59SPeter Avalosself-tested. So I suggest you also build using the normal Makefile, 5771e7ee59SPeter Avalossince that conducts a self-test. A second reason to prefer the 5871e7ee59SPeter Avalosversion statically linked to the library is that, on x86 platforms, 5971e7ee59SPeter Avalosbuilding shared objects makes a valuable register (%ebx) unavailable 6071e7ee59SPeter Avalosto gcc, resulting in a slowdown of 10%-20%, at least for bzip2. 6171e7ee59SPeter Avalos 6271e7ee59SPeter AvalosImportant note for people upgrading .so's from 0.9.0/0.9.5 to version 6371e7ee59SPeter Avalos1.0.X. All the functions in the library have been renamed, from (eg) 6471e7ee59SPeter AvalosbzCompress to BZ2_bzCompress, to avoid namespace pollution. 6571e7ee59SPeter AvalosUnfortunately this means that the libbz2.so created by 6671e7ee59SPeter AvalosMakefile-libbz2_so will not work with any program which used an older 6771e7ee59SPeter Avalosversion of the library. I do encourage library clients to make the 6871e7ee59SPeter Avaloseffort to upgrade to use version 1.0, since it is both faster and more 6971e7ee59SPeter Avalosrobust than previous versions. 7071e7ee59SPeter Avalos 7171e7ee59SPeter Avalos 7271e7ee59SPeter AvalosHOW TO BUILD -- Windows 95, NT, DOS, Mac, etc. 7371e7ee59SPeter Avalos 7471e7ee59SPeter AvalosIt's difficult for me to support compilation on all these platforms. 7571e7ee59SPeter AvalosMy approach is to collect binaries for these platforms, and put them 76*86954436SDaniel Fojton the master web site (https://sourceware.org/bzip2/). Look there. However 7771e7ee59SPeter Avalos(FWIW), bzip2-1.0.X is very standard ANSI C and should compile 7871e7ee59SPeter Avalosunmodified with MS Visual C. If you have difficulties building, you 7971e7ee59SPeter Avalosmight want to read README.COMPILATION.PROBLEMS. 8071e7ee59SPeter Avalos 8171e7ee59SPeter AvalosAt least using MS Visual C++ 6, you can build from the unmodified 8271e7ee59SPeter Avalossources by issuing, in a command shell: 8371e7ee59SPeter Avalos 8471e7ee59SPeter Avalos nmake -f makefile.msc 8571e7ee59SPeter Avalos 8671e7ee59SPeter Avalos(you may need to first run the MSVC-provided script VCVARS32.BAT 8771e7ee59SPeter Avalos so as to set up paths to the MSVC tools correctly). 8871e7ee59SPeter Avalos 8971e7ee59SPeter Avalos 9071e7ee59SPeter AvalosVALIDATION 9171e7ee59SPeter Avalos 9271e7ee59SPeter AvalosCorrect operation, in the sense that a compressed file can always be 9371e7ee59SPeter Avalosdecompressed to reproduce the original, is obviously of paramount 9471e7ee59SPeter Avalosimportance. To validate bzip2, I used a modified version of Mark 9571e7ee59SPeter AvalosNelson's churn program. Churn is an automated test driver which 9671e7ee59SPeter Avalosrecursively traverses a directory structure, using bzip2 to compress 9771e7ee59SPeter Avalosand then decompress each file it encounters, and checking that the 9871e7ee59SPeter Avalosdecompressed data is the same as the original. 9971e7ee59SPeter Avalos 10071e7ee59SPeter Avalos 10171e7ee59SPeter Avalos 10271e7ee59SPeter AvalosPlease read and be aware of the following: 10371e7ee59SPeter Avalos 10471e7ee59SPeter AvalosWARNING: 10571e7ee59SPeter Avalos 10671e7ee59SPeter Avalos This program and library (attempts to) compress data by 10771e7ee59SPeter Avalos performing several non-trivial transformations on it. 10871e7ee59SPeter Avalos Unless you are 100% familiar with *all* the algorithms 10971e7ee59SPeter Avalos contained herein, and with the consequences of modifying them, 11071e7ee59SPeter Avalos you should NOT meddle with the compression or decompression 11171e7ee59SPeter Avalos machinery. Incorrect changes can and very likely *will* 11271e7ee59SPeter Avalos lead to disastrous loss of data. 11371e7ee59SPeter Avalos 11471e7ee59SPeter Avalos 11571e7ee59SPeter AvalosDISCLAIMER: 11671e7ee59SPeter Avalos 11771e7ee59SPeter Avalos I TAKE NO RESPONSIBILITY FOR ANY LOSS OF DATA ARISING FROM THE 11871e7ee59SPeter Avalos USE OF THIS PROGRAM/LIBRARY, HOWSOEVER CAUSED. 11971e7ee59SPeter Avalos 12071e7ee59SPeter Avalos Every compression of a file implies an assumption that the 12171e7ee59SPeter Avalos compressed file can be decompressed to reproduce the original. 12271e7ee59SPeter Avalos Great efforts in design, coding and testing have been made to 12371e7ee59SPeter Avalos ensure that this program works correctly. However, the complexity 12471e7ee59SPeter Avalos of the algorithms, and, in particular, the presence of various 12571e7ee59SPeter Avalos special cases in the code which occur with very low but non-zero 12671e7ee59SPeter Avalos probability make it impossible to rule out the possibility of bugs 12771e7ee59SPeter Avalos remaining in the program. DO NOT COMPRESS ANY DATA WITH THIS 12871e7ee59SPeter Avalos PROGRAM UNLESS YOU ARE PREPARED TO ACCEPT THE POSSIBILITY, HOWEVER 12971e7ee59SPeter Avalos SMALL, THAT THE DATA WILL NOT BE RECOVERABLE. 13071e7ee59SPeter Avalos 13171e7ee59SPeter Avalos That is not to say this program is inherently unreliable. 13271e7ee59SPeter Avalos Indeed, I very much hope the opposite is true. bzip2/libbzip2 13371e7ee59SPeter Avalos has been carefully constructed and extensively tested. 13471e7ee59SPeter Avalos 13571e7ee59SPeter Avalos 13671e7ee59SPeter AvalosPATENTS: 13771e7ee59SPeter Avalos 13871e7ee59SPeter Avalos To the best of my knowledge, bzip2/libbzip2 does not use any 13971e7ee59SPeter Avalos patented algorithms. However, I do not have the resources 14071e7ee59SPeter Avalos to carry out a patent search. Therefore I cannot give any 14171e7ee59SPeter Avalos guarantee of the above statement. 14271e7ee59SPeter Avalos 14371e7ee59SPeter Avalos 14471e7ee59SPeter Avalos 14571e7ee59SPeter AvalosWHAT'S NEW IN 0.9.0 (as compared to 0.1pl2) ? 14671e7ee59SPeter Avalos 14771e7ee59SPeter Avalos * Approx 10% faster compression, 30% faster decompression 14871e7ee59SPeter Avalos * -t (test mode) is a lot quicker 14971e7ee59SPeter Avalos * Can decompress concatenated compressed files 15071e7ee59SPeter Avalos * Programming interface, so programs can directly read/write .bz2 files 15171e7ee59SPeter Avalos * Less restrictive (BSD-style) licensing 15271e7ee59SPeter Avalos * Flag handling more compatible with GNU gzip 15371e7ee59SPeter Avalos * Much more documentation, i.e., a proper user manual 15471e7ee59SPeter Avalos * Hopefully, improved portability (at least of the library) 15571e7ee59SPeter Avalos 15671e7ee59SPeter AvalosWHAT'S NEW IN 0.9.5 ? 15771e7ee59SPeter Avalos 15871e7ee59SPeter Avalos * Compression speed is much less sensitive to the input 15971e7ee59SPeter Avalos data than in previous versions. Specifically, the very 16071e7ee59SPeter Avalos slow performance caused by repetitive data is fixed. 16171e7ee59SPeter Avalos * Many small improvements in file and flag handling. 16271e7ee59SPeter Avalos * A Y2K statement. 16371e7ee59SPeter Avalos 164*86954436SDaniel FojtWHAT'S NEW IN 1.0.x ? 16571e7ee59SPeter Avalos 16671e7ee59SPeter Avalos See the CHANGES file. 16771e7ee59SPeter Avalos 168*86954436SDaniel FojtI hope you find bzip2 useful. Feel free to contact the developers at 169*86954436SDaniel Fojt bzip2-devel@sourceware.org 17071e7ee59SPeter Avalosif you have any suggestions or queries. Many people mailed me with 17171e7ee59SPeter Avaloscomments, suggestions and patches after the releases of bzip-0.15, 17271e7ee59SPeter Avalosbzip-0.21, and bzip2 versions 0.1pl2, 0.9.0, 0.9.5, 1.0.0, 1.0.1, 17371e7ee59SPeter Avalos1.0.2 and 1.0.3, and the changes in bzip2 are largely a result of this 17471e7ee59SPeter Avalosfeedback. I thank you for your comments. 17571e7ee59SPeter Avalos 176*86954436SDaniel Fojtbzip2's "home" is https://sourceware.org/bzip2/ 17771e7ee59SPeter Avalos 17871e7ee59SPeter AvalosJulian Seward 179*86954436SDaniel Fojtjseward@acm.org 18071e7ee59SPeter AvalosCambridge, UK. 18171e7ee59SPeter Avalos 18271e7ee59SPeter Avalos18 July 1996 (version 0.15) 18371e7ee59SPeter Avalos25 August 1996 (version 0.21) 18471e7ee59SPeter Avalos 7 August 1997 (bzip2, version 0.1) 18571e7ee59SPeter Avalos29 August 1997 (bzip2, version 0.1pl2) 18671e7ee59SPeter Avalos23 August 1998 (bzip2, version 0.9.0) 18771e7ee59SPeter Avalos 8 June 1999 (bzip2, version 0.9.5) 18871e7ee59SPeter Avalos 4 Sept 1999 (bzip2, version 0.9.5d) 18971e7ee59SPeter Avalos 5 May 2000 (bzip2, version 1.0pre8) 19071e7ee59SPeter Avalos30 December 2001 (bzip2, version 1.0.2pre1) 19171e7ee59SPeter Avalos15 February 2005 (bzip2, version 1.0.3) 19271e7ee59SPeter Avalos20 December 2006 (bzip2, version 1.0.4) 19371e7ee59SPeter Avalos10 December 2007 (bzip2, version 1.0.5) 1948b8098b1SPeter Avalos 6 Sept 2010 (bzip2, version 1.0.6) 195*86954436SDaniel Fojt27 June 2019 (bzip2, version 1.0.7) 196*86954436SDaniel Fojt13 July 2019 (bzip2, version 1.0.8) 197