Home | History | Annotate | Line # | Download | only in dist
PACKAGERS revision 1.1
      1  1.1  joerg 
      2  1.1  joerg Information to packagers of XZ Utils
      3  1.1  joerg ====================================
      4  1.1  joerg 
      5  1.1  joerg     0. Preface
      6  1.1  joerg     1. Package naming
      7  1.1  joerg     2. Package description
      8  1.1  joerg     3. License
      9  1.1  joerg     4. configure options
     10  1.1  joerg     5. Additional documentation
     11  1.1  joerg     6. Extra files
     12  1.1  joerg     7. Installing XZ Utils and LZMA Utils in parallel
     13  1.1  joerg     8. Example
     14  1.1  joerg 
     15  1.1  joerg 
     16  1.1  joerg 0. Preface
     17  1.1  joerg ----------
     18  1.1  joerg 
     19  1.1  joerg     This document is meant for people who create and maintain XZ Utils
     20  1.1  joerg     packages for operating system distributions. The focus is on GNU/Linux
     21  1.1  joerg     systems, but most things apply to other systems too.
     22  1.1  joerg 
     23  1.1  joerg     While the standard "configure && make DESTDIR=$PKG install" should
     24  1.1  joerg     give a pretty good package, there are some details which packagers
     25  1.1  joerg     may want to tweak.
     26  1.1  joerg 
     27  1.1  joerg     Packagers should also read the INSTALL file.
     28  1.1  joerg 
     29  1.1  joerg 
     30  1.1  joerg 1. Package naming
     31  1.1  joerg -----------------
     32  1.1  joerg 
     33  1.1  joerg     The preferred name for the XZ Utils package is "xz", because that's
     34  1.1  joerg     the name of the upstream tarball. Naturally you may have good reasons
     35  1.1  joerg     to use some other name; I won't get angry about it. ;-) It's just nice
     36  1.1  joerg     to be able to point people to the correct package name without asking
     37  1.1  joerg     what distro they have.
     38  1.1  joerg 
     39  1.1  joerg     If your distro policy is to split things into small pieces, here is
     40  1.1  joerg     one suggestion:
     41  1.1  joerg 
     42  1.1  joerg         xz              xz, xzdec, scripts (xzdiff, xzgrep, etc.), docs
     43  1.1  joerg         xz-lzma         lzma, unlzma, lzcat, lzgrep etc. symlinks and
     44  1.1  joerg                         lzmadec binary for compatibility with LZMA Utils
     45  1.1  joerg         liblzma         liblzma.so.*
     46  1.1  joerg         liblzma-devel   liblzma.so, liblzma.a, API headers
     47  1.1  joerg 
     48  1.1  joerg 
     49  1.1  joerg 2. Package description
     50  1.1  joerg ----------------------
     51  1.1  joerg 
     52  1.1  joerg     Here is a suggestion which you may use as the package description.
     53  1.1  joerg     If you can use only one-line description, pick only the first line.
     54  1.1  joerg     Naturally, feel free to use some other description if you find it
     55  1.1  joerg     better, and maybe send it to me too.
     56  1.1  joerg 
     57  1.1  joerg         Library and command line tools for XZ and LZMA compressed files
     58  1.1  joerg 
     59  1.1  joerg         XZ Utils provide a general purpose data compression library
     60  1.1  joerg         and command line tools. The native file format is the .xz
     61  1.1  joerg         format, but also the legacy .lzma format is supported. The .xz
     62  1.1  joerg         format supports multiple compression algorithms, of which LZMA2
     63  1.1  joerg         is currently the primary algorithm. With typical files, XZ Utils
     64  1.1  joerg         create about 30 % smaller files than gzip.
     65  1.1  joerg 
     66  1.1  joerg     If you are splitting XZ Utils into multiple packages, here are some
     67  1.1  joerg     suggestions for package descriptions:
     68  1.1  joerg 
     69  1.1  joerg     xz:
     70  1.1  joerg 
     71  1.1  joerg         Command line tools for XZ and LZMA compressed files
     72  1.1  joerg 
     73  1.1  joerg         This package includes the xz compression tool and other command
     74  1.1  joerg         line tools from XZ Utils. xz has command line syntax similar to
     75  1.1  joerg         that of gzip. The native file format is the .xz format, but also
     76  1.1  joerg         the legacy .lzma format is supported. The .xz format supports
     77  1.1  joerg         multiple compression algorithms, of which LZMA2 is currently the
     78  1.1  joerg         primary algorithm. With typical files, XZ Utils create about 30 %
     79  1.1  joerg         smaller files than gzip.
     80  1.1  joerg 
     81  1.1  joerg         Note that this package doesn't include the files needed for
     82  1.1  joerg         LZMA Utils 4.32.x compatibility. Install also the xz-lzma
     83  1.1  joerg         package to make XZ Utils emulate LZMA Utils 4.32.x.
     84  1.1  joerg 
     85  1.1  joerg     xz-lzma:
     86  1.1  joerg 
     87  1.1  joerg         LZMA Utils emulation with XZ Utils
     88  1.1  joerg 
     89  1.1  joerg         This package includes executables and symlinks to make
     90  1.1  joerg         XZ Utils emulate lzma, unlzma, lzcat, and other command
     91  1.1  joerg         line tools found from the legacy LZMA Utils 4.32.x package.
     92  1.1  joerg 
     93  1.1  joerg     liblzma:
     94  1.1  joerg 
     95  1.1  joerg         Library for XZ and LZMA compressed files
     96  1.1  joerg 
     97  1.1  joerg         liblzma is a general purpose data compression library with
     98  1.1  joerg         an API similar to that of zlib. liblzma supports multiple
     99  1.1  joerg         algorithms, of which LZMA2 is currently the primary algorithm.
    100  1.1  joerg         The native file format is .xz, but also the legacy .lzma
    101  1.1  joerg         format and raw streams (no headers at all) are supported.
    102  1.1  joerg 
    103  1.1  joerg         This package includes the shared library.
    104  1.1  joerg 
    105  1.1  joerg     liblzma-devel:
    106  1.1  joerg 
    107  1.1  joerg         Library for XZ and LZMA compressed files
    108  1.1  joerg 
    109  1.1  joerg         This package includes the API headers, static library, and
    110  1.1  joerg         other development files related to liblzma.
    111  1.1  joerg 
    112  1.1  joerg 
    113  1.1  joerg 3. License
    114  1.1  joerg ----------
    115  1.1  joerg 
    116  1.1  joerg     If the package manager supports a license field, you probably should
    117  1.1  joerg     put GPLv2+ there (GNU GPL v2 or later). The interesting parts of
    118  1.1  joerg     XZ Utils are in the public domain, but some less important files
    119  1.1  joerg     ending up into the binary package are under GPLv2+. So it is simplest
    120  1.1  joerg     to just say GPLv2+ if you cannot specify "public domain and GPLv2+".
    121  1.1  joerg 
    122  1.1  joerg     If you split XZ Utils into multiple packages as described earlier
    123  1.1  joerg     in this file, liblzma and liblzma-dev packages will contain only
    124  1.1  joerg     public domain code (from XZ Utils at least; compiler or linker may
    125  1.1  joerg     add some third-party code, which may be copyrighted).
    126  1.1  joerg 
    127  1.1  joerg 
    128  1.1  joerg 4. configure options
    129  1.1  joerg --------------------
    130  1.1  joerg 
    131  1.1  joerg     Unless you are building a package for a distribution that is meant
    132  1.1  joerg     only for embedded systems, don't use the following configure options:
    133  1.1  joerg 
    134  1.1  joerg         --enable-debug
    135  1.1  joerg         --enable-encoders (*)
    136  1.1  joerg         --enable-decoders
    137  1.1  joerg         --enable-match-finders
    138  1.1  joerg         --enable-checks
    139  1.1  joerg         --enable-small (*)
    140  1.1  joerg         --disable-threads (*)
    141  1.1  joerg 
    142  1.1  joerg     (*) These are OK when building xzdec and lzmadec as described
    143  1.1  joerg         in INSTALL.
    144  1.1  joerg 
    145  1.1  joerg     xzdec and lzmadec don't provide any functionality that isn't already
    146  1.1  joerg     available in the xz tool. Shipping xzdec and lzmadec without size
    147  1.1  joerg     optimization and statically-linked liblzma isn't very useful. Doing
    148  1.1  joerg     that would give users the xzdec man page, which may make it easier
    149  1.1  joerg     for people to find out that such tools exists, but the executables
    150  1.1  joerg     wouldn't have any advantage over the full-featured xz.
    151  1.1  joerg 
    152  1.1  joerg 
    153  1.1  joerg 5. Additional documentation
    154  1.1  joerg ---------------------------
    155  1.1  joerg 
    156  1.1  joerg     "make install" copies some additional documentation to $docdir
    157  1.1  joerg     (--docdir in configure). There is a copy of the GNU GPL v2, which
    158  1.1  joerg     can be replaced with a symlink if your distro ships with shared
    159  1.1  joerg     copies of the common license texts.
    160  1.1  joerg 
    161  1.1  joerg     liblzma API is currently only documented using Doxygen tags in the
    162  1.1  joerg     API headers. It hasn't been tested much how good results Doxygen
    163  1.1  joerg     is able to make from the tags (e.g. Doxyfile might need tweaking,
    164  1.1  joerg     the tagging may need to be improved etc.), so it might be simpler
    165  1.1  joerg     to just let people read docs directly from the .h files for now,
    166  1.1  joerg     and also save quite a bit in package size at the same time.
    167  1.1  joerg 
    168  1.1  joerg 
    169  1.1  joerg 6. Extra files
    170  1.1  joerg --------------
    171  1.1  joerg 
    172  1.1  joerg     The "extra" directory contains some small extra tools or other files.
    173  1.1  joerg     The exact set of extra files can vary between XZ Utils releases. The
    174  1.1  joerg     extra files have only limited use or they are too dangerous to be
    175  1.1  joerg     put directly to $bindir (7z2lzma.sh is a good example, since it can
    176  1.1  joerg     silently create corrupt output if certain conditions are not met).
    177  1.1  joerg 
    178  1.1  joerg     If you feel like it, you may copy the extra directory under the doc
    179  1.1  joerg     directory (e.g. /usr/share/doc/xz/extra). Maybe some people will find
    180  1.1  joerg     them useful. However, most people needing these tools probably are
    181  1.1  joerg     able to find them from the source package too.
    182  1.1  joerg 
    183  1.1  joerg     The "debug" directory contains some tools that are useful only when
    184  1.1  joerg     hacking on XZ Utils. Don't package these tools.
    185  1.1  joerg 
    186  1.1  joerg 
    187  1.1  joerg 7. Installing XZ Utils and LZMA Utils in parallel
    188  1.1  joerg -------------------------------------------------
    189  1.1  joerg 
    190  1.1  joerg     XZ Utils and LZMA Utils 4.32.x can be installed in parallel by
    191  1.1  joerg     omitting the compatibility symlinks (lzma, unlzma, lzcat, lzgrep etc.)
    192  1.1  joerg     from the XZ Utils package. It's probably a good idea to still package
    193  1.1  joerg     the symlinks into a separate package so that users may choose if they
    194  1.1  joerg     want to use XZ Utils or LZMA Utils for handling .lzma files.
    195  1.1  joerg 
    196  1.1  joerg 
    197  1.1  joerg 8. Example
    198  1.1  joerg ----------
    199  1.1  joerg 
    200  1.1  joerg     Here is an example for i686 GNU/Linux that
    201  1.1  joerg       - links xz and lzmainfo against shared liblzma;
    202  1.1  joerg       - links size-optimized xzdec and lzmadec against static liblzma
    203  1.1  joerg         while avoiding libpthread dependency;
    204  1.1  joerg       - includes only shared liblzma in the final package; and
    205  1.1  joerg       - copies also the "extra" directory to the package.
    206  1.1  joerg 
    207  1.1  joerg     PKG=/tmp/xz-pkg
    208  1.1  joerg     tar xf xz-x.y.z.tar.gz
    209  1.1  joerg     cd xz-x.y.z
    210  1.1  joerg     ./configure \
    211  1.1  joerg             --prefix=/usr \
    212  1.1  joerg             --disable-static \
    213  1.1  joerg             --disable-xzdec \
    214  1.1  joerg             --disable-lzmadec \
    215  1.1  joerg             CFLAGS='-march=i686 -mtune=generic -O2'
    216  1.1  joerg     make
    217  1.1  joerg     make DESTDIR=$PKG install-strip
    218  1.1  joerg     make clean
    219  1.1  joerg     ./configure \
    220  1.1  joerg             --prefix=/usr \
    221  1.1  joerg             --disable-shared \
    222  1.1  joerg             --disable-nls \
    223  1.1  joerg             --disable-encoders \
    224  1.1  joerg             --enable-small \
    225  1.1  joerg             --disable-threads \
    226  1.1  joerg             CFLAGS='-march=i686 -mtune=generic -Os'
    227  1.1  joerg     make -C src/liblzma
    228  1.1  joerg     make -C src/xzdec
    229  1.1  joerg     make -C src/xzdec DESTDIR=$PKG install-strip
    230  1.1  joerg     cp -a extra $PKG/usr/share/doc/xz
    231  1.1  joerg 
    232