source: introduction/important/beyond.xml

trunk
Last change on this file was 755607e3, checked in by Xi Ruoyao <xry111@…>, 2 weeks ago

Kick MANPATH out of the book

The man program automatically deduce a good default from PATH, thus no
need to set MANPATH as long as the corresponding PATH component is
added.

  • Property mode set to 100644
File size: 11.8 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
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
8<sect1 id="beyond" xreflabel="Going Beyond BLFS">
9 <?dbhtml filename="beyond.html"?>
10
11
12 <title>Going Beyond BLFS</title>
13
14 <para>The packages that are installed in this book are only the tip of the
15 iceberg. We hope that the experience you gained with the LFS book and
16 the BLFS book will give you the background needed to compile, install
17 and configure packages that are not included in this book.</para>
18
19 <para>When you want to install a package to a location other than
20 <filename class='directory'>/</filename>, or
21 <filename class='directory'>/usr</filename>, you are installing
22 outside the default environment settings on most machines. The following
23 examples should assist you in determining how to correct this situation.
24 The examples cover the complete range of settings that may need
25 updating, but they are not all needed in every situation.</para>
26
27 <itemizedlist>
28 <listitem>
29 <para>Expand the <envar>PATH</envar> to include
30 <filename class='directory'>$PREFIX/bin</filename>.</para>
31 </listitem>
32 <listitem>
33 <para>Expand the <envar>PATH</envar> for
34 <systemitem class="username">root</systemitem> to include
35 <filename class='directory'>$PREFIX/sbin</filename>.</para>
36 </listitem>
37 <listitem>
38 <para>Add <filename class='directory'>$PREFIX/lib</filename>
39 to <filename>/etc/ld.so.conf</filename> or expand
40 <envar>LD_LIBRARY_PATH</envar> to include it. Before using the latter
41 option, check out <ulink
42 url="http://xahlee.info/UnixResource_dir/_/ldpath.html"/>.
43 If you modify <filename>/etc/ld.so.conf</filename>, remember to update
44 <filename>/etc/ld.so.cache</filename> by executing
45 <command>ldconfig</command> as the
46 <systemitem class="username">root</systemitem> user.</para>
47 </listitem>
48 <listitem>
49 <para>Add <filename class='directory'>$PREFIX/man</filename>
50 to <filename>/etc/man_db.conf</filename>.</para>
51 </listitem>
52 <listitem>
53 <para>Add <filename class='directory'>$PREFIX/info</filename>
54 to <envar>INFOPATH</envar>.</para>
55 </listitem>
56 <listitem>
57 <para>Add <filename class='directory'>$PREFIX/lib/pkgconfig</filename>
58 to <envar>PKG_CONFIG_PATH</envar>. Some packages are now installing
59 <filename class='extension'>.pc</filename> files in
60 <filename class='directory'>$PREFIX/share/pkgconfig</filename>, so you may
61 have to include this directory also.</para>
62 </listitem>
63 <listitem>
64 <para>Add <filename class='directory'>$PREFIX/include</filename> to
65 <envar>CPPFLAGS</envar> when compiling packages that depend on
66 the package you installed.</para>
67 </listitem>
68 <listitem>
69 <para>Add <filename class='directory'>$PREFIX/lib</filename> to
70 <envar>LDFLAGS</envar> when compiling packages that depend on a library
71 installed by the package.</para>
72 </listitem>
73 </itemizedlist>
74
75 <para>If you are in search of a package that is not in the book, the following
76 are different ways you can search for the desired package.</para>
77
78 <itemizedlist>
79 <listitem>
80 <para>If you know the name of the package, then search SourceForge for
81 it at <ulink url="https://sourceforge.net/directory/"/>, and search
82 GitHub for it at <ulink url="https://github.com/"/>.
83 Also search Google at <ulink url="https://google.com/"/>. Sometimes a
84 search for the <filename class='extension'>rpm</filename> at
85 <ulink url="https://rpmfind.net/"/> or the
86 <filename class='extension'>deb</filename> at
87 <ulink url="https://www.debian.org/distrib/packages#search_packages"/> can
88 also lead to a link to the package.</para>
89 </listitem>
90 <listitem>
91 <para>If you know the name of the executable, but not the package
92 that the executable belongs to, first try a Google search with the name
93 of the executable. If the results are overwhelming, try searching for the
94 given executable in the Debian repository at <ulink
95 url="https://www.debian.org/distrib/packages#search_contents"/>.</para>
96 </listitem>
97 </itemizedlist>
98
99 <para>Some general hints on handling new packages:</para>
100
101 <itemizedlist>
102 <listitem>
103 <para>Many of the newer packages follow the <command>./configure
104 &amp;&amp; make &amp;&amp; make install</command> process.
105 Help on the options accepted by configure can be obtained via the
106 command <command>./configure --help</command>.</para>
107 </listitem>
108 <listitem>
109 <para>Most of the packages contain documentation on compiling and
110 installing the package. Some of the documents are excellent, some not so
111 excellent. Check out the homepage of the package for any additional and
112 updated hints for compiling and configuring the package.</para>
113 </listitem>
114 <listitem>
115 <para>If you are having a problem compiling the package, try
116 searching the LFS archives at
117 <ulink url="https://www.&lfs-domainname;/search.html"/> for the error or if
118 that fails, try searching Google. Often, a distribution will have already
119 solved the problem (many of them use development versions of packages, so
120 they see the changes sooner than those of us who normally use stable released
121 versions). But be cautious - all builders tend to carry patches which are no
122 longer necessary, and to have fixes which are only required because of their
123 particular choices in how they build a package. You may have to search
124 deeply to find a fix for the package version you are trying to use, or even
125 to find the package (names are sometimes not what you might expect, e.g.
126 <application>ghostscript</application> often has a prefix or a suffix in its
127 name), but the following notes might help, particularly for those who, like
128 the editors, are trying to build the latest versions and encountering
129 problems:</para>
130 <itemizedlist>
131 <listitem>
132 <para>Arch <ulink url="https://www.archlinux.org/packages/"/> - enter
133 the package name in the 'Keywords' box, select the package name,
134 select the 'Source Files' field, and then select the
135 <filename>PKGBUILD</filename> entry to see how they build this
136 package.</para>
137 </listitem>
138 <listitem>
139 <para>Debian
140 <ulink url="http://ftp.debian.org/debian/pool"/> (use your country's
141 version if there is one) - the source will be in .tar.gz tarballs (either
142 the original upstream <filename class='extension'>.orig</filename> source,
143 or else a <filename>dfsg</filename> containing those parts which comply
144 with Debian's free software guidelines) accompanied by versioned .diff.gz
145 or .tar.gz additions. These additions often show how the package is built,
146 and may contain patches. In the .diff.gz versions, any patches create files
147 in <filename class="directory">debian/patches</filename>.</para>
148 </listitem>
149 <listitem>
150 <para>Fedora package source gets reorganized from time to time.
151 At the moment the package source for rpms is at <ulink
152 url="https://src.fedoraproject.org/projects/rpms/%2A"/> and from there
153 you can try putting a package name in the search box. If the package is
154 found you can look at the files (specfile to control the build, various
155 patches) or the commits. If that fails, you can download
156 an srpm (source rpm) and using <application>rpm2cpio</application> (see
157 the Tip at the bottom of the page). For rpms go to <ulink
158 url="https://dl.fedoraproject.org/pub/fedora/linux/"/> and then choose
159 which repo you wish to look at - development/rawhide is the latest
160 development, or choose releases for what was shipped in a release,
161 updates for updates to a release, or updates/testing for the latest
162 updates which might work or might have problems.
163 </para>
164 </listitem>
165 <listitem>
166 <para>Gentoo - First use a search engine to find an ebuild which looks as
167 if it will fix the problem, or search at <ulink
168 url="https://packages.gentoo.org/"/> - use the search field. Note where the
169 package lives in the portage hierarchy, e.g.
170 <filename>app-something/</filename>. In general you can treat the ebuild as
171 a sort of pseudo-code / shell combination with some functions you can
172 hazard a guess at, such as <command>dodoc</command>. If the fix is just a
173 <command>sed</command>, try it. However, in most cases the fix will use a
174 patch. To find the patch, use a gentoo-portage mirror: Two links to mirrors
175 in the U.S.A. which seem to usually be up to date are
176 <ulink url="https://mirror.rackspace.com/gentoo-portage/"/> and
177 <ulink url="https://mirror.steadfast.net/gentoo-portage/"/>. Navigate down
178 the tree to the package, then to the <filename>files/</filename> directory
179 to look for the patch. Sometimes a portage mirror has not yet been updated,
180 particularly for a recent new patch. In a few cases, gentoo batch the
181 patches into a tarball and the ebuild will have a link in the form
182 https://dev.gentoo.org/~${PATCH_DEV}/distfiles/${P}-patches-${PATCH_VER}.tar.xz
183 : here, look for PATCH_DEV and PATCH_VER in the build and format the full
184 URL in your browser or for wget : remember the '~' before the developer's
185 ID and note that trying to search the earlier levels of the URL in a
186 browser may drop you at www.gentoo.org or return 403 (forbidden).
187 </para>
188 </listitem>
189 <listitem>
190 <para>openSUSE provide a rolling release, some package versions are in
191 <ulink url="https://download.opensuse.org/source/tumbleweed/repo/oss/src/"/>
192 but others are in ../update/openSUSE-current/src - the
193 source only seems to be available in source rpms.</para>
194 </listitem>
195 <listitem>
196 <para>Slackware - the official package browser is currently broken. The
197 site at <ulink url="https://slackbuilds.org/"/> has current and previous
198 versions in their unofficial repository with links to homepages, downloads,
199 and some individual files, particularly the <filename>.SlackBuild</filename>
200 files.</para>
201 </listitem>
202 <listitem>
203 <para>Ubuntu <ulink url="http://ftp.ubuntu.com/ubuntu/pool/"/> - see the
204 Debian notes above.</para>
205 </listitem>
206 </itemizedlist>
207 <para>If everything else fails, try the blfs-support mailing-list.</para>
208 </listitem>
209 </itemizedlist>
210
211 <tip>
212 <para>If you have found a package that is only available in
213 <filename class='extension'>.deb</filename> or
214 <filename class='extension'>.rpm</filename>
215 format, there are two small scripts, <command>rpm2targz</command> and
216 <command>deb2targz</command> that are available at
217 <ulink url="&sources-anduin-http;/extras/deb2targz.tar.bz2"/> and
218 <ulink url="&sources-anduin-http;/extras/rpm2targz.tar.bz2"/> to convert the archives
219 into a simple <filename>tar.gz</filename> format.</para>
220 <para>You may also find an rpm2cpio script useful. The Perl version in the
221 linux kernel archives at <ulink
222 url="https://lore.kernel.org/all/20021016121842.GA2292@ncsu.edu/2-rpm2cpio"/>
223 works for most source rpms. The rpm2targz script will use an rpm2cpio script
224 or binary if one is on your path. Note that rpm2cpio will unpack a source
225 rpm in the current directory, giving a tarball, a spec file, and perhaps patches
226 or other files.</para>
227 </tip>
228
229</sect1>
Note: See TracBrowser for help on using the repository browser.