1a196e50eSopenharmony_ci 2a196e50eSopenharmony_ciThis is the README for bzip2/libzip2. 3a196e50eSopenharmony_ciThis version is fully compatible with the previous public releases. 4a196e50eSopenharmony_ci 5a196e50eSopenharmony_ci------------------------------------------------------------------ 6a196e50eSopenharmony_ciThis file is part of bzip2/libbzip2, a program and library for 7a196e50eSopenharmony_cilossless, block-sorting data compression. 8a196e50eSopenharmony_ci 9a196e50eSopenharmony_cibzip2/libbzip2 version 1.0.8 of 13 July 2019 10a196e50eSopenharmony_ciCopyright (C) 1996-2019 Julian Seward <jseward@acm.org> 11a196e50eSopenharmony_ci 12a196e50eSopenharmony_ciPlease read the WARNING, DISCLAIMER and PATENTS sections in this file. 13a196e50eSopenharmony_ci 14a196e50eSopenharmony_ciThis program is released under the terms of the license contained 15a196e50eSopenharmony_ciin the file LICENSE. 16a196e50eSopenharmony_ci------------------------------------------------------------------ 17a196e50eSopenharmony_ci 18a196e50eSopenharmony_ciComplete documentation is available in Postscript form (manual.ps), 19a196e50eSopenharmony_ciPDF (manual.pdf) or html (manual.html). A plain-text version of the 20a196e50eSopenharmony_cimanual page is available as bzip2.txt. 21a196e50eSopenharmony_ci 22a196e50eSopenharmony_ci 23a196e50eSopenharmony_ciHOW TO BUILD -- UNIX 24a196e50eSopenharmony_ci 25a196e50eSopenharmony_ciType 'make'. This builds the library libbz2.a and then the programs 26a196e50eSopenharmony_cibzip2 and bzip2recover. Six self-tests are run. If the self-tests 27a196e50eSopenharmony_cicomplete ok, carry on to installation: 28a196e50eSopenharmony_ci 29a196e50eSopenharmony_ciTo install in /usr/local/bin, /usr/local/lib, /usr/local/man and 30a196e50eSopenharmony_ci/usr/local/include, type 31a196e50eSopenharmony_ci 32a196e50eSopenharmony_ci make install 33a196e50eSopenharmony_ci 34a196e50eSopenharmony_ciTo install somewhere else, eg, /xxx/yyy/{bin,lib,man,include}, type 35a196e50eSopenharmony_ci 36a196e50eSopenharmony_ci make install PREFIX=/xxx/yyy 37a196e50eSopenharmony_ci 38a196e50eSopenharmony_ciIf you are (justifiably) paranoid and want to see what 'make install' 39a196e50eSopenharmony_ciis going to do, you can first do 40a196e50eSopenharmony_ci 41a196e50eSopenharmony_ci make -n install or 42a196e50eSopenharmony_ci make -n install PREFIX=/xxx/yyy respectively. 43a196e50eSopenharmony_ci 44a196e50eSopenharmony_ciThe -n instructs make to show the commands it would execute, but not 45a196e50eSopenharmony_ciactually execute them. 46a196e50eSopenharmony_ci 47a196e50eSopenharmony_ci 48a196e50eSopenharmony_ciHOW TO BUILD -- UNIX, shared library libbz2.so. 49a196e50eSopenharmony_ci 50a196e50eSopenharmony_ciDo 'make -f Makefile-libbz2_so'. This Makefile seems to work for 51a196e50eSopenharmony_ciLinux-ELF (RedHat 7.2 on an x86 box), with gcc. I make no claims 52a196e50eSopenharmony_cithat it works for any other platform, though I suspect it probably 53a196e50eSopenharmony_ciwill work for most platforms employing both ELF and gcc. 54a196e50eSopenharmony_ci 55a196e50eSopenharmony_cibzip2-shared, a client of the shared library, is also built, but not 56a196e50eSopenharmony_ciself-tested. So I suggest you also build using the normal Makefile, 57a196e50eSopenharmony_cisince that conducts a self-test. A second reason to prefer the 58a196e50eSopenharmony_civersion statically linked to the library is that, on x86 platforms, 59a196e50eSopenharmony_cibuilding shared objects makes a valuable register (%ebx) unavailable 60a196e50eSopenharmony_cito gcc, resulting in a slowdown of 10%-20%, at least for bzip2. 61a196e50eSopenharmony_ci 62a196e50eSopenharmony_ciImportant note for people upgrading .so's from 0.9.0/0.9.5 to version 63a196e50eSopenharmony_ci1.0.X. All the functions in the library have been renamed, from (eg) 64a196e50eSopenharmony_cibzCompress to BZ2_bzCompress, to avoid namespace pollution. 65a196e50eSopenharmony_ciUnfortunately this means that the libbz2.so created by 66a196e50eSopenharmony_ciMakefile-libbz2_so will not work with any program which used an older 67a196e50eSopenharmony_civersion of the library. I do encourage library clients to make the 68a196e50eSopenharmony_cieffort to upgrade to use version 1.0, since it is both faster and more 69a196e50eSopenharmony_cirobust than previous versions. 70a196e50eSopenharmony_ci 71a196e50eSopenharmony_ci 72a196e50eSopenharmony_ciHOW TO BUILD -- Windows 95, NT, DOS, Mac, etc. 73a196e50eSopenharmony_ci 74a196e50eSopenharmony_ciIt's difficult for me to support compilation on all these platforms. 75a196e50eSopenharmony_ciMy approach is to collect binaries for these platforms, and put them 76a196e50eSopenharmony_cion the master web site (https://sourceware.org/bzip2/). Look there. However 77a196e50eSopenharmony_ci(FWIW), bzip2-1.0.X is very standard ANSI C and should compile 78a196e50eSopenharmony_ciunmodified with MS Visual C. If you have difficulties building, you 79a196e50eSopenharmony_cimight want to read README.COMPILATION.PROBLEMS. 80a196e50eSopenharmony_ci 81a196e50eSopenharmony_ciAt least using MS Visual C++ 6, you can build from the unmodified 82a196e50eSopenharmony_cisources by issuing, in a command shell: 83a196e50eSopenharmony_ci 84a196e50eSopenharmony_ci nmake -f makefile.msc 85a196e50eSopenharmony_ci 86a196e50eSopenharmony_ci(you may need to first run the MSVC-provided script VCVARS32.BAT 87a196e50eSopenharmony_ci so as to set up paths to the MSVC tools correctly). 88a196e50eSopenharmony_ci 89a196e50eSopenharmony_ci 90a196e50eSopenharmony_ciVALIDATION 91a196e50eSopenharmony_ci 92a196e50eSopenharmony_ciCorrect operation, in the sense that a compressed file can always be 93a196e50eSopenharmony_cidecompressed to reproduce the original, is obviously of paramount 94a196e50eSopenharmony_ciimportance. To validate bzip2, I used a modified version of Mark 95a196e50eSopenharmony_ciNelson's churn program. Churn is an automated test driver which 96a196e50eSopenharmony_cirecursively traverses a directory structure, using bzip2 to compress 97a196e50eSopenharmony_ciand then decompress each file it encounters, and checking that the 98a196e50eSopenharmony_cidecompressed data is the same as the original. 99a196e50eSopenharmony_ci 100a196e50eSopenharmony_ci 101a196e50eSopenharmony_ci 102a196e50eSopenharmony_ciPlease read and be aware of the following: 103a196e50eSopenharmony_ci 104a196e50eSopenharmony_ciWARNING: 105a196e50eSopenharmony_ci 106a196e50eSopenharmony_ci This program and library (attempts to) compress data by 107a196e50eSopenharmony_ci performing several non-trivial transformations on it. 108a196e50eSopenharmony_ci Unless you are 100% familiar with *all* the algorithms 109a196e50eSopenharmony_ci contained herein, and with the consequences of modifying them, 110a196e50eSopenharmony_ci you should NOT meddle with the compression or decompression 111a196e50eSopenharmony_ci machinery. Incorrect changes can and very likely *will* 112a196e50eSopenharmony_ci lead to disastrous loss of data. 113a196e50eSopenharmony_ci 114a196e50eSopenharmony_ci 115a196e50eSopenharmony_ciDISCLAIMER: 116a196e50eSopenharmony_ci 117a196e50eSopenharmony_ci I TAKE NO RESPONSIBILITY FOR ANY LOSS OF DATA ARISING FROM THE 118a196e50eSopenharmony_ci USE OF THIS PROGRAM/LIBRARY, HOWSOEVER CAUSED. 119a196e50eSopenharmony_ci 120a196e50eSopenharmony_ci Every compression of a file implies an assumption that the 121a196e50eSopenharmony_ci compressed file can be decompressed to reproduce the original. 122a196e50eSopenharmony_ci Great efforts in design, coding and testing have been made to 123a196e50eSopenharmony_ci ensure that this program works correctly. However, the complexity 124a196e50eSopenharmony_ci of the algorithms, and, in particular, the presence of various 125a196e50eSopenharmony_ci special cases in the code which occur with very low but non-zero 126a196e50eSopenharmony_ci probability make it impossible to rule out the possibility of bugs 127a196e50eSopenharmony_ci remaining in the program. DO NOT COMPRESS ANY DATA WITH THIS 128a196e50eSopenharmony_ci PROGRAM UNLESS YOU ARE PREPARED TO ACCEPT THE POSSIBILITY, HOWEVER 129a196e50eSopenharmony_ci SMALL, THAT THE DATA WILL NOT BE RECOVERABLE. 130a196e50eSopenharmony_ci 131a196e50eSopenharmony_ci That is not to say this program is inherently unreliable. 132a196e50eSopenharmony_ci Indeed, I very much hope the opposite is true. bzip2/libbzip2 133a196e50eSopenharmony_ci has been carefully constructed and extensively tested. 134a196e50eSopenharmony_ci 135a196e50eSopenharmony_ci 136a196e50eSopenharmony_ciPATENTS: 137a196e50eSopenharmony_ci 138a196e50eSopenharmony_ci To the best of my knowledge, bzip2/libbzip2 does not use any 139a196e50eSopenharmony_ci patented algorithms. However, I do not have the resources 140a196e50eSopenharmony_ci to carry out a patent search. Therefore I cannot give any 141a196e50eSopenharmony_ci guarantee of the above statement. 142a196e50eSopenharmony_ci 143a196e50eSopenharmony_ci 144a196e50eSopenharmony_ci 145a196e50eSopenharmony_ciWHAT'S NEW IN 0.9.0 (as compared to 0.1pl2) ? 146a196e50eSopenharmony_ci 147a196e50eSopenharmony_ci * Approx 10% faster compression, 30% faster decompression 148a196e50eSopenharmony_ci * -t (test mode) is a lot quicker 149a196e50eSopenharmony_ci * Can decompress concatenated compressed files 150a196e50eSopenharmony_ci * Programming interface, so programs can directly read/write .bz2 files 151a196e50eSopenharmony_ci * Less restrictive (BSD-style) licensing 152a196e50eSopenharmony_ci * Flag handling more compatible with GNU gzip 153a196e50eSopenharmony_ci * Much more documentation, i.e., a proper user manual 154a196e50eSopenharmony_ci * Hopefully, improved portability (at least of the library) 155a196e50eSopenharmony_ci 156a196e50eSopenharmony_ciWHAT'S NEW IN 0.9.5 ? 157a196e50eSopenharmony_ci 158a196e50eSopenharmony_ci * Compression speed is much less sensitive to the input 159a196e50eSopenharmony_ci data than in previous versions. Specifically, the very 160a196e50eSopenharmony_ci slow performance caused by repetitive data is fixed. 161a196e50eSopenharmony_ci * Many small improvements in file and flag handling. 162a196e50eSopenharmony_ci * A Y2K statement. 163a196e50eSopenharmony_ci 164a196e50eSopenharmony_ciWHAT'S NEW IN 1.0.x ? 165a196e50eSopenharmony_ci 166a196e50eSopenharmony_ci See the CHANGES file. 167a196e50eSopenharmony_ci 168a196e50eSopenharmony_ciI hope you find bzip2 useful. Feel free to contact the developers at 169a196e50eSopenharmony_ci bzip2-devel@sourceware.org 170a196e50eSopenharmony_ciif you have any suggestions or queries. Many people mailed me with 171a196e50eSopenharmony_cicomments, suggestions and patches after the releases of bzip-0.15, 172a196e50eSopenharmony_cibzip-0.21, and bzip2 versions 0.1pl2, 0.9.0, 0.9.5, 1.0.0, 1.0.1, 173a196e50eSopenharmony_ci1.0.2 and 1.0.3, and the changes in bzip2 are largely a result of this 174a196e50eSopenharmony_cifeedback. I thank you for your comments. 175a196e50eSopenharmony_ci 176a196e50eSopenharmony_cibzip2's "home" is https://sourceware.org/bzip2/ 177a196e50eSopenharmony_ci 178a196e50eSopenharmony_ciJulian Seward 179a196e50eSopenharmony_cijseward@acm.org 180a196e50eSopenharmony_ciCambridge, UK. 181a196e50eSopenharmony_ci 182a196e50eSopenharmony_ci18 July 1996 (version 0.15) 183a196e50eSopenharmony_ci25 August 1996 (version 0.21) 184a196e50eSopenharmony_ci 7 August 1997 (bzip2, version 0.1) 185a196e50eSopenharmony_ci29 August 1997 (bzip2, version 0.1pl2) 186a196e50eSopenharmony_ci23 August 1998 (bzip2, version 0.9.0) 187a196e50eSopenharmony_ci 8 June 1999 (bzip2, version 0.9.5) 188a196e50eSopenharmony_ci 4 Sept 1999 (bzip2, version 0.9.5d) 189a196e50eSopenharmony_ci 5 May 2000 (bzip2, version 1.0pre8) 190a196e50eSopenharmony_ci30 December 2001 (bzip2, version 1.0.2pre1) 191a196e50eSopenharmony_ci15 February 2005 (bzip2, version 1.0.3) 192a196e50eSopenharmony_ci20 December 2006 (bzip2, version 1.0.4) 193a196e50eSopenharmony_ci10 December 2007 (bzip2, version 1.0.5) 194a196e50eSopenharmony_ci 6 Sept 2010 (bzip2, version 1.0.6) 195a196e50eSopenharmony_ci27 June 2019 (bzip2, version 1.0.7) 196a196e50eSopenharmony_ci13 July 2019 (bzip2, version 1.0.8) 197