This patch attempts to streamline the Xorg sections by using case
statements to handle packages that need extra commands. Currently the
special cases are security patches and the UTF-8 fixing sed on the
driver man pages. I've tested that the case statements actually apply to
the correct packages and that the && error checking isn't broken.

--
Dan

 BOOK/introduction/welcome/changelog.xml |    4 +++
 BOOK/x/installing/x7app.xml             |   34 ++++++++++++++++---------
 BOOK/x/installing/x7driver.xml          |   32 +++++++++++-----------
 BOOK/x/installing/x7lib.xml             |   42 +++++++++++++++++--------------
 4 files changed, 65 insertions(+), 47 deletions(-)

diff --git a/BOOK/introduction/welcome/changelog.xml 
b/BOOK/introduction/welcome/changelog.xml
index a65a8b2..75b10c0 100644
--- a/BOOK/introduction/welcome/changelog.xml
+++ b/BOOK/introduction/welcome/changelog.xml
@@ -48,6 +48,10 @@
           <para>[dnicholson] - Changed the XKeyboardConfig intltool dependency
           to optional and added a required XML::Parser dependency.</para>
         </listitem>
+        <listitem>
+          <para>[dnicholson] - Streamlined the commands for each Xorg
+          section.</para>
+        </listitem>
       </itemizedlist>
     </listitem>
 
diff --git a/BOOK/x/installing/x7app.xml b/BOOK/x/installing/x7app.xml
index 03082ab..76f1dbd 100644
--- a/BOOK/x/installing/x7app.xml
+++ b/BOOK/x/installing/x7app.xml
@@ -11,6 +11,9 @@
   <!ENTITY x7apps-buildsize     "30.7 MB">
   <!ENTITY x7apps-time          "2.9 SBU">
 
+  <!-- Versions for patches -->
+  <!ENTITY xload-version        "1.0.1">
+
 ]>
 
 <sect1 id="xorg7-app" xreflabel="Xorg Applications">
@@ -62,7 +65,7 @@
     <itemizedlist spacing="compact">
       <listitem>
         <para>Required patch: <ulink
-        url="&patch-root;/xload-1.0.1-setuid-1.patch"/></para>
+        url="&patch-root;/xload-&xload-version;-setuid-1.patch"/></para>
       </listitem>
     </itemizedlist>
 
@@ -104,18 +107,15 @@ wget -B 
http://xorg.freedesktop.org/releases/individual/app/ \
     <warning><para>The <application>mkcfm</application> package is
     deprecated and should not be installed.</para></warning>
 
-    <para>A <ulink url='http://wiki.x.org/wiki/Development/Security'>security
-    vulnerability</ulink> has been identified in the xload package.
-    Before building this package with the commands
-    shown below, be sure to apply the supplied patches. The patch can be
-    applied with with the following command:</para>
-
-<screen><userinput>patch -Np1 -i 
../xload-1.0.1-setuid-1.patch</userinput></screen>
-
     <para>Install the applications by running the following commands for each
-    chosen package:</para>
-
-<screen><userinput>./configure $XORG_CONFIG &amp;&amp;
+    package:</para>
+
+<screen><userinput>case $(basename "$PWD") in
+xload-&xload-version; )
+    patch -Np1 -i ../xload-&xload-version;-setuid-1.patch
+    ;;
+esac &amp;&amp;
+./configure $XORG_CONFIG &amp;&amp;
 make</userinput></screen>
 
     <para>These packages do not provide test suites.</para>
@@ -127,6 +127,16 @@ make</userinput></screen>
 
   </sect2>
 
+  <sect2 role="commands">
+    <title>Command Explanations</title>
+
+    <para><command>patch -Np1 -i
+    ../xload-&xload-version;-setuid-1.patch</command>: This patch fixes a
+    <ulink url='http://wiki.x.org/wiki/Development/Security'>security
+    vulnerability</ulink> that has been identified in the xload package.</para>
+
+  </sect2>
+
   <sect2 role="content">
     <title>Contents</title>
 
diff --git a/BOOK/x/installing/x7driver.xml b/BOOK/x/installing/x7driver.xml
index 8476627..fafef45 100644
--- a/BOOK/x/installing/x7driver.xml
+++ b/BOOK/x/installing/x7driver.xml
@@ -85,21 +85,6 @@ wget -B 
http://xorg.freedesktop.org/releases/individual/driver/ \
   <sect2 role="installation">
     <title>Installation of Xorg Drivers</title>
 
