PACKAGERS 8.8 KB

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