
This is a port of bzip2 1.0.8 to MSDOS/DJGPP.

  bzip2 and libbzip2 are a freely available, patent free, high-quality data
  compressor.  It typically compresses files to within 10% to 15% of the best
  available techniques (the PPM family of statistical compressors), whilst
  being around twice as fast at compression and six times faster at
  decompression.  The command-line options are deliberately very similar to
  those of GNU gzip, but they are not identical.



1.:     DJGPP specific changes.
        =======================

        When compressing a file, bzip records the attribute bits, time
        stamp and the original file name in the compressed file giving
        the compressed file the same attributes, time stamp and file
        name as the original one.  To identify this file as bzip compressed,
        an ".bz2" extension is appended to the file name. When bzip
        decompress a file, the new file gets the same file name as the
        compressed one, after the ".bz2" extension has been removed, and
        the same attribute bits and time stamp. Thus the decompressed
        file will have the same attribute bits, time stamp and file name
        as the original file.
        This way of recording attribute bits, time stamp and original
        file name presents no difficulty in LFN environments like UNIX
        or WIN9X but it does in SFN environments like MSDOS or WIN9X
        with LFN=n where 8.3 file name restrictions applies.
        This DJGPP port of bzip will detect at run time if LFN support
        is available or not and will select an appropiate rule for create
        the file names.

        Due to the 8.3 file name retriction under MSDOS and WIN9X with
        LFN=n, there is no way to properly preserve file name and extension
        at the same time.
        This port offers the user the choice between two rules to create
        the name of the compressed files. The first rule (default) will
        preserve the file name at the cost of truncating the extension.
        The second rule will preserve the extension and truncate the file
        name.  The different rules are selected by omitting or setting the
        -n flag.

        Rule 1: file name preserving and extension truncating.
        This is the default rule. If the "-n" flag is omitted then this
        rule will be used.
        With this rule the following types of file names will be generated:

        When compressing:
        filename     becomes filename.bz2
        filename.e   becomes filename.ebz
        filename.ex  becomes filename.exb
        filename.ext becomes filename.exb
        filename.tar becomes filename.tbz

        And when uncompressing:
        filename.bz2 becomes filename
        filename.bz  becomes filename
        filename.ebz becomes filename.e
        filename.exb becomes filename.ex
        filename.tbz becomes filename.tar
        anyothername becomes anyothername.out


        Rule 2: file name truncating and extension preserving.
        This rule must be explicity enabled by setting the "-n" flag.
        With this rule backward compatibility with other MSDOS ports of
        bzip2 is achieved.
        With this rule the following types of file names will be generated:

        When compressing:
        filename     becomes filename.bz2
        filename.e   becomes filena_e.bz2
        filename.ex  becomes filen_ex.bz2
        filename.ext becomes file_ext.bz2
        filename.tar becomes filename.tbz
    
        And when uncompressing:
        filename.bz2 becomes filename
        filena_e.bz2 becomes filena.e
        filen_ex.bz2 becomes filen.ex
        file_ext.bz2 becomes file.ext
        filename.tbz becomes filename.tar
        anyothername becomes anyothername.out

        The same rule must be used for compression and uncompression.
        Under WIN9X with LFN=y the "-n" flag is ignored.
    
        Under WIN9X, where file name restriction does not apply,
        the default naming rules for compressed and original files
        are used:
    
        When compressing:
        longfilename               becomes longfilename.bz2
        longfilename.extension     becomes longfilename.extension.bz2
        longfilename.tar           becomes longfilename.tar.bz2

        And when uncompressing:
        longfilename.bz2           becomes longfilename
        longfilename.extension.bz2 becomes longfilename.extension
        longfilename.tar.bz2       becomes longfilename.tar
        anyothername               becomes anyothername.out

        As usual, all djgpp specific files (config.bat, diffs, README files,
        etc.) are stored in the /djgpp directory.

        For further information about bzip2 please read the info docs and NEWS file.


2.:     Installing the binary package.
        ==============================