-    <para>The <application>xf86-input-evdev</application>,
-    <application>xf86-video-ati</application>,
-    <application>xf86-video-fbdev</application>,
-    <application>xf86-video-glint</application>, and
-    <application>xf86-video-newport</application> packages install
-    man pages in UTF-8 encoding, and they will not display correctly
-    using <application>Man-DB</application>. Issue the following
-    command before building these packages to replace the offending
-    characters with ones that <command>man</command> can properly
-    display.</para>
-
-<screen><userinput>sed -i -e "s/\xc3\xb8/\\\\[\/o]/" \
-       -e "s/\xc3\xa4/\\\\[:a]/" \
-       -e "s/\xc3\x9c/\\\\[:U]/" man/*.man</userinput></screen>
-
     <warning><para>It is very important not to build display drivers that
     cannot be used with your hardware.  For instance, do not build Sun drivers
     for an x86 PC as the Sun drivers will expect to see SPARC symbols
@@ -110,7 +95,16 @@ wget -B 
http://xorg.freedesktop.org/releases/individual/driver/ \
     <para>Install the drivers by running the following commands for each
     package:</para>
 
-<screen><userinput>./configure $XORG_CONFIG \
+<screen><userinput>case $(basename "$PWD") in
+xf86-input-evdev-[0-9]* | xf86-video-ati-[0-9]* | \
+xf86-video-fbdev-[0-9]* | xf86-video-glint-[0-9]* | \
+xf86-video-newport-[0-9]* )
+    sed -i -e "s/\xc3\xb8/\\\\[\/o]/" \
+           -e "s/\xc3\xa4/\\\\[:a]/" \
+           -e "s/\xc3\x9c/\\\\[:U]/" man/*.man
+    ;;
+esac &amp;&amp;
+./configure $XORG_CONFIG \
     --with-xorg-module-dir=$XORG_PREFIX/lib/X11/modules &amp;&amp;
 make</userinput></screen>
 
@@ -126,6 +120,12 @@ make</userinput></screen>
   <sect2 role="commands">
     <title>Command Explanations</title>
 
+    <para><command>sed -i ... man/*.man</command>: A few packages install
+    man pages in UTF-8 encoding, and they will not display correctly
+    using <application>Man-DB</application>. This command converts the
+    offending characters to ones that <command>man</command> can properly
+    display.</para>
+
     <para><parameter>--with-xorg-module-dir=...</parameter>: This switch
     ensures that the drivers are installed into the correct directory.</para>
 
diff --git a/BOOK/x/installing/x7lib.xml b/BOOK/x/installing/x7lib.xml
index 2c6b6e8..a905962 100644
--- a/BOOK/x/installing/x7lib.xml
+++ b/BOOK/x/installing/x7lib.xml
@@ -11,6 +11,10 @@
   <!ENTITY x7libs-buildsize     "186 MB">
   <!ENTITY x7libs-time          "6.6 SBU">
 
+  <!-- Versions for patches -->
+  <!ENTITY libX11-version       "1.1.1">
+  <!ENTITY libXfont-version     "1.2.7">
+
 ]>
 
 <sect1 id="xorg7-lib" xreflabel="Xorg Libraries">
@@ -61,11 +65,11 @@
     <itemizedlist spacing="compact">
       <listitem>
         <para>Required patch: <ulink
-        url="&patch-root;/libX11-1.1.1-xinitimage-1.patch"/></para>
+        url="&patch-root;/libX11-&libX11-version;-xinitimage-1.patch"/></para>
       </listitem>
       <listitem>
         <para>Required patch: <ulink
-        url="&patch-root;/libXfont-1.2.7-bdf_fontsdir-1.patch"/></para>
+        
url="&patch-root;/libXfont-&libXfont-version;-bdf_fontsdir-1.patch"/></para>
       </listitem>
     </itemizedlist>
 
@@ -103,24 +107,18 @@ wget -B 
http://xorg.freedesktop.org/releases/individual/lib/ \
   <sect2 role="installation">
     <title>Installation of Xorg Libraries</title>
 
-    <para><ulink url='http://wiki.x.org/wiki/Development/Security'>Security
-    vulnerabilities</ulink> have been identified in the
-    <application>libX11</application> and <application>libXfont</application>
-    packages. Before building these packages with the commands shown below,
-    be sure to apply the supplied patches. For 
<application>libX11</application>,
-    this can be done by issuing the following command:</para>
-
-<screen><userinput>patch -Np1 -i 
../libX11-1.1.1-xinitimage-1.patch</userinput></screen>
-
-    <para>For <application>libXfont</application>, the patch can be applied
-    with the following command:</para>
-
-<screen><userinput>patch -Np1 -i 
../libXfont-1.2.7-bdf_fontsdir-1.patch</userinput></screen>
-
     <para>Install the libraries by running the following commands for each
-    of the chosen packages:</para>
-
-<screen><userinput>./configure $XORG_CONFIG --without-xcb &amp;&amp;
+    package:</para>
+
+<screen><userinput>case $(basename "$PWD") in
+libX11-&libX11-version; )
+    patch -Np1 -i ../libX11-&libX11-version;-xinitimage-1.patch
+    ;;
+libXfont-&libXfont-version; )
+    patch -Np1 -i ../libXfont-&libXfont-version;-bdf_fontsdir-1.patch
+    ;;
+esac &amp;&amp;
+./configure $XORG_CONFIG &amp;&amp;
 make</userinput></screen>
 
     <para>These packages do not provide test suites.</para>
@@ -141,6 +139,12 @@ ldconfig</userinput></screen>
     for it's transport layer unless this parameter is supplied. This parameter
     will be ignored for other packages.</para>
 
+    <para><command>patch -Np1 -i ...</command>: These commands apply patches
+    to fix <ulink url='http://wiki.x.org/wiki/Development/Security'>security
+    vulnerabilities</ulink> identified in the
+    <application>libX11</application> and <application>libXfont</application>
+    packages.</para>
+
   </sect2>
 
   <sect2 role="configuration">
-- 
1.5.1.3
-- 
http://linuxfromscratch.org/mailman/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to