Blame README

Packit Service 4a2782
Packit Service 4a2782
                            Compress-Raw-Zlib
Packit Service 4a2782
Packit Service 4a2782
                         Version 2.081
Packit Service 4a2782
Packit Service 4a2782
                               4 April 2018
Packit Service 4a2782
Packit Service 4a2782
       Copyright (c) 2005-2018 Paul Marquess. All rights reserved.
Packit Service 4a2782
          This program is free software; you can redistribute it
Packit Service 4a2782
           and/or modify it under the same terms as Perl itself.
Packit Service 4a2782
Packit Service 4a2782
              The directory zlib-src contains a subset of the
Packit Service 4a2782
             source files copied directly from zlib version 1.2.11.
Packit Service 4a2782
                  These files are Copyright(C) 1995-2017
Packit Service 4a2782
                     Jean-loup Gailly and Mark Adler.
Packit Service 4a2782
             Full source for the zlib library is available at
Packit Service 4a2782
                            http://www.zlib.org
Packit Service 4a2782
Packit Service 4a2782
DESCRIPTION
Packit Service 4a2782
-----------
Packit Service 4a2782
Packit Service 4a2782
This module provides a Perl interface to the zlib compression library. 
Packit Service 4a2782
Packit Service 4a2782
PREREQUISITES
Packit Service 4a2782
-------------
Packit Service 4a2782
Packit Service 4a2782
Before you can build Compress-Raw-Zlib you need to have the following
Packit Service 4a2782
installed on your system:
Packit Service 4a2782
Packit Service 4a2782
    * A C compiler
Packit Service 4a2782
Packit Service 4a2782
    * Perl 5.006 or better.
Packit Service 4a2782
Packit Service 4a2782
By default, Compress-Raw-Zlib will build its own private copy of the
Packit Service 4a2782
zlib library. If you want to use a different version of
Packit Service 4a2782
zlib, follow the instructions in the section called
Packit Service 4a2782
"Controlling the version of zlib used by Compress-Raw-Zlib"
Packit Service 4a2782
later in this document.
Packit Service 4a2782
Packit Service 4a2782
BUILDING THE MODULE
Packit Service 4a2782
-------------------
Packit Service 4a2782
Packit Service 4a2782
Assuming you have met all the prerequisites, the module can now be built
Packit Service 4a2782
using this sequence of commands:
Packit Service 4a2782
Packit Service 4a2782
    perl Makefile.PL
Packit Service 4a2782
    make
Packit Service 4a2782
    make test
Packit Service 4a2782
Packit Service 4a2782
INSTALLATION
Packit Service 4a2782
------------
Packit Service 4a2782
Packit Service 4a2782
To install Compress-Raw-Zlib, run the command below:
Packit Service 4a2782
Packit Service 4a2782
    make install
Packit Service 4a2782
Packit Service 4a2782
Controlling the version of zlib used by Compress-Raw-Zlib
Packit Service 4a2782
----------------------------------------------------------
Packit Service 4a2782
Packit Service 4a2782
Compress-Raw-Zlib interfaces to the zlib compression library. There
Packit Service 4a2782
are three options available to control which version/instance of the
Packit Service 4a2782
zlib library is used:
Packit Service 4a2782
Packit Service 4a2782
    1. Build a private copy of the zlib library using the
Packit Service 4a2782
       zlib library source that is included with this module.
Packit Service 4a2782
       This is the default and recommended option.
Packit Service 4a2782
Packit Service 4a2782
    2. Build a private copy of the zlib library using a standard
Packit Service 4a2782
       zlib source distribution.
Packit Service 4a2782
Packit Service 4a2782
    3. Use a pre-built zlib library.
Packit Service 4a2782
Packit Service 4a2782
Note that if you intend to use either Option 2 or 3, you need to have
Packit Service 4a2782
zlib version 1.2.0 or better.
Packit Service 4a2782
Packit Service 4a2782
The contents of the file config.in are used to control which of the
Packit Service 4a2782
three options is actually used. This file is read during the
Packit Service 4a2782
Packit Service 4a2782
    perl Makefile.PL
Packit Service 4a2782
Packit Service 4a2782
step of the build, so remember to make any required changes to config.in
Packit Service 4a2782
before building this module.
Packit Service 4a2782
Packit Service 4a2782
  Option 1
Packit Service 4a2782
  --------
Packit Service 4a2782
 
Packit Service 4a2782
  For option 1, edit the file config.in and set the variables in it
Packit Service 4a2782
  as follows:
