zlib.xml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <sect1 id="ch06-zlib">
  2. <title>Installing Zlib-&zlib-version;</title>
  3. <?dbhtml filename="zlib.html" dir="chapter06"?>
  4. <screen>Estimated build time: &zlib-time;
  5. Estimated required disk space: &zlib-compsize;</screen>
  6. &aa-zlib-shortdesc;
  7. &aa-zlib-dep;
  8. <sect2><title>&nbsp;</title><para>&nbsp;</para></sect2>
  9. <sect2>
  10. <title>Installation of Zlib</title>
  11. <para>Zlib has a potential buffer overflow in its
  12. <emphasis>gzprintf()</emphasis> function, that, though difficult to take
  13. advantage of, should be taken care of by applying this patch:</para>
  14. <screen><userinput>patch -Np1 -i ../&zlib-patch;</userinput></screen>
  15. <para>Now prepare Zlib for compilation:</para>
  16. <screen><userinput>./configure --prefix=/usr --shared</userinput></screen>
  17. <note><para>Zlib is known to build its shared library incorrectly if CFLAGS is
  18. specified in the environment. If you are using your own CFLAGS variable, be
  19. sure to add the <emphasis role="strong">-fPIC</emphasis> directive to your
  20. CFLAGS for the duration of the above command, then remove it
  21. afterwards.</para></note>
  22. <para>Compile the package:</para>
  23. <screen><userinput>make</userinput></screen>
  24. <para>Install the shared libraries:</para>
  25. <screen><userinput>make install</userinput></screen>
  26. <para>Now also build the non-shared libraries:</para>
  27. <screen><userinput>make clean
  28. ./configure --prefix=/usr
  29. make</userinput></screen>
  30. <para>This package has a test suite available which can perform a number of
  31. checks to ensure it built correctly. Should you choose to run it, the
  32. following command will do so:</para>
  33. <screen><userinput>make test</userinput></screen>
  34. <para>And install the package:</para>
  35. <screen><userinput>make install</userinput></screen>
  36. <para>The shared Zlib library should be installed in the
  37. <filename>/lib</filename> directory. That way, in the event
  38. that you must boot without the <filename>/usr</filename>
  39. directory, vital system programs will still have access to
  40. the library:</para>
  41. <screen><userinput>mv /usr/lib/libz.so.* /lib</userinput></screen>
  42. <para>The <filename>/usr/lib/libz.so</filename> symlink is
  43. linked to a file which no longer exists, because we moved
  44. it. Create a symbolic link to the new location of the
  45. library:</para>
  46. <screen><userinput>ln -sf ../../lib/libz.so.1 /usr/lib/libz.so</userinput></screen>
  47. <para>Zlib does not install its manual page. Issue the
  48. following command to install this documentation:</para>
  49. <screen><userinput>cp zlib.3 /usr/share/man/man3</userinput></screen>
  50. </sect2>
  51. </sect1>