xref: /freebsd/contrib/bzip2/README (revision ed14b6e01afaf82e6d03c114f68404bbb1aaa47a)
1df9de0ebSDavid E. O'Brien
2df9de0ebSDavid E. O'BrienThis is the README for bzip2, a block-sorting file compressor, version
3ed14b6e0SMaxim Sobolev1.0.2.  This version is fully compatible with the previous public
4ed14b6e0SMaxim Sobolevreleases, versions 0.1pl2, 0.9.0, 0.9.5, 1.0.0 and 1.0.1.
5df9de0ebSDavid E. O'Brien
6ed14b6e0SMaxim Sobolevbzip2-1.0.2 is distributed under a BSD-style license.  For details,
7df9de0ebSDavid E. O'Briensee the file LICENSE.
8df9de0ebSDavid E. O'Brien
9ed14b6e0SMaxim SobolevComplete documentation is available in Postscript form (manual.ps),
10ed14b6e0SMaxim SobolevPDF (manual.pdf, amazingly enough) or html (manual_toc.html).  A
11ed14b6e0SMaxim Sobolevplain-text version of the manual page is available as bzip2.txt.
12ed14b6e0SMaxim SobolevA statement about Y2K issues is now included in the file Y2K_INFO.
13df9de0ebSDavid E. O'Brien
14df9de0ebSDavid E. O'Brien
15df9de0ebSDavid E. O'BrienHOW TO BUILD -- UNIX
16df9de0ebSDavid E. O'Brien
17df9de0ebSDavid E. O'BrienType `make'.  This builds the library libbz2.a and then the
18df9de0ebSDavid E. O'Brienprograms bzip2 and bzip2recover.  Six self-tests are run.
19df9de0ebSDavid E. O'BrienIf the self-tests complete ok, carry on to installation:
20df9de0ebSDavid E. O'Brien
21df9de0ebSDavid E. O'BrienTo install in /usr/bin, /usr/lib, /usr/man and /usr/include, type
22df9de0ebSDavid E. O'Brien   make install
23df9de0ebSDavid E. O'BrienTo install somewhere else, eg, /xxx/yyy/{bin,lib,man,include}, type
24df9de0ebSDavid E. O'Brien   make install PREFIX=/xxx/yyy
25df9de0ebSDavid E. O'BrienIf you are (justifiably) paranoid and want to see what 'make install'
26df9de0ebSDavid E. O'Brienis going to do, you can first do
27df9de0ebSDavid E. O'Brien   make -n install                      or
28df9de0ebSDavid E. O'Brien   make -n install PREFIX=/xxx/yyy      respectively.
29df9de0ebSDavid E. O'BrienThe -n instructs make to show the commands it would execute, but
30df9de0ebSDavid E. O'Briennot actually execute them.
31df9de0ebSDavid E. O'Brien
32df9de0ebSDavid E. O'Brien
33df9de0ebSDavid E. O'BrienHOW TO BUILD -- UNIX, shared library libbz2.so.
34df9de0ebSDavid E. O'Brien
35df9de0ebSDavid E. O'BrienDo 'make -f Makefile-libbz2_so'.  This Makefile seems to work for
36ed14b6e0SMaxim SobolevLinux-ELF (RedHat 7.2 on an x86 box), with gcc.  I make no claims
37df9de0ebSDavid E. O'Brienthat it works for any other platform, though I suspect it probably
38df9de0ebSDavid E. O'Brienwill work for most platforms employing both ELF and gcc.
39df9de0ebSDavid E. O'Brien
40ed14b6e0SMaxim Sobolevbzip2-shared, a client of the shared library, is also built, but not
41ed14b6e0SMaxim Sobolevself-tested.  So I suggest you also build using the normal Makefile,
42ed14b6e0SMaxim Sobolevsince that conducts a self-test.  A second reason to prefer the
43ed14b6e0SMaxim Sobolevversion statically linked to the library is that, on x86 platforms,
44ed14b6e0SMaxim Sobolevbuilding shared objects makes a valuable register (%ebx) unavailable
45ed14b6e0SMaxim Sobolevto gcc, resulting in a slowdown of 10%-20%, at least for bzip2.
46df9de0ebSDavid E. O'Brien
47ed14b6e0SMaxim SobolevImportant note for people upgrading .so's from 0.9.0/0.9.5 to version
48ed14b6e0SMaxim Sobolev1.0.X.  All the functions in the library have been renamed, from (eg)
49ed14b6e0SMaxim SobolevbzCompress to BZ2_bzCompress, to avoid namespace pollution.
50df9de0ebSDavid E. O'BrienUnfortunately this means that the libbz2.so created by
51ed14b6e0SMaxim SobolevMakefile-libbz2_so will not work with any program which used an older
52ed14b6e0SMaxim Sobolevversion of the library.  Sorry.  I do encourage library clients to
53ed14b6e0SMaxim Sobolevmake the effort to upgrade to use version 1.0, since it is both faster
54ed14b6e0SMaxim Sobolevand more robust than previous versions.
55df9de0ebSDavid E. O'Brien
56df9de0ebSDavid E. O'Brien
57df9de0ebSDavid E. O'BrienHOW TO BUILD -- Windows 95, NT, DOS, Mac, etc.
58df9de0ebSDavid E. O'Brien
59df9de0ebSDavid E. O'BrienIt's difficult for me to support compilation on all these platforms.
60df9de0ebSDavid E. O'BrienMy approach is to collect binaries for these platforms, and put them
61ed14b6e0SMaxim Sobolevon the master web page (http://sources.redhat.com/bzip2).  Look there.
62ed14b6e0SMaxim SobolevHowever (FWIW), bzip2-1.0.X is very standard ANSI C and should compile
63ed14b6e0SMaxim Sobolevunmodified with MS Visual C.  If you have difficulties building, you
64ed14b6e0SMaxim Sobolevmight want to read README.COMPILATION.PROBLEMS.
65ed14b6e0SMaxim Sobolev
66ed14b6e0SMaxim SobolevAt least using MS Visual C++ 6, you can build from the unmodified
67ed14b6e0SMaxim Sobolevsources by issuing, in a command shell:
68ed14b6e0SMaxim Sobolev   nmake -f makefile.msc
69ed14b6e0SMaxim Sobolev(you may need to first run the MSVC-provided script VCVARS32.BAT
70ed14b6e0SMaxim Sobolev so as to set up paths to the MSVC tools correctly).
71df9de0ebSDavid E. O'Brien
72df9de0ebSDavid E. O'Brien
73df9de0ebSDavid E. O'BrienVALIDATION
74df9de0ebSDavid E. O'Brien
75df9de0ebSDavid E. O'BrienCorrect operation, in the sense that a compressed file can always be
76df9de0ebSDavid E. O'Briendecompressed to reproduce the original, is obviously of paramount
77df9de0ebSDavid E. O'Brienimportance.  To validate bzip2, I used a modified version of Mark
78df9de0ebSDavid E. O'BrienNelson's churn program.  Churn is an automated test driver which
79df9de0ebSDavid E. O'Brienrecursively traverses a directory structure, using bzip2 to compress
80df9de0ebSDavid E. O'Brienand then decompress each file it encounters, and checking that the
81df9de0ebSDavid E. O'Briendecompressed data is the same as the original.  There are more details
82df9de0ebSDavid E. O'Brienin Section 4 of the user guide.
83df9de0ebSDavid E. O'Brien
84df9de0ebSDavid E. O'Brien
85df9de0ebSDavid E. O'Brien
86df9de0ebSDavid E. O'BrienPlease read and be aware of the following:
87df9de0ebSDavid E. O'Brien
88df9de0ebSDavid E. O'BrienWARNING:
89df9de0ebSDavid E. O'Brien
90df9de0ebSDavid E. O'Brien   This program (attempts to) compress data by performing several
91df9de0ebSDavid E. O'Brien   non-trivial transformations on it.  Unless you are 100% familiar
92df9de0ebSDavid E. O'Brien   with *all* the algorithms contained herein, and with the
93df9de0ebSDavid E. O'Brien   consequences of modifying them, you should NOT meddle with the
94df9de0ebSDavid E. O'Brien   compression or decompression machinery.  Incorrect changes can and
95df9de0ebSDavid E. O'Brien   very likely *will* lead to disastrous loss of data.
96df9de0ebSDavid E. O'Brien
97df9de0ebSDavid E. O'Brien
98df9de0ebSDavid E. O'BrienDISCLAIMER:
99df9de0ebSDavid E. O'Brien
100df9de0ebSDavid E. O'Brien   I TAKE NO RESPONSIBILITY FOR ANY LOSS OF DATA ARISING FROM THE
101df9de0ebSDavid E. O'Brien   USE OF THIS PROGRAM, HOWSOEVER CAUSED.
102df9de0ebSDavid E. O'Brien
103df9de0ebSDavid E. O'Brien   Every compression of a file implies an assumption that the
104df9de0ebSDavid E. O'Brien   compressed file can be decompressed to reproduce the original.
105df9de0ebSDavid E. O'Brien   Great efforts in design, coding and testing have been made to
106df9de0ebSDavid E. O'Brien   ensure that this program works correctly.  However, the complexity
107df9de0ebSDavid E. O'Brien   of the algorithms, and, in particular, the presence of various
108df9de0ebSDavid E. O'Brien   special cases in the code which occur with very low but non-zero
109df9de0ebSDavid E. O'Brien   probability make it impossible to rule out the possibility of bugs
110df9de0ebSDavid E. O'Brien   remaining in the program.  DO NOT COMPRESS ANY DATA WITH THIS
111df9de0ebSDavid E. O'Brien   PROGRAM UNLESS YOU ARE PREPARED TO ACCEPT THE POSSIBILITY, HOWEVER
112df9de0ebSDavid E. O'Brien   SMALL, THAT THE DATA WILL NOT BE RECOVERABLE.
113df9de0ebSDavid E. O'Brien
114df9de0ebSDavid E. O'Brien   That is not to say this program is inherently unreliable.  Indeed,
115df9de0ebSDavid E. O'Brien   I very much hope the opposite is true.  bzip2 has been carefully
116df9de0ebSDavid E. O'Brien   constructed and extensively tested.
117df9de0ebSDavid E. O'Brien
118df9de0ebSDavid E. O'Brien
119df9de0ebSDavid E. O'BrienPATENTS:
120df9de0ebSDavid E. O'Brien
121df9de0ebSDavid E. O'Brien   To the best of my knowledge, bzip2 does not use any patented
122df9de0ebSDavid E. O'Brien   algorithms.  However, I do not have the resources available to
123df9de0ebSDavid E. O'Brien   carry out a full patent search.  Therefore I cannot give any
124df9de0ebSDavid E. O'Brien   guarantee of the above statement.
125df9de0ebSDavid E. O'Brien
126df9de0ebSDavid E. O'BrienEnd of legalities.
127df9de0ebSDavid E. O'Brien
128df9de0ebSDavid E. O'Brien
129df9de0ebSDavid E. O'BrienWHAT'S NEW IN 0.9.0 (as compared to 0.1pl2) ?
130df9de0ebSDavid E. O'Brien
131df9de0ebSDavid E. O'Brien   * Approx 10% faster compression, 30% faster decompression
132df9de0ebSDavid E. O'Brien   * -t (test mode) is a lot quicker
133df9de0ebSDavid E. O'Brien   * Can decompress concatenated compressed files
134df9de0ebSDavid E. O'Brien   * Programming interface, so programs can directly read/write .bz2 files
135df9de0ebSDavid E. O'Brien   * Less restrictive (BSD-style) licensing
136df9de0ebSDavid E. O'Brien   * Flag handling more compatible with GNU gzip
137df9de0ebSDavid E. O'Brien   * Much more documentation, i.e., a proper user manual
138df9de0ebSDavid E. O'Brien   * Hopefully, improved portability (at least of the library)
139df9de0ebSDavid E. O'Brien
140df9de0ebSDavid E. O'BrienWHAT'S NEW IN 0.9.5 ?
141df9de0ebSDavid E. O'Brien
142df9de0ebSDavid E. O'Brien   * Compression speed is much less sensitive to the input
143df9de0ebSDavid E. O'Brien     data than in previous versions.  Specifically, the very
144df9de0ebSDavid E. O'Brien     slow performance caused by repetitive data is fixed.
145df9de0ebSDavid E. O'Brien   * Many small improvements in file and flag handling.
146df9de0ebSDavid E. O'Brien   * A Y2K statement.
147df9de0ebSDavid E. O'Brien
148ed14b6e0SMaxim SobolevWHAT'S NEW IN 1.0.0 ?
149df9de0ebSDavid E. O'Brien
150df9de0ebSDavid E. O'Brien   See the CHANGES file.
151df9de0ebSDavid E. O'Brien
152ed14b6e0SMaxim SobolevWHAT'S NEW IN 1.0.2 ?
153ed14b6e0SMaxim Sobolev
154ed14b6e0SMaxim Sobolev   See the CHANGES file.
155ed14b6e0SMaxim Sobolev
156ed14b6e0SMaxim Sobolev
157df9de0ebSDavid E. O'BrienI hope you find bzip2 useful.  Feel free to contact me at
158df9de0ebSDavid E. O'Brien   jseward@acm.org
159df9de0ebSDavid E. O'Brienif you have any suggestions or queries.  Many people mailed me with
160df9de0ebSDavid E. O'Briencomments, suggestions and patches after the releases of bzip-0.15,
161ed14b6e0SMaxim Sobolevbzip-0.21, and bzip2 versions 0.1pl2, 0.9.0, 0.9.5, 1.0.0 and 1.0.1,
162ed14b6e0SMaxim Sobolevand the changes in bzip2 are largely a result of this feedback.
163ed14b6e0SMaxim SobolevI thank you for your comments.
164df9de0ebSDavid E. O'Brien
165df9de0ebSDavid E. O'BrienAt least for the time being, bzip2's "home" is (or can be reached via)
166ed14b6e0SMaxim Sobolevhttp://sources.redhat.com/bzip2.
167df9de0ebSDavid E. O'Brien
168df9de0ebSDavid E. O'BrienJulian Seward
169df9de0ebSDavid E. O'Brienjseward@acm.org
170df9de0ebSDavid E. O'Brien
171ed14b6e0SMaxim SobolevCambridge, UK (and what a great town this is!)
172ed14b6e0SMaxim Sobolev
173df9de0ebSDavid E. O'Brien18     July 1996 (version 0.15)
174df9de0ebSDavid E. O'Brien25   August 1996 (version 0.21)
175df9de0ebSDavid E. O'Brien 7   August 1997 (bzip2, version 0.1)
176df9de0ebSDavid E. O'Brien29   August 1997 (bzip2, version 0.1pl2)
177df9de0ebSDavid E. O'Brien23   August 1998 (bzip2, version 0.9.0)
178df9de0ebSDavid E. O'Brien 8     June 1999 (bzip2, version 0.9.5)
179df9de0ebSDavid E. O'Brien 4     Sept 1999 (bzip2, version 0.9.5d)
180df9de0ebSDavid E. O'Brien 5      May 2000 (bzip2, version 1.0pre8)
181ed14b6e0SMaxim Sobolev30 December 2001 (bzip2, version 1.0.2pre1)