aboutsummaryrefslogtreecommitdiffstats
path: root/chapter06/gawk-inst.xml
blob: b804ef8451d4b8a13fb1a2b4faf82dcee33e4297 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<sect2><title>&nbsp;</title><para>&nbsp;</para></sect2>

<sect2>
<title>Installation of Gawk</title>

<para>Before installing the Gawk package you have to apply a patch,
which fixes the following issues:</para>

<itemizedlist>
<listitem><para>Gawk's default location for libexecdir is <filename
class="directory">$prefix/libexecdir/awk</filename>. This location doesn't
comply with FHS (which never mentions a directory called
libexecdir).</para></listitem>

<listitem><para>The patch allows us to pass
<emphasis>--libexecdir</emphasis> to the configure script (without gawk
tacking on /awk to the end), so that we can use a more appropriate location
for gawk's libexecdir (<filename class="directory">/usr/bin</filename> in
the book).</para></listitem>

<listitem><para>The default data directory for gawk is <filename
class="directory">$prefix/share/awk</filename>. A package specific
directory should be named using the package and version (like gawk-3.1.3
instead of awk) because there may be more than one awk interpreter on a
system (and more than one version of gawk). The patch changes this to
<filename class="directory">$prefix/share/gawk-3.1.3</filename> to be more
correct.</para></listitem>

<listitem><para>The patch ensures that this directory (<filename
class="directory">$prefix/share/gawk-3.1.3</filename>) is removed along
with its contents on a make uninstall.</para></listitem>
</itemizedlist>

<para><screen><userinput>patch -Np1 -i ../&gawk-patch;</userinput></screen></para>

<para>Now prepare Gawk for compilation:</para>

<para><screen><userinput>./configure --prefix=/usr --libexecdir=/usr/bin</userinput></screen></para>

<para>Compile the package:</para>

<para><screen><userinput>make</userinput></screen></para>

<para>This package has a test suite available which can perform a number of
checks to ensure it built correctly.  Should you choose to run it, the 
following command will do so:</para>

<para><screen><userinput>make check</userinput></screen></para>

<para>And install the package:</para>

<para><screen><userinput>make install</userinput></screen></para>

</sect2>