Packit Service 4a2782
Packit Service 4a2782
      BUILD_ZLIB   = True
Packit Service 4a2782
      INCLUDE      = ./zlib-src
Packit Service 4a2782
      LIB          = ./zlib-src
Packit Service 4a2782
      OLD_ZLIB     = False
Packit Service 4a2782
      GZIP_OS_CODE = AUTO_DETECT
Packit Service 4a2782
Packit Service 4a2782
  Option 2
Packit Service 4a2782
  --------
Packit Service 4a2782
Packit Service 4a2782
  For option 2, fetch a copy of the zlib source distribution from
Packit Service 4a2782
  http://www.zlib.org and unpack it into the Compress-Raw-Zlib source
Packit Service 4a2782
  directory. Assuming you have fetched zlib 1.2.11,
Packit Service 4a2782
  it will create a directory called zlib-1.2.11.
Packit Service 4a2782
Packit Service 4a2782
  Now set the variables in the file config.in as follows (if the version
Packit Service 4a2782
  you have fetched isn't 1.2.11, change the INCLUDE and LIB
Packit Service 4a2782
  variables appropriately):
Packit Service 4a2782
Packit Service 4a2782
      BUILD_ZLIB   = True
Packit Service 4a2782
      INCLUDE      = ./zlib-1.2.11
Packit Service 4a2782
      LIB          = ./zlib-1.2.11
Packit Service 4a2782
      OLD_ZLIB     = False
Packit Service 4a2782
      GZIP_OS_CODE = AUTO_DETECT
Packit Service 4a2782
Packit Service 4a2782
  Option 3
Packit Service 4a2782
  --------
Packit Service 4a2782
Packit Service 4a2782
  For option 3, you need to find out where zlib is stored on your
Packit Service 4a2782
  system.  There are two parts to this.
Packit Service 4a2782
Packit Service 4a2782
  First, find the directory where the zlib library is stored (some
Packit Service 4a2782
  common names for the library are libz.a and libz.so). Set the LIB variable
Packit Service 4a2782
  in the config.in file to that directory.
Packit Service 4a2782
Packit Service 4a2782
  Secondly, find the directory where the file zlib.h is stored. Now set
Packit Service 4a2782
  the INCLUDE variable in the config.in file to that directory.
Packit Service 4a2782
Packit Service 4a2782
  Next set BUILD_ZLIB to False.
Packit Service 4a2782
Packit Service 4a2782
  Finally, if you are running zlib 1.0.5 or older, set the OLD_ZLIB
Packit Service 4a2782
  variable to True. Otherwise set it to False.
Packit Service 4a2782
Packit Service 4a2782
  As an example, if the zlib library on your system is in
Packit Service 4a2782
  /usr/local/lib, zlib.h is in /usr/local/include and zlib is more
Packit Service 4a2782
  recent than version 1.0.5, the variables in config.in should be set as
Packit Service 4a2782
  follows:
Packit Service 4a2782
Packit Service 4a2782
      BUILD_ZLIB   = False
Packit Service 4a2782
      INCLUDE      = /usr/local/include
Packit Service 4a2782
      LIB          = /usr/local/lib
Packit Service 4a2782
      OLD_ZLIB     = False
Packit Service 4a2782
      GZIP_OS_CODE = AUTO_DETECT
Packit Service 4a2782
Packit Service 4a2782
Setting the Gzip OS Code
Packit Service 4a2782
------------------------
Packit Service 4a2782
Packit Service 4a2782
Every gzip stream stores a byte in its header to identify the Operating
Packit Service 4a2782
System that was used to create the gzip stream. When you build Compress-Raw-Zlib it will attempt to determine the value that is correct for
Packit Service 4a2782
your Operating System. This will then be used by IO::Compress::Gzip as the
Packit Service 4a2782
default value for the OS byte in all gzip headers it creates.
Packit Service 4a2782
Packit Service 4a2782
The variable GZIP_OS_CODE in the config.in file controls the setting of
Packit Service 4a2782
this value when building Compress-Raw-Zlib. If GZIP_OS_CODE is set to
Packit Service 4a2782
AUTO_DETECT, Compress-Raw-Zlib will attempt to determine the correct value for
Packit Service 4a2782
your Operating System.
Packit Service 4a2782
Packit Service 4a2782
Alternatively, you can override auto-detection of the default OS code and
Packit Service 4a2782
explicitly set it yourself. Set the GZIP_OS_CODE variable in the config.in
Packit Service 4a2782
file to be a number between 0 and 255. For example
Packit Service 4a2782
Packit Service 4a2782
    GZIP_OS_CODE = 3
