bzip2.xml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
  4. <!ENTITY % general-entities SYSTEM "../general.ent">
  5. %general-entities;
  6. ]>
  7. <sect1 id="ch-tools-bzip2" role="wrap">
  8. <?dbhtml filename="bzip2.html"?>
  9. <sect1info condition="script">
  10. <productname>bzip2</productname>
  11. <productnumber>&bzip2-version;</productnumber>
  12. <address>&bzip2-url;</address>
  13. </sect1info>
  14. <title>Bzip2-&bzip2-version;</title>
  15. <indexterm zone="ch-tools-bzip2">
  16. <primary sortas="a-Bzip2">Bzip2</primary>
  17. <secondary>tools</secondary>
  18. </indexterm>
  19. <sect2 role="package">
  20. <title/>
  21. <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
  22. href="../chapter06/bzip2.xml"
  23. xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
  24. <segmentedlist>
  25. <segtitle>&buildtime;</segtitle>
  26. <segtitle>&diskspace;</segtitle>
  27. <seglistitem>
  28. <seg>&bzip2-ch5-sbu;</seg>
  29. <seg>&bzip2-ch5-du;</seg>
  30. </seglistitem>
  31. </segmentedlist>
  32. </sect2>
  33. <sect2 role="installation">
  34. <title>Installation of Bzip2</title>
  35. <para>Apply a patch that will install the documentation for this
  36. package:</para>
  37. <screen><userinput remap="pre">patch -Np1 -i ../&bzip2-docs-patch;</userinput></screen>
  38. <para>The following command ensures installation of symbolic links are
  39. relative:</para>
  40. <screen><userinput remap="pre">sed -i 's@\(ln -s -f \)$(PREFIX)/bin/@\1@' Makefile</userinput></screen>
  41. <para>Ensure the man pages are installed into the correct location:</para>
  42. <screen><userinput remap="pre">sed -i "s@(PREFIX)/man@(PREFIX)/share/man@g" Makefile</userinput></screen>
  43. <para>The Bzip2 package does not contain a <command>configure</command>
  44. script. There are two <filename>Makefile</filename>, one for the shared
  45. library, and the other for the static library. Since we need both, We
  46. do the compilation in two stages. First the shared library:</para>
  47. <screen><userinput remap="make">make CC=$LFS_TGT-gcc -f Makefile-libbz2_so
  48. make clean</userinput></screen>
  49. <variablelist>
  50. <title>The meaning of the make parameter:</title>
  51. <varlistentry>
  52. <term><parameter>-f Makefile-libbz2_so</parameter></term>
  53. <listitem>
  54. <para>This will cause Bzip2 to be built using a different
  55. <filename>Makefile</filename> file, in this case the
  56. <filename>Makefile-libbz2_so</filename> file, which creates a dynamic
  57. <filename class="libraryfile">libbz2.so</filename> library and links
  58. the Bzip2 utilities against it.</para>
  59. </listitem>
  60. </varlistentry>
  61. </variablelist>
  62. <para>Compile and test the package with:</para>
  63. <screen><userinput remap="make">make CC=$LFS_TGT-gcc AR=$LFS_TGT-ar RANLIB=$LFS_TGT-ranlib</userinput></screen>
  64. <para>Install the package:</para>
  65. <screen><userinput remap="install">make PREFIX=$LFS/usr install</userinput></screen>
  66. <para>Install the shared <command>bzip2</command> binary into the
  67. <filename class="directory">/bin</filename> directory, make some necessary
  68. symbolic links, and clean up:</para>
  69. <screen><userinput remap="install">cp -v bzip2-shared $LFS/bin/bzip2
  70. cp -av libbz2.so* $LFS/lib
  71. ln -sv ../../lib/libbz2.so.1.0 $LFS/usr/lib/libbz2.so
  72. rm -v $LFS/usr/bin/{bunzip2,bzcat,bzip2}
  73. ln -sv bzip2 $LFS/bin/bunzip2
  74. ln -sv bzip2 $LFS/bin/bzcat</userinput></screen>
  75. </sect2>
  76. <sect2 role="content">
  77. <title/>
  78. <para>Details on this package are located in
  79. <xref linkend="contents-bzip2" role="."/></para>
  80. </sect2>
  81. </sect1>