Home | History | Annotate | Line # | Download | only in dist
      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.1.2  christos         liblzma-doc     Example programs and, if enabled at build time,
     48  1.1.1.2  christos                         Doxygen-generated liblzma API docs (HTML)
     49      1.1     joerg 
     50      1.1     joerg 
     51      1.1     joerg 2. Package description
     52      1.1     joerg ----------------------
     53      1.1     joerg 
     54      1.1     joerg     Here is a suggestion which you may use as the package description.
     55      1.1     joerg     If you can use only one-line description, pick only the first line.
     56      1.1     joerg     Naturally, feel free to use some other description if you find it
     57      1.1     joerg     better, and maybe send it to me too.
     58      1.1     joerg 
     59      1.1     joerg         Library and command line tools for XZ and LZMA compressed files
     60      1.1     joerg 
     61      1.1     joerg         XZ Utils provide a general purpose data compression library
     62      1.1     joerg         and command line tools. The native file format is the .xz
     63      1.1     joerg         format, but also the legacy .lzma format is supported. The .xz
     64      1.1     joerg         format supports multiple compression algorithms, of which LZMA2
     65      1.1     joerg         is currently the primary algorithm. With typical files, XZ Utils
     66      1.1     joerg         create about 30 % smaller files than gzip.
     67      1.1     joerg 
     68      1.1     joerg     If you are splitting XZ Utils into multiple packages, here are some
     69      1.1     joerg     suggestions for package descriptions:
     70      1.1     joerg 
     71      1.1     joerg     xz:
     72      1.1     joerg 
     73      1.1     joerg         Command line tools for XZ and LZMA compressed files
     74      1.1     joerg 
     75      1.1     joerg         This package includes the xz compression tool and other command
     76      1.1     joerg         line tools from XZ Utils. xz has command line syntax similar to
     77      1.1     joerg         that of gzip. The native file format is the .xz format, but also
     78      1.1     joerg         the legacy .lzma format is supported. The .xz format supports
     79      1.1     joerg         multiple compression algorithms, of which LZMA2 is currently the
     80      1.1     joerg         primary algorithm. With typical files, XZ Utils create about 30 %
     81      1.1     joerg         smaller files than gzip.
     82      1.1     joerg 
     83      1.1     joerg         Note that this package doesn't include the files needed for
     84      1.1     joerg         LZMA Utils 4.32.x compatibility. Install also the xz-lzma
     85      1.1     joerg         package to make XZ Utils emulate LZMA Utils 4.32.x.
     86      1.1     joerg 
     87      1.1     joerg     xz-lzma:
     88      1.1     joerg 
     89      1.1     joerg         LZMA Utils emulation with XZ Utils
     90      1.1     joerg 
     91      1.1     joerg         This package includes executables and symlinks to make
     92      1.1     joerg         XZ Utils emulate lzma, unlzma, lzcat, and other command
     93      1.1     joerg         line tools found from the legacy LZMA Utils 4.32.x package.
     94      1.1     joerg 
     95      1.1     joerg     liblzma:
     96      1.1     joerg 
     97      1.1     joerg         Library for XZ and LZMA compressed files
     98      1.1     joerg 
     99      1.1     joerg         liblzma is a general purpose data compression library with
    100      1.1     joerg         an API similar to that of zlib. liblzma supports multiple
    101      1.1     joerg         algorithms, of which LZMA2 is currently the primary algorithm.
    102      1.1     joerg         The native file format is .xz, but also the legacy .lzma
    103      1.1     joerg         format and raw streams (no headers at all) are supported.
    104      1.1     joerg 
    105      1.1     joerg         This package includes the shared library.
    106      1.1     joerg 
    107      1.1     joerg     liblzma-devel:
    108      1.1     joerg 
    109      1.1     joerg         Library for XZ and LZMA compressed files
    110      1.1     joerg 
    111      1.1     joerg         This package includes the API headers, static library, and
    112      1.1     joerg         other development files related to liblzma.
    113      1.1     joerg 
    114  1.1.1.2  christos     liblzma-doc:
    115  1.1.1.2  christos 
    116  1.1.1.2  christos         liblzma API documentation in HTML and example usage
    117  1.1.1.2  christos 
    118  1.1.1.2  christos         This package includes the Doxygen-generated liblzma API
    119  1.1.1.2  christos         HTML docs and example programs showing how to use liblzma.
    120  1.1.1.2  christos 
    121      1.1     joerg 
    122      1.1     joerg 3. License
    123      1.1     joerg ----------
    124      1.1     joerg 
    125      1.1     joerg     If the package manager supports a license field, you probably should
    126      1.1     joerg     put GPLv2+ there (GNU GPL v2 or later). The interesting parts of
    127  1.1.1.2  christos     XZ Utils are under the BSD Zero Clause License (0BSD), but some less
    128  1.1.1.2  christos     important files ending up into the binary package are under GPLv2+.
    129  1.1.1.2  christos     So it is simplest to just say GPLv2+ if you cannot specify
    130  1.1.1.2  christos     "BSD0 and GPLv2+".
    131      1.1     joerg 
    132      1.1     joerg     If you split XZ Utils into multiple packages as described earlier
    133      1.1     joerg     in this file, liblzma and liblzma-dev packages will contain only
    134  1.1.1.2  christos     0BSD-licensed code from XZ Utils (compiler or linker may add some
    135  1.1.1.2  christos     third-party code which may have other licenses).
    136      1.1     joerg 
    137      1.1     joerg 
    138      1.1     joerg 4. configure options
    139      1.1     joerg --------------------
    140      1.1     joerg 
    141      1.1     joerg     Unless you are building a package for a distribution that is meant
    142      1.1     joerg     only for embedded systems, don't use the following configure options:
    143      1.1     joerg 
    144      1.1     joerg         --enable-debug
    145      1.1     joerg         --enable-encoders (*)
    146      1.1     joerg         --enable-decoders
    147      1.1     joerg         --enable-match-finders
    148      1.1     joerg         --enable-checks
    149      1.1     joerg         --enable-small (*)
    150      1.1     joerg         --disable-threads (*)
    151  1.1.1.2  christos         --disable-microlzma (*)
    152  1.1.1.2  christos         --disable-lzip-decoder (*)
    153      1.1     joerg 
    154      1.1     joerg     (*) These are OK when building xzdec and lzmadec as described
    155      1.1     joerg         in INSTALL.
    156      1.1     joerg 
    157      1.1     joerg     xzdec and lzmadec don't provide any functionality that isn't already
    158      1.1     joerg     available in the xz tool. Shipping xzdec and lzmadec without size
    159      1.1     joerg     optimization and statically-linked liblzma isn't very useful. Doing
    160      1.1     joerg     that would give users the xzdec man page, which may make it easier
    161      1.1     joerg     for people to find out that such tools exists, but the executables
    162      1.1     joerg     wouldn't have any advantage over the full-featured xz.
    163      1.1     joerg 
    164      1.1     joerg 
    165      1.1     joerg 5. Additional documentation
    166      1.1     joerg ---------------------------
    167      1.1     joerg 
    168      1.1     joerg     "make install" copies some additional documentation to $docdir
    169      1.1     joerg     (--docdir in configure). There is a copy of the GNU GPL v2, which
    170      1.1     joerg     can be replaced with a symlink if your distro ships with shared
    171      1.1     joerg     copies of the common license texts.
    172      1.1     joerg 
    173  1.1.1.2  christos     The Doxygen-generated liblzma API documentation (HTML) is built and
    174  1.1.1.2  christos     installed if the configure option --enable-doxygen is used (it's
    175  1.1.1.2  christos     disabled by default). This requires that Doxygen is available. The
    176  1.1.1.2  christos     API documentation is installed by "make install" to $docdir/api.
    177  1.1.1.2  christos 
    178  1.1.1.2  christos         NOTE: The files generated by Doxygen include content from
    179  1.1.1.2  christos         Doxygen itself. Check the license info before distributing
    180  1.1.1.2  christos         the Doxygen-generated files.
    181      1.1     joerg 
    182      1.1     joerg 
    183      1.1     joerg 6. Extra files
    184      1.1     joerg --------------
    185      1.1     joerg 
    186      1.1     joerg     The "extra" directory contains some small extra tools or other files.
    187      1.1     joerg     The exact set of extra files can vary between XZ Utils releases. The
    188      1.1     joerg     extra files have only limited use or they are too dangerous to be
    189      1.1     joerg     put directly to $bindir (7z2lzma.sh is a good example, since it can
    190      1.1     joerg     silently create corrupt output if certain conditions are not met).
    191      1.1     joerg 
    192      1.1     joerg     If you feel like it, you may copy the extra directory under the doc
    193      1.1     joerg     directory (e.g. /usr/share/doc/xz/extra). Maybe some people will find
    194      1.1     joerg     them useful. However, most people needing these tools probably are
    195      1.1     joerg     able to find them from the source package too.
    196      1.1     joerg 
    197      1.1     joerg     The "debug" directory contains some tools that are useful only when
    198      1.1     joerg     hacking on XZ Utils. Don't package these tools.
    199      1.1     joerg 
    200      1.1     joerg 
    201      1.1     joerg 7. Installing XZ Utils and LZMA Utils in parallel
    202      1.1     joerg -------------------------------------------------
    203      1.1     joerg 
    204      1.1     joerg     XZ Utils and LZMA Utils 4.32.x can be installed in parallel by
    205      1.1     joerg     omitting the compatibility symlinks (lzma, unlzma, lzcat, lzgrep etc.)
    206      1.1     joerg     from the XZ Utils package. It's probably a good idea to still package
    207      1.1     joerg     the symlinks into a separate package so that users may choose if they
    208      1.1     joerg     want to use XZ Utils or LZMA Utils for handling .lzma files.
    209      1.1     joerg 
    210      1.1     joerg 
    211      1.1     joerg 8. Example
    212      1.1     joerg ----------
    213      1.1     joerg 
    214      1.1     joerg     Here is an example for i686 GNU/Linux that
    215      1.1     joerg       - links xz and lzmainfo against shared liblzma;
    216      1.1     joerg       - links size-optimized xzdec and lzmadec against static liblzma
    217      1.1     joerg         while avoiding libpthread dependency;
    218      1.1     joerg       - includes only shared liblzma in the final package; and
    219      1.1     joerg       - copies also the "extra" directory to the package.
    220      1.1     joerg 
    221      1.1     joerg     PKG=/tmp/xz-pkg
    222      1.1     joerg     tar xf xz-x.y.z.tar.gz
    223      1.1     joerg     cd xz-x.y.z
    224      1.1     joerg     ./configure \
    225      1.1     joerg             --prefix=/usr \
    226      1.1     joerg             --disable-static \
    227      1.1     joerg             --disable-xzdec \
    228      1.1     joerg             --disable-lzmadec \
    229      1.1     joerg             CFLAGS='-march=i686 -mtune=generic -O2'
    230      1.1     joerg     make
    231      1.1     joerg     make DESTDIR=$PKG install-strip
    232      1.1     joerg     make clean
    233      1.1     joerg     ./configure \
    234      1.1     joerg             --prefix=/usr \
    235      1.1     joerg             --disable-shared \
    236      1.1     joerg             --disable-nls \
    237      1.1     joerg             --disable-encoders \
    238      1.1     joerg             --enable-small \
    239      1.1     joerg             --disable-threads \
    240      1.1     joerg             CFLAGS='-march=i686 -mtune=generic -Os'
    241      1.1     joerg     make -C src/liblzma
    242      1.1     joerg     make -C src/xzdec
    243      1.1     joerg     make -C src/xzdec DESTDIR=$PKG install-strip
    244      1.1     joerg     cp -a extra $PKG/usr/share/doc/xz
    245      1.1     joerg 
    246