source: chapter06/zlib.xml@ 0b100863

6.0
Last change on this file since 0b100863 was 0b100863, checked in by Matthew Burgess <matthew@…>, 20 years ago

Added zlib patch description. Fixes bug 916

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/testing/BOOK@4241 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 3.9 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
3 <!ENTITY % general-entities SYSTEM "../general.ent">
4 %general-entities;
5]>
6<sect1 id="ch-system-zlib" role="wrap">
7<title>Zlib-&zlib-version;</title>
8<?dbhtml filename="zlib.html"?>
9
10<indexterm zone="ch-system-zlib"><primary sortas="a-Zlib">Zlib</primary></indexterm>
11
12<sect2 role="package"><title/>
13<para>The Zlib package contains compression and un-compression routines used by
14some programs.</para>
15
16<segmentedlist>
17<segtitle>&buildtime;</segtitle>
18<segtitle>&diskspace;</segtitle>
19<seglistitem><seg>0.1 SBU</seg><seg>1.5 MB</seg></seglistitem>
20</segmentedlist>
21
22<segmentedlist>
23<segtitle>Zlib installation depends on</segtitle>
24<seglistitem><seg>Binutils, Coreutils, GCC, Glibc, Make, and Sed</seg></seglistitem>
25</segmentedlist>
26</sect2>
27
28<sect2 role="installation">
29<title>Installation of Zlib</title>
30
31<para>Zlib-&zlib-version; has a known security vulnerability. Apply a patch to
32fix this problem:</para>
33
34<screen><userinput>patch -Np1 -i ../zlib-&zlib-version;-security-1.patch</userinput></screen>
35
36<note><para>Zlib is known to build its shared library incorrectly if
37<envar>CFLAGS</envar> is specified in the environment. If using a
38specified <envar>CFLAGS</envar>
39variable, be sure to add the <parameter>-fPIC</parameter> directive to
40the <envar>CFLAGS</envar> variable for the duration of the
41configure command below, then remove it afterwards.</para></note>
42
43<para>Prepare Zlib for compilation:</para>
44
45<screen><userinput>./configure --prefix=/usr --shared</userinput></screen>
46
47<para>Compile the package:</para>
48
49<screen><userinput>make</userinput></screen>
50
51<para>To test the results, issue:
52<userinput>make check</userinput>.</para>
53
54<para>Install the shared library:</para>
55
56<screen><userinput>make install</userinput></screen>
57
58<para>Build the static library:</para>
59
60<screen><userinput>make clean
61./configure --prefix=/usr
62make</userinput></screen>
63
64<para>To test the results again, issue:
65<userinput>make check</userinput>.</para>
66
67<para>Install the static library:</para>
68
69<screen><userinput>make install</userinput></screen>
70
71<para>Fix the permissions on the static library:</para>
72
73<screen><userinput>chmod 644 /usr/lib/libz.a</userinput></screen>
74
75<para>It is good policy and common practice to place important
76libraries into the <filename class="directory">/lib</filename>
77directory. This is most important in scenarios where <filename
78class="directory">/usr</filename> is on a separate partition.
79Essentially, the run-time components of any libraries that are used by
80programs in <filename class="directory">/bin</filename> or <filename
81class="directory">/sbin</filename> should reside in <filename
82class="directory">/lib</filename> so that they are on the root
83partition and available in the event of <filename
84class="directory">/usr</filename> being inaccessible.</para>
85
86<para>For the above reason, move the run-time components of the shared Zlib
87into <filename class="directory">/lib</filename>:</para>
88
89<screen><userinput>mv /usr/lib/libz.so.* /lib</userinput></screen>
90
91<para>Fix the <filename class="symlink">/usr/lib/libz.so</filename>
92symlink:</para>
93
94<screen><userinput>ln -sf ../../lib/libz.so.1 /usr/lib/libz.so</userinput></screen>
95
96</sect2>
97
98
99<sect2 id="contents-zlib" role="content"><title>Contents of Zlib</title>
100
101<segmentedlist>
102<segtitle>Installed libraries</segtitle>
103<seglistitem><seg>libz[a,so]</seg></seglistitem>
104</segmentedlist>
105
106<variablelist><bridgehead renderas="sect3">Short descriptions</bridgehead>
107<?dbfo list-presentation="list"?>
108
109<varlistentry id="libz">
110<term><filename class="libraryfile">libz*</filename></term>
111<listitem>
112<para>contains compression and un-compression
113functions used by some programs.</para>
114<indexterm zone="ch-system-zlib libz"><primary sortas="c-libz*">libz*</primary></indexterm>
115</listitem>
116</varlistentry>
117</variablelist>
118
119</sect2>
120
121</sect1>
122
Note: See TracBrowser for help on using the repository browser.