Packit Service 4a2782
Packit Service 4a2782
See RFC 1952 for valid OS codes that can be used.
Packit Service 4a2782
Packit Service 4a2782
If you are running one of the less popular Operating Systems, it is
Packit Service 4a2782
possible that the default value picked by this module is incorrect or the
Packit Service 4a2782
default value (3) is used when there is a better value available. When
Packit Service 4a2782
Compress-Raw-Zlib cannot determine what operating system you are running, it
Packit Service 4a2782
will use the default value 3 for the OS code.
Packit Service 4a2782
Packit Service 4a2782
If you find you have to change this value, because you think the value auto
Packit Service 4a2782
detected is incorrect, please take a few moments to contact the author of
Packit Service 4a2782
this module.
Packit Service 4a2782
Packit Service 4a2782
TROUBLESHOOTING
Packit Service 4a2782
---------------
Packit Service 4a2782
Packit Service 4a2782
Undefined Symbol gzsetparams
Packit Service 4a2782
----------------------------
Packit Service 4a2782
Packit Service 4a2782
If you get the error shown below when you run the Compress-Raw-Zlib test
Packit Service 4a2782
harness it probably means you are running a copy of zlib that is
Packit Service 4a2782
version 1.0.5 or older.
Packit Service 4a2782
Packit Service 4a2782
t/01version.........Can't load 'blib/arch/auto/Compress/Zlib/Zlib.so' for
Packit Service 4a2782
                    module Compress::Raw::Zlib: blib/arch/auto/Compress/Raw/Zlib/Zlib.so:
Packit Service 4a2782
                    undefined symbol: gzsetparams at ...
Packit Service 4a2782
Packit Service 4a2782
There are two ways to fix this problem:
Packit Service 4a2782
Packit Service 4a2782
    1. Upgrade to the latest version of zlib.
Packit Service 4a2782
Packit Service 4a2782
    2. Edit config.in and set the OLD_ZLIB variable to True.
Packit Service 4a2782
Packit Service 4a2782
Test Harness 01version fails
Packit Service 4a2782
----------------------------
Packit Service 4a2782
If the 01version test harness fails, and the problem isn't covered by the
Packit Service 4a2782
scenario above, it probably means that you have two versions of
Packit Service 4a2782
zlib installed on your system.
Packit Service 4a2782
Packit Service 4a2782
Run the command below to see if this is indeed the case
Packit Service 4a2782
Packit Service 4a2782
    make test TEST_VERBOSE=1 TEST_FILES=t/01version.t
Packit Service 4a2782
Packit Service 4a2782
Try removing the one you don't want to use and rebuild.
Packit Service 4a2782
Packit Service 4a2782
Solaris build fails with "language optional software package not installed"
Packit Service 4a2782
---------------------------------------------------------------------------
Packit Service 4a2782
Packit Service 4a2782
If you are trying to build this module under Solaris and you get an
Packit Service 4a2782
error message like this
Packit Service 4a2782
Packit Service 4a2782
    /usr/ucb/cc: language optional software package not installed
Packit Service 4a2782
Packit Service 4a2782
it means that Perl cannot find the C compiler on your system. The cryptic
Packit Service 4a2782
message is just Sun's way of telling you that you haven't bought their
Packit Service 4a2782
C compiler.
Packit Service 4a2782
Packit Service 4a2782
When you build a Perl module that needs a C compiler, the Perl build
Packit Service 4a2782
system tries to use the same C compiler that was used to build perl
Packit Service 4a2782
itself. In this case your Perl binary was built with a C compiler that
Packit Service 4a2782
lived in /usr/ucb.
Packit Service 4a2782
Packit Service 4a2782
To continue with building this module, you need to get a C compiler,
Packit Service 4a2782
or tell Perl where your C compiler is, if you already have one.
Packit Service 4a2782
Packit Service 4a2782
Assuming you have now got a C compiler, what you do next will be dependent
Packit Service 4a2782
on what C compiler you have installed. If you have just installed Sun's
Packit Service 4a2782
C compiler, you shouldn't have to do anything. Just try rebuilding
Packit Service 4a2782
this module.
Packit Service 4a2782
Packit Service 4a2782
If you have installed another C compiler, say gcc, you have to tell perl
Packit Service 4a2782
how to use it instead of /usr/ucb/cc.
Packit Service 4a2782
Packit Service 4a2782
This set of options seems to work if you want to use gcc. Your mileage
Packit Service 4a2782
may vary.
Packit Service 4a2782
Packit Service 4a2782
    perl Makefile.PL CC=gcc CCCDLFLAGS=-fPIC OPTIMIZE=" "