2.1.:   Copy the binary distribution into the top DJGPP installation directory,
        just unzip it preserving the directory structure running *ONE* of the
        following commands:
          unzip32 bz2-108b.zip      or
          djtarx bz2-108b.zip       or
          pkunzip -d bz2-108b.zip
        This will install bzip2.exe and bzip2recover.exe and some other
        shell scripts in the /bin directory.  It will also install the
        man pages but it will not install the header and library.  These
        are distributed in a separate zip file.

        If you need the header and library (bzlib.h and libbz2.a) to link
        with your own applications, just unzip the library distribution
        preserving the directory structure running *ONE* of the following
        commands:
          unzip32 bz2-108a.zip      or
          djtarx bz2-108a.zip       or
          pkunzip -d bz2-108a.zip

        You can add to your DJGPP.ENV file the following lines to setup
        the BZIP2 and BZIP environment variables:

[bzip2]
BZIP2=
BZIP=

[bunzip2]
BZIP2=
BZIP=

[bzcat]
BZIP2=
BZIP=

        bzip2, bunzip2 or bzcat will read arguments from the environment
        variables BZIP2 and BZIP, in that order, and will process them
        before any arguments read from the command line. This gives you
        a convenient way to supply default arguments.
        For the list of arguments available, read the HTML and man docs.

        The bzmore, bzdiff and bzgrep shell scripts will require the DJGPP
        ports of less, cmp, diff, grep, mktemp and bash.


3.:     Building the binaries from sources.
        ===================================

3.1.:   Create a temporary directory and copy the source package into the
        directory.  If you download the source distribution from one of the
        DJGPP sites, just unzip it preserving the directory structure
        running *ONE* of the following commands:
          unzip32 bz2-108s.zip      or
          djtarx bz2-108s.zip       or
          pkunzip -d bz2-108s.zip

3.2.:   To build the binaries you will need the following binary packages:
          djdev205.zip (or a later but NOT a prior version)
          bsh417br3.zip (or a later but NOT a prior version)
          gccNNNb.zip, gppNNN.zip, bnuNNNb.zip, makNNNb.zip, filNNNb.zip,
          shlNNNb.zip, txtNNNb.zip, txiNNNb.zip, grepNNNb.zip, sedNNNb.zip,
          pdcurNNNa.zip, mktmpNNb.zip and gwkNNNb.zip.

        NNN represents the latest version number of the binary packages.
        All this packages can be found in the /v2gnu directory of any
        ftp.delorie.com mirror.
        You will need bsh417br3.zip or later and *NOT* a prior version or
        the build will fail.  The same applies to djdev205.zip.

3.3.:   To build the binearies and the library chdir into the top src directory
        (aka bzip2-1.0) and run the make command like this:

          make

        If the test failed, then the files sample?.bz2 and sample?.ref had
        been converted from UNIX style to MSDOS style. In this case you will
        have to unzip the sources into a new directory and copy the files:

          sample1.bz2, sample2.bz2, sample3.bz2,
          sample1.ref, sample2.ref, sample3.ref

        manually into the directory bzip2-1.0.
        Then type the command:

          make test

3.4.:   To see what the installation process will do, type the following
        command:

          make -n install                            or
          make -n install PREFIX=z:/some/other/dir   respectively.

        PREFIX will default to /dev/env/DJDIR. If you prefer to install into
        some other directory then set PREFIX to the appropiate value at the
        command line. The -n instructs make to show the commands it would
        execute, but does not actually execute them.

        To install the binaries and docs only (bzip2.exe, bunzip2.exe,
        bzcat.exe, bzip2recover.exe and the Info and man docs) type the
        following command:

          make install-bin                           or
          make install-bin PREFIX=z:/some/other/dir  respectively.

        To install the header and library only (bzlib.h and libbz2.a)
        type the following command:

          make install-lib                           or
          make install-lib PREFIX=z:/some/other/dir  respectively.

        To install everything (bzip2.exe, bunzip2.exe, bzip2recover.exe,
        bzcat.exe, the library libbz2.a and the header bzlib.h, and the
        info and man docs) type the following command:

          make install                               or
          make install PREFIX=z:/some/other/dir      respectively.


        Send bzip2 specific bug reports to <bzip2-devel@sourceware.org>.
        Send suggestions and bug reports concerning the DJGPP port
        to comp.os.msdos.djgpp or <djgpp@delorie.com>.


Enjoy.

          Guerrero, Juan Manuel <juan.guerrero@gmx.de>
