file: secure the URL, add libseccomp as external dep, and move libmagic.so to /lib
[linux_from_scratch.git] / BOOK / chapter06 / file.xml
blobb44a639bef9c6af8f4bb248856fd2f1d733a1afb
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 ]>
8 <sect1 id="ch-tools-file" role="wrap">
9   <?dbhtml filename="file.html"?>
11   <sect1info condition="script">
12     <productname>file</productname>
13     <productnumber>&file-version;</productnumber>
14     <address>&file-url;</address>
15   </sect1info>
17   <title>File-&file-version;</title>
19   <indexterm zone="ch-tools-file">
20     <primary sortas="a-File">File</primary>
21     <secondary>tools</secondary>
22   </indexterm>
24   <sect2 role="package">
25     <title/>
27     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
28     href="../chapter08/file.xml"
29     xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
31     <segmentedlist>
32       <segtitle>&buildtime;</segtitle>
33       <segtitle>&diskspace;</segtitle>
35       <seglistitem>
36         <seg>&file-tmp-sbu;</seg>
37         <seg>&file-tmp-du;</seg>
38       </seglistitem>
39     </segmentedlist>
41   </sect2>
43   <sect2 role="installation">
44     <title>Installation of File</title>
46     <para>
47        The <command>file</command> command on the build host needs 
48        to be same version as the one we are building in order to 
49        create the signature file. Run the following commands to build it:
50     </para>
52 <screen><userinput remap="pre">mkdir build
53 pushd build
54   ../configure --disable-bzlib      \
55                --disable-libseccomp \
56                --disable-xzlib      \
57                --disable-zlib
58   make
59 popd</userinput></screen>
61     <variablelist>
62       <title>The meaning of the new configure option:</title>
64       <varlistentry>
65         <term><parameter>--disable-*</parameter></term>
66         <listitem>
67           <para>The configuration script attempts to use some packages from
68           the host distribution if the corresponding library files exist.
69           It may cause compilation failure if a library file exists, but
70           the corresponding header files do not.  These options prevent
71           using these unneeded capabilities from the host.</para>
72         </listitem>
73       </varlistentry>
74     </variablelist>
76     <para>Prepare File for compilation:</para>
78 <screen><userinput remap="configure">./configure --prefix=/usr --host=$LFS_TGT --build=$(./config.guess)</userinput></screen>
80 <!-- devs: if using - -build here, the build system wants to compile
81      the signature file with "file" on the build system, but stops if it is not
82      the same version. One possibility would be to build "file" on the build
83      system first, but it is simpler to have the system think it is not
84      cross-compiling, and use the just built "file". -->
85     <para>Compile the package:</para>
87 <screen><userinput remap="make">make FILE_COMPILE=$(pwd)/build/src/file</userinput></screen>
89     <para>Install the package:</para>
91 <screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
93     <para>Move a shared library into its final location in the LFS system,
94     and recreate the symlink for it:</para>
96 <screen><userinput remap="install">mv -v $LFS/usr/lib/libmagic.so.* $LFS/lib
97 ln -sfv ../../lib/$(readlink /usr/lib/libmagic.so) $LFS/usr/lib/libmagic.so</userinput></screen>
99   </sect2>
101   <sect2 role="content">
102     <title/>
103     <para>Details on this package are located in <xref linkend="contents-file" role="."/></para>
105   </sect2>
107 </sect1>