Packit Service 4a2782
    make test
Packit Service 4a2782
Packit Service 4a2782
If that doesn't work for you, it's time to make changes to the Makefile
Packit Service 4a2782
by hand. Good luck!
Packit Service 4a2782
Packit Service 4a2782
Solaris build fails with "gcc: unrecognized option `-KPIC'"
Packit Service 4a2782
-----------------------------------------------------------
Packit Service 4a2782
Packit Service 4a2782
You are running Solaris and you get an error like this when you try to
Packit Service 4a2782
build this Perl module
Packit Service 4a2782
Packit Service 4a2782
    gcc: unrecognized option `-KPIC'
Packit Service 4a2782
Packit Service 4a2782
This symptom usually means that you are using a Perl binary that has been
Packit Service 4a2782
built with the Sun C compiler, but you are using gcc to build this module.
Packit Service 4a2782
Packit Service 4a2782
When Perl builds modules that need a C compiler, it will attempt to use
Packit Service 4a2782
the same C compiler and command line options that was used to build perl
Packit Service 4a2782
itself. In this case "-KPIC" is a valid option for the Sun C compiler,
Packit Service 4a2782
but not for gcc. The equivalent option for gcc is "-fPIC".
Packit Service 4a2782
Packit Service 4a2782
The solution is either:
Packit Service 4a2782
Packit Service 4a2782
    1. Build both Perl and this module with the same C compiler, either
Packit Service 4a2782
       by using the Sun C compiler for both or gcc for both.
Packit Service 4a2782
Packit Service 4a2782
    2. Try generating the Makefile for this module like this perl
Packit Service 4a2782
Packit Service 4a2782
           perl Makefile.PL CC=gcc CCCDLFLAGS=-fPIC OPTIMIZE=" " LD=gcc
Packit Service 4a2782
           make test
Packit Service 4a2782
Packit Service 4a2782
       This second option seems to work when mixing a Perl binary built
Packit Service 4a2782
       with the Sun C compiler and this module built with gcc. Your
Packit Service 4a2782
       mileage may vary.
Packit Service 4a2782
Packit Service 4a2782
HP-UX Notes
Packit Service 4a2782
-----------
Packit Service 4a2782
Packit Service 4a2782
I've had a report that when building Compress-Raw-Zlib under HP-UX that it
Packit Service 4a2782
is necessary to have first built the zlib library with the -fpic
Packit Service 4a2782
option.
Packit Service 4a2782
Packit Service 4a2782
Linux Notes
Packit Service 4a2782
-----------
Packit Service 4a2782
Packit Service 4a2782
Although most Linux distributions already come with zlib, some
Packit Service 4a2782
people report getting this error when they try to build this module:
Packit Service 4a2782
Packit Service 4a2782
$ make
Packit Service 4a2782
cp Zlib.pm blib/lib/Compress/Zlib.pm
Packit Service 4a2782
AutoSplitting blib/lib/Compress/Zlib.pm (blib/lib/auto/Compress/Zlib)
Packit Service 4a2782
/usr/bin/perl -I/usr/lib/perl5/5.6.1/i386-linux -I/usr/lib/perl5/5.6.1 /usr/lib/perl5/5.6.1/ExtUtils/xsubpp  -typemap /usr/lib/perl5/5.6.1/ExtUtils/typemap -typemap typemap Zlib.xs > Zlib.xsc && mv Zlib.xsc Zlib.c
Packit Service 4a2782
gcc -c -I/usr/local/include -fno-strict-aliasing -I/usr/local/include -O2 -march=i386 -mcpu=i686   -DVERSION=\"1.16\" -DXS_VERSION=\"1.16\" -fPIC -I/usr/lib/perl5/5.6.1/i386-linux/CORE  Zlib.c
Packit Service 4a2782
Zlib.xs:25:19: zlib.h: No such file or directory
Packit Service 4a2782
make: *** [Zlib.o] Error 1
Packit Service 4a2782
Packit Service 4a2782
This usually means that you have not installed the development RPM
Packit Service 4a2782
for zlib. Check for an RPM that start with "zlib-devel" in your Linux
Packit Service 4a2782
distribution.
Packit Service 4a2782
Packit Service 4a2782
Win32 Notes
Packit Service 4a2782
-----------
Packit Service 4a2782
Packit Service 4a2782
If you are running Activestate Perl (from http://www.activestate.com),
Packit Service 4a2782
it ships with a pre-compiled version of Compress-Raw-Zlib. To check if a
Packit Service 4a2782
newer version of Compress-Raw-Zlib is available run this from the command
Packit Service 4a2782
prompt
Packit Service 4a2782
Packit Service 4a2782
    C:\> ppm verify -upgrade Compress-Raw-Zlib
Packit Service 4a2782
Packit Service 4a2782
If you are not running Activestate Perl and you don't have access
Packit Service 4a2782
to a C compiler, you will not be able to build and install this module.
Packit Service 4a2782
Packit Service 4a2782
Win32 & Cygwin Notes
Packit Service 4a2782
--------------------
Packit Service 4a2782
Packit Service 4a2782
It is not possible to install Compress-Raw-Zlib using the CPAN shell.
Packit Service 4a2782
This is because the Compress-Raw-Zlib DLL is itself used by the CPAN shell
Packit Service 4a2782
and it is impossible to remove a DLL while it is already loaded under
Packit Service 4a2782
Windows.
Packit Service 4a2782
Packit Service 4a2782
The workaround is to install Compress-Raw-Zlib manually using the
Packit Service 4a2782
instructions given at the start of this file.
Packit Service 4a2782
Packit Service 4a2782
FEEDBACK
Packit Service 4a2782
--------
Packit Service 4a2782
Packit Service 4a2782
How to report a problem with Compress-Raw-Zlib.
Packit Service 4a2782
Packit Service 4a2782
To help me help you, I need all of the following information:
Packit Service 4a2782
Packit Service 4a2782
 1. The Versions of everything relevant.
Packit Service 4a2782
    This includes:
Packit Service 4a2782
Packit Service 4a2782
     a. The *complete* output from running this
Packit Service 4a2782
 
Packit Service 4a2782
            perl -V
Packit Service 4a2782
 
Packit Service 4a2782
        Do not edit the output in any way.
Packit Service 4a2782
        Note, I want you to run "perl -V" and NOT "perl -v".
Packit Service 4a2782
 
Packit Service 4a2782
        If your perl does not understand the "-V" option it is too
Packit Service 4a2782
        old. This module needs Perl version 5.004 or better.
Packit Service 4a2782
Packit Service 4a2782
     b. The version of Compress-Raw-Zlib you have.
Packit Service 4a2782
        If you have successfully installed Compress-Raw-Zlib, this one-liner
Packit Service 4a2782
        will tell you:
Packit Service 4a2782
Packit Service 4a2782
           perl -MCompress::Raw::Zlib -e 'print qq[ver $Compress::Raw::Zlib::VERSION\n]'
Packit Service 4a2782
Packit Service 4a2782
        If you are  running windows use this
Packit Service 4a2782
Packit Service 4a2782
           perl -MCompress::Raw::Zlib -e "print qq[ver $Compress::Raw::Zlib::VERSION\n]"
Packit Service 4a2782
Packit Service 4a2782
        If you haven't installed Compress-Raw-Zlib then search Compress::Raw::Zlib.pm
Packit Service 4a2782
        for a line like this:
Packit Service 4a2782
Packit Service 4a2782
          $VERSION = "2.081" ;
Packit Service 4a2782
Packit Service 4a2782
     c. The version of zlib you have used.
Packit Service 4a2782
        If you have successfully installed Compress-Raw-Zlib, this one-liner
Packit Service 4a2782
        will tell you:
Packit Service 4a2782
Packit Service 4a2782
          perl -MCompress::Raw::Zlib -e "print q[zlib ver ]. Compress::Raw::Zlib::ZLIB_VERSION.qq[\n]"
Packit Service 4a2782
Packit Service 4a2782
        If not, look at the beginning of the file zlib.h.
Packit Service 4a2782
Packit Service 4a2782
 2. If you are having problems building Compress-Raw-Zlib, send me a
Packit Service 4a2782
    complete log of what happened. Start by unpacking the Compress-Raw-Zlib
Packit Service 4a2782
    module into a fresh directory and keep a log of all the steps
Packit Service 4a2782
Packit Service 4a2782
        [edit config.in, if necessary]
Packit Service 4a2782
        perl Makefile.PL
Packit Service 4a2782
        make
Packit Service 4a2782
        make test TEST_VERBOSE=1
Packit Service 4a2782
Packit Service 4a2782
Paul Marquess <pmqs@cpan.org>