r3819 - in jhalfs/trunk: . pkgmngt

pierre at higgs.linuxfromscratch.org pierre at higgs.linuxfromscratch.org
Sun Jan 18 08:58:24 PST 2015


Author: pierre
Date: Sun Jan 18 08:58:24 2015
New Revision: 3819

Log:
Add pacman as package manager.

Added:
   jhalfs/trunk/pkgmngt/packInstall.sh.dpkg   (contents, props changed)
   jhalfs/trunk/pkgmngt/packInstall.sh.pacman   (contents, props changed)
   jhalfs/trunk/pkgmngt/packageManager.xml.dpkg   (contents, props changed)
   jhalfs/trunk/pkgmngt/packageManager.xml.pacman   (contents, props changed)
Deleted:
   jhalfs/trunk/pkgmngt/packInstall.sh
   jhalfs/trunk/pkgmngt/packageManager.xml
Modified:
   jhalfs/trunk/README.PACKAGE_MANAGEMENT
   jhalfs/trunk/pkgmngt/packageManager.xml.template

Modified: jhalfs/trunk/README.PACKAGE_MANAGEMENT
==============================================================================
--- jhalfs/trunk/README.PACKAGE_MANAGEMENT	Sun Jan 18 07:58:15 2015	(r3818)
+++ jhalfs/trunk/README.PACKAGE_MANAGEMENT	Sun Jan 18 08:58:24 2015	(r3819)
@@ -17,59 +17,43 @@
 2. OVERVIEW OF THE SYSTEM:
 
       For now, package management is only available for LFS. I plan to
-  upgrade BLFS tools, but nothing usable right now. The other flavours of
-  LFS do not seem very active, so there is no point in updating jhalfs
-  for them.
-      The first thing to do is to modify the install instructions of the
-  chapter 6, 7 and 8 of the book so that the installed files end up in a
-  directory other than `/'. We choose to call this directory by the name
-  of the executed script, and to put the path to this directory in the
-  PKG_DEST variable which is made available to the scriplets.
-      Almost all the packages have a way to redirect the destination of
-  the files they install at the `make install' stage with the variable
-  DESTDIR. Furthermore, the authors of the book have been kind enough to
-  flag the installation instructions with `remap=install'. This allows an
-  xsl stylesheet to find those instructions. Then, places where `make '
-  occurs (make followed by a space) are replaced by `make DESTDIR=$PKG_DEST '.
-      Places where the book instructions move files into their destination
-  are harder to deal with: it is possible to change all occurences of ` /' or
-  `>/' (beginning of absolute paths) to `$PKG_DEST', but you end up moving
+  upgrade BLFS tools, but nothing usable right now. I have not attempted
+  to adapt this tool for the other flavours of LFS.
+      This system performs basically a "DESTDIR install" for all pages
+  in chapter 6, 7 and 8 of the book. The name of the DESTDIR directory is the
+  same as the one of the executed script. The path to this directory is
+  available to the scriplets through the PKG_DEST variable.
+      The XSL stylesheet used for generating the scriptlets, automatically
+  adds DESTDIR install instructions when "package management" is selected.
+  Also all the paths beginning with " /" or ">/" (absolute paths) are prepended
+  with $PKG_DEST. This has the default that you might want to move
   files to non existent directories. There is no simple way to automatically
   create those directories, because you have sometimes to use the full path
   (instructions of the form `cp file dir') and sometimes only the dirname
-  (instructions of the form `cp file1 file2'). So I am conservative and
-  create  a reasonable subset of the FHS hierarchy into the destination
-  directory. Empty directories should then be removed before packing the
+  (instructions of the form `cp file1 file2'). So the XSL stylesheet
+  creates a reasonable subset of the FHS hierarchy into the destination
+  directory. Empty directories are then removed before packing the
   binary package.
-      Supposing now that the scriptlets have been adequately modified, the
-  package manager installation instructions have to be added at the end of
-  chapter 5 and chapter 6. Furthermore, the administrative files and
-  directories have to be created during the `Creating Directories' and
-  `Creating Essential Files' stage. For all this, the user has to supply a
-  file in docbook format, with the necessary instructions and enough
-  information to download the tarball. A template is provided in the pkgmngt
-  subdirectory.
+      In order to use the package manager, it has to be installed at the end of
+  chapter 5 (temporary installation in /tools) and chapter 6 (final install).
+  Furthermore, the administrative files and directories have to be created
+  during the `Creating Directories' and `Creating Essential Files' stages.
+  For all this, the user has to supply a file in docbook XML format, with
+  the necessary instructions and enough information to download the tarball.
+  This file should reside in the `pkgmngt' directory and be named
+  `packageManager.xml'. A template named `packageManager.xml.template' is
+  provided in the `pkgmngt' subdirectory. There are also two XML files for
+  dpkg and pacman, respectively `packageManager.xml.dpkg' and
+  `packageManager.xml.pacman', that you can copy to `packageManager.xml'.
+  They are not updated often, so the versions used can be rather old.
       The last thing to do is to tell how to use the package manager. When
   the binary package is ready, the scriptlets call a shell function named
   `packInstall', which should pack the binary package and install it on the
   system. Note that nothing has been done to manage configuration files, 
-  which are ususally treated specially by package managers. Depending on
+  which are ususally treated specially by package managers: depending on
   the book layout, it is sometimes possible to create those files afterwards,
   and sometimes not, which means that you have to check them after each
-  upgrade. The user has to provide his own function. A template is provided
-  in the pkgmngt subdirectory.
-
-3. DETAILED INSTRUCTIONS:
-
-      Before beginning, you should know which package manager you want, where
-  to get the sources, and how to use it for:
-  a) Making a package from a directory tree. Usually, there is some control
-     file containing the version, pacakager, build system (32 or 64 bits at
-     least) or other more or less usefull but mandatory bits of information
-     which you should understand.
-  b) Unpack the package.
-
-      Second, you ought to have a basic knowledge of bash scripting and
-  docbook-xml writing, because you have to write a bash function for packing
-  and unpacking the package, and a set of instructions to install the PM.
-  
+  upgrade. The user has to write his own `packInstall' function. The shell
+  function should be defined in a file named `packInstall.sh', residing in
+  the `pkgmngt' directory. A template is provided, as well as two example
+  scripts for dpkg and pacman.

Added: jhalfs/trunk/pkgmngt/packInstall.sh.dpkg
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ jhalfs/trunk/pkgmngt/packInstall.sh.dpkg	Sun Jan 18 08:58:24 2015	(r3819)
@@ -0,0 +1,40 @@
+# $Id$
+# function for packing and installing a tree. We only have access
+# to variables PKGDIR and PKG_DEST
+
+packInstall() {
+
+local PCKGVRS=$(basename $PKGDIR)
+local TGTPKG=$(basename $PKG_DEST)
+local PACKAGE=$(echo ${TGTPKG} | sed 's/^[0-9]\{3\}-//' |
+           sed 's/^[0-9]\{1\}-//')
+case $PCKGVRS in
+  expect*|tcl*) local VERSION=$(echo $PCKGVRS | sed 's/^[^0-9]*//') ;;
+  vim*|unzip*) local VERSION=$(echo $PCKGVRS | sed 's/^[^0-9]*\([0-9]\)\([0-9]\)/\1.\2/') ;;
+  tidy*) local VERSION=$(echo $PCKGVRS | sed 's/^[^0-9]*\([0-9]*\)/\1cvs/') ;;
+  docbook-xml) local VERSION=4.5 ;;
+  *) local VERSION=$(echo ${PCKGVRS} | sed 's/^.*-\([0-9]\)/\1/' |
+                   sed 's/_/./g');;
+# the last sed above is because dpkg does not want a '_' in version.
+esac
+local ARCHIVE_NAME=$(dirname ${PKGDIR})/${PACKAGE}_${VERSION}.deb
+case $(uname -m) in
+  x86_64) local ARCH=amd64 ;;
+  *) local ARCH=i386 ;;
+esac
+
+pushd $PKG_DEST
+rm -fv ./usr/share/info/dir
+mkdir DEBIAN
+cat > DEBIAN/control <<EOF
+Package: $PACKAGE
+Version: $VERSION
+Maintainer: Pierre Labastie <lnimbus at club-internet.fr>
+Description: $PACKAGE
+Architecture: $ARCH
+EOF
+dpkg-deb -z9 -b . $ARCHIVE_NAME
+dpkg -i $ARCHIVE_NAME
+mv -v $ARCHIVE_NAME /var/lib/packages
+popd
+}

Added: jhalfs/trunk/pkgmngt/packInstall.sh.pacman
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ jhalfs/trunk/pkgmngt/packInstall.sh.pacman	Sun Jan 18 08:58:24 2015	(r3819)
@@ -0,0 +1,59 @@
+# $Id$
+# function for packing and installing a tree. We only have access
+# to variables PKGDIR and PKG_DEST
+# Other variables can be passed on the command line, or in the environment
+
+packInstall() {
+
+# A proposed implementation for versions and package names.
+local PCKGVRS=$(basename $PKGDIR)
+local TGTPKG=$(basename $PKG_DEST)
+local PACKAGE=$(echo ${TGTPKG} | sed 's/^[0-9]\{3\}-//' |
+           sed 's/^[0-9]\{1\}-//')
+# version is only accessible from PKGDIR name. Since the format of the
+# name is not normalized, several hacks are necessary...
+case $PCKGVRS in
+  expect*|tcl*) local VERSION=$(echo $PCKGVRS | sed 's/^[^0-9]*//') ;;
+  vim*|unzip*) local VERSION=$(echo $PCKGVRS | sed 's/^[^0-9]*\([0-9]\)\([0-9]\)/\1.\2/') ;;
+  tidy*) local VERSION=$(echo $PCKGVRS | sed 's/^[^0-9]*\([0-9]*\)/\1cvs/') ;;
+  docbook-xml) local VERSION=4.5 ;;
+  *) local VERSION=$(echo ${PCKGVRS} | sed 's/^.*[-_]\([0-9]\)/\1/' |
+                   sed 's/_/./g');;
+# the last sed above is because some package managers do not want a '_'
+# in version.
+esac
+case $(uname -m) in
+  x86_64) local ARCH=x86_64 ;;
+  *) local ARCH=i686 ;;
+esac
+local ARCHIVE_NAME=${PACKAGE}-${VERSION}-1-${ARCH}.pkg.tar.gz
+
+pushd $PKG_DEST
+rm -fv ./usr/share/info/dir  # recommended since this directory is already there
+                             # on the system
+# Right now, we have the files in the current directory. They should be moved
+# to /sources/$PACKAGE/src.
+mkdir -p ../$PACKAGE/src
+mv * ../$PACKAGE/src
+
+cat > PKGBUILD <<EOF
+pkgname=( '$PACKAGE' )
+pkgver=$VERSION
+pkgrel=1
+pkgdesc=$PACKAGE
+arch=( '$ARCH' )
+
+package() {
+mv * \$pkgdir
+}
+EOF
+# Building the binary package
+makepkg --asroot -c --skipinteg
+# Installing it on LFS
+if ! pacman -U --noconfirm $ARCHIVE_NAME; then
+     pacman -U --noconfirm --force $ARCHIVE_NAME
+fi
+popd                         # Since the $PKG_DEST directory is destroyed
+                             # immediately after the return of the function,
+                             # getting back to $PKGDIR is important...
+}

Added: jhalfs/trunk/pkgmngt/packageManager.xml.dpkg
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ jhalfs/trunk/pkgmngt/packageManager.xml.dpkg	Sun Jan 18 08:58:24 2015	(r3819)
@@ -0,0 +1,352 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- $Id$ -->
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+  "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY buildtime "Approximate build time">
+<!ENTITY diskspace "Required disk space">
+<!ENTITY dependencies "Installation depends on">
+<!ENTITY testsuites "Test suite depends on">
+<!ENTITY before "Must be installed before">
+<!ENTITY external "Optional dependencies">
+<!ENTITY debian-pool "http://ftp2.fr.debian.org/debian/pool/main/">
+<!ENTITY dpkg-version "1.17.22">
+<!ENTITY dpkg-size "4,259 KB">
+<!ENTITY dpkg-url "&debian-pool;d/dpkg/dpkg_&dpkg-version;.tar.xz">
+<!ENTITY dpkg-md5 "c9c46c5318c98c9162fbd03d24f2f95b">
+<!ENTITY dpkg-home "http://wiki.debian.org/Teams/Dpkg">
+<!ENTITY dpkg-ch5-du "54 MB">
+<!ENTITY dpkg-ch5-sbu "0.3 SBU">
+<!ENTITY dpkg-ch6-du "63 MB">
+<!ENTITY dpkg-ch6-sbu "0.5 SBU">
+]>
+<article>
+
+<sect1 id="package">
+  <?dbhtml filename="packages.html"?>
+
+  <title>All Packages</title>
+
+  <para>Download or otherwise obtain the following packages:</para>
+
+  <variablelist role="materials">
+
+    <varlistentry>
+      <term>Dpkg (&dpkg-version;) - <token>&dpkg-size;</token>:</term>
+      <listitem>
+        <para>Home page: <ulink url="&dpkg-home;"/></para>
+        <para>Download: <ulink url="&dpkg-url;"/></para>
+        <para>MD5 sum: <literal>&dpkg-md5;</literal></para>
+      </listitem>
+    </varlistentry>
+
+  </variablelist>
+
+</sect1>
+<!-- If needed, uncomment and edit this:
+<sect1 id="patches">
+  <?dbhtml filename="patches.html"?>
+
+  <title>Needed Patches</title>
+
+  <para>In addition to the package(s), zero or more patches are also required.
+  These patches correct any mistakes in the packages that should be
+  fixed by the maintainer.  The patches also make small modifications to
+  make the packages easier to work with. The following patches will be
+  needed to build an LFS system:</para>
+
+  <variablelist role="materials">
+
+    <varlistentry>
+      <term>Dpkg Some Patch - <token>&dpkg-somepatche-size;</token>:</term>
+      <listitem>
+        <para>Download: <ulink url="&somepatch-url;"/></para>
+        <para>MD5 sum: <literal>&somepatch-md5;</literal></para>
+      </listitem>
+    </varlistentry>
+
+  </variablelist>
+
+</sect1>
+-->
+
+<sect1 id="ch-tools-pkgmngt" role="wrap">
+  <?dbhtml filename="dpkg.html"?>
+
+  <sect1info condition="script">
+    <productname>dpkg</productname>
+    <productnumber>&dpkg-version;</productnumber>
+    <address>&dpkg-url;</address>
+  </sect1info>
+
+  <title>Dpkg-&dpkg-version;</title>
+
+  <sect2 role="package">
+    <title/>
+
+    <para>This is my choice of package manager. Dpkg is the basic package
+    manager of Debian. It can be complemented by deselect (in the same
+    package), apt or aptitude. We use it in a very crude way.</para>
+
+    <segmentedlist>
+      <segtitle>&buildtime;</segtitle>
+      <segtitle>&diskspace;</segtitle>
+
+      <seglistitem>
+        <seg>&dpkg-ch5-sbu;</seg>
+        <seg>&dpkg-ch5-du;</seg>
+      </seglistitem>
+    </segmentedlist>
+
+  </sect2>
+
+  <sect2 role="installation">
+    <title>Installation of Dpkg</title>
+
+    <para>Since Debian is shipping its own package, all patches have already
+    been applied. Nevertheless there is either a bug or something
+    I do not understand... Apply this:</para>
+
+    <screen><userinput remap="pre">sed -i '/compress_filter(s/,/va_start/s/^$/compressor_fixup_params(params);\n/' lib/dpkg/compress.c</userinput></screen>
+
+    <para> Configure the package:</para>
+
+    <screen><userinput remap="configure">./configure --prefix=/tools \
+    --disable-nls --disable-dselect \
+    --disable-start-stop-daemon \
+    --disable-update-alternatives \
+    --without-zlib --with-liblzma=static --without-selinux</userinput></screen>
+
+    <variablelist>
+      <title>The meaning of the configure options:</title>
+
+      <varlistentry>
+        <term><parameter>--disable-dselect</parameter></term>
+        <listitem>
+          <para>Avoids building <command>dselect</command>, an
+          awful thing!</para>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry>
+        <term><parameter>--disable-start-stop-daemon</parameter></term>
+        <listitem>
+          <para>The utility <command>start-stop-daemon</command>
+          is not needed here.</para>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry>
+        <term><parameter>--disable-update-alternatives</parameter></term>
+        <listitem>
+          <para>Same for <command>update-alternatives</command>.</para>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry>
+        <term><parameter>--without-zlib</parameter></term>
+        <listitem>
+          <para>Use <command>gzip</command> for compression of binary
+          packages instead of the zlib library, which is not installed
+          in chapter 5.</para>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry>
+        <term><parameter>--with-liblzma=static</parameter></term>
+        <listitem>
+          <para>Use statically linked <command>liblzma</command> for compression
+          of binary packages.</para>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry>
+        <term><parameter>--without-selinux</parameter></term>
+        <listitem>
+          <para>Disable building for <application>selinux</application>, which
+          is not used woth LFS/BLFS.</para>
+        </listitem>
+      </varlistentry>
+
+    </variablelist>
+
+    <para>Compile the package:</para>
+
+    <screen><userinput remap="make">(cd lib  && make)
+(cd src && make)
+(cd dpkg-deb && make)
+(cd dpkg-split && make)</userinput></screen>
+
+    <para>This package does not come with a test suite.</para>
+
+    <para>Install only the needed files:</para>
+
+    <screen><userinput remap="install">cp src/dpkg src/dpkg-* /tools/bin
+cp dpkg-deb/dpkg-deb /tools/bin
+cp dpkg-split/dpkg-split /tools/bin
+mkdir -pv /tools/etc/dpkg/{,dpkg.cfg.d}
+cp debian/dpkg.cfg /tools/etc/dpkg</userinput></screen>
+
+    <para>Add a line in <filename>dpkg.cfg</filename> to
+    tell where to put administration files</para>
+
+    <screen><userinput>cat >> /tools/etc/dpkg/dpkg.cfg << EOF
+# admindir on LFS system
+admindir /var/lib/dpkg
+EOF</userinput></screen>
+
+    <para>On a Debian system, <command>dpkg</command> relies on two other
+    files to be present. Since we do not install them, issue:</para>
+
+    <screen><userinput>cat >> /tools/etc/dpkg/dpkg.cfg << EOF
+# disable fatal error on path checking
+force-bad-path
+EOF</userinput></screen>
+
+  </sect2>
+
+</sect1>
+
+<sect1 id="ch-pkgmngt-creatingdirs">
+  <?dbhtml filename="creatingdirs.html"?>
+
+  <title>Adding Directories for package management</title>
+
+  <para>Those directories should be added to the system.
+  <filename>/var/lib/dpkg</filename> and subdirectories are
+  adminitrative directories of <command>dpkg</command>.
+  <filename>/var/log</filename> is the log directory for
+  <command>dpkg</command>. <filename>/var/lib/packages</filename>
+  will be used to store our packages.deb files.</para>
+
+  <screen><userinput>mkdir -pv /var/{log,lib/dpkg/{info,updates}}
+mkdir -pv /var/lib/packages</userinput></screen>
+
+</sect1>
+
+<sect1 id="ch-pkgmngt-createfiles">
+  <?dbhtml filename="createfiles.html"?>
+
+  <title>Adding administrative files for Dpkg</title>
+  <para><command>dpkg</command> needs that some files exist to run
+  for the first time. The log file must exist in order to be
+  used.</para>
+
+  <screen><userinput>touch /var/lib/dpkg/{available,status}
+touch /var/log/dpkg.log</userinput></screen>
+
+</sect1>
+
+<sect1 id="ch-system-pkgmngt" role="wrap">
+  <?dbhtml filename="dpkg.html"?>
+
+  <sect1info condition="script">
+    <productname>dpkg</productname>
+    <productnumber>&dpkg-version;</productnumber>
+    <address>&dpkg-url;</address>
+  </sect1info>
+
+  <title>Dpkg-&dpkg-version;</title>
+
+  <sect2 role="package">
+    <title/>
+
+    <para>This is my choice of package manager. Dpkg is the basic package
+    manager of Debian. It can be complemented by deselect (in the same
+    package), apt or aptitude. We use it in a very crude way.</para>
+
+    <segmentedlist>
+      <segtitle>&buildtime;</segtitle>
+      <segtitle>&diskspace;</segtitle>
+
+      <seglistitem>
+        <seg>&dpkg-ch6-sbu;</seg>
+        <seg>&dpkg-ch6-du;</seg>
+      </seglistitem>
+    </segmentedlist>
+
+  </sect2>
+
+  <sect2 role="installation">
+    <title>Installation of Dpkg</title>
+
+    <para>Since Debian is shipping its own package, all patches have already
+    been applied. We do not need more in chapter 6. Configure it:</para>
+
+    <screen><userinput remap="configure">./configure --prefix=/usr \
+        --sysconfdir=/etc \
+        --localstatedir=/var \
+        --disable-dselect \
+        --disable-start-stop-daemon \
+        --disable-update-alternatives \
+        --without-selinux</userinput></screen>
+
+    <variablelist>
+      <title>The meaning of the configure options:</title>
+
+      <varlistentry>
+        <term><parameter>--disable-dselect</parameter></term>
+        <listitem>
+          <para>Avoids building <command>dselect</command>, an
+          awful thing!</para>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry>
+        <term><parameter>--disable-start-stop-daemon</parameter></term>
+        <listitem>
+          <para>The utility <command>start-stop-daemon</command>
+          is not needed here.</para>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry>
+        <term><parameter>--disable-update-alternatives</parameter></term>
+        <listitem>
+          <para>Same for <command>update-alternatives</command>.</para>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry>
+        <term><parameter>--without-selinux</parameter></term>
+        <listitem>
+          <para>Selinux is not used in LFS.</para>
+        </listitem>
+      </varlistentry>
+
+    </variablelist>
+
+    <para>Compile the package:</para>
+
+<screen><userinput remap="make">make</userinput></screen>
+
+    <para>This package does not come with a test suite.</para>
+
+    <para>Install the package:</para>
+
+<screen><userinput remap="install">mkdir -pv $PKG_DEST
+make DESTDIR=$PKG_DEST install
+mkdir -pv $PKG_DEST/etc/dpkg/{,dpkg.cfg.d}
+cp debian/dpkg.cfg $PKG_DEST/etc/dpkg</userinput></screen>
+
+    <para>Add a line in <filename>dpkg.cfg</filename> to
+    tell where to put administration files</para>
+
+<screen><userinput remap="install">cat >> $PKG_DEST/etc/dpkg/dpkg.cfg << EOF
+# admindir on LFS system
+admindir /var/lib/dpkg
+EOF</userinput></screen>
+
+<!-- Is this needed in chapter 06 -->
+    <para>On a Debian system, <command>dpkg</command> relies on two other
+    files (<command>ldconfig</command> and maybe <command>update-rc.d</command>)
+    to be present. Since we do not install them, issue:</para>
+
+<screen><userinput>cat >> /etc/dpkg/dpkg.cfg << EOF
+# disable fatal error on path checking
+force-bad-path
+EOF</userinput></screen>
+
+  </sect2>
+
+</sect1>
+</article>

Added: jhalfs/trunk/pkgmngt/packageManager.xml.pacman
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ jhalfs/trunk/pkgmngt/packageManager.xml.pacman	Sun Jan 18 08:58:24 2015	(r3819)
@@ -0,0 +1,189 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--  Above is a mandatory header for xml files. It must be the first
+line in the file. Change encoding to the one you use on your computer -->
+<!-- $Id$ -->
+<!-- Mandatory DOCTYPE declaration. Fill free to add entities,
+but no external entities in local files, since they would not
+be accessible from JHALFSDIR. Change the document type `article' to
+book if you prefer. That slightly changes the aspect if you render
+it in html -->
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+  "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" >
+
+<!-- The first markup should be the one defined in the DOCTYPE DECLARATION -->
+<article>
+
+<!-- First section for the tarball download address.
+Only the next four lines are mandatory, but you can add anything
+to make the text look more like the LFS book.
+Do not change  anything, except the url and the md5 checksum. -->
+<sect1 id="package">
+        <para>Download: <ulink url="http://curl.haxx.se/download/curl-7.39.0.tar.lzma"/></para>
+        <para>MD5 sum: <literal>e9aa6dec29920eba8ef706ea5823bad7</literal></para>
+        <para>Download: <ulink url="http://www.libarchive.org/downloads/libarchive-3.1.2.tar.gz"/></para>
+        <para>MD5 sum: <literal>efad5a503f66329bb9d2f4308b5de98a</literal></para>
+        <para>Download: <ulink url="ftp://ftp.archlinux.org/other/pacman/pacman-4.1.2.tar.gz"/></para>
+        <para>MD5 sum: <literal>063c8b0ff6bdf903dc235445525627cd</literal></para>
+</sect1>
+
+<!-- If needed, uncomment and edit this:
+<sect1 id="patches">
+        <para>Download: <ulink url="somepatch-url"/></para>
+        <para>MD5 sum: <literal>somepatch-md5</literal></para>
+</sect1>
+-->
+
+<!-- Do not change the next line. The name of the scriptlet will be taken
+from the dbhtml instruction: it is the name of the file less .html, with
+xxx-x-added before (x, digits). Furthermore, the tarball name must be in the form
+name_x.y.z(.extension) or name-x.y.z(.extension) if the dbhtml
+instruction  contains file="name.html" -->
+<sect1 id="ch-tools-libarchive" role="wrap">
+  <?dbhtml filename="libarchive.html"?>
+  <sect2 role="installation">
+<screen><userinput remap="configure">./configure --prefix=/tools \
+            --without-bz2lib \
+            --enable-bsdtar=static \
+            --enable-bsdcpio=static</userinput></screen>
+<screen><userinput remap="make">make</userinput></screen>
+<screen><userinput remap="install">make install</userinput></screen>
+  </sect2>
+
+</sect1>
+<sect1 id="ch-tools-curl" role="wrap">
+  <?dbhtml filename="curl.html"?>
+  <sect2 role="installation">
+<screen><userinput remap="configure">./configure --prefix=/tools \
+            --disable-static</userinput></screen>
+<screen><userinput remap="make">make</userinput></screen>
+<screen><userinput remap="install">make install</userinput></screen>
+  </sect2>
+
+</sect1>
+
+<sect1 id="ch-tools-pkgmngt" role="wrap">
+  <?dbhtml filename="pacman.html"?>
+<!-- next line mandatory without change, but feel free to add any title,
+other sect2 (with different role), sectinfo and so on -->
+  <sect2 role="installation">
+<!-- You can use any number of remap="pre", "configure", "make", "test", "install"
+<screen><userinput remap="something">Instructions</userinput></screen>.
+They are executed in that order. "pre" can be used for patching for example.
+In case testing is enabled, the instructions flagged test are logged to a different
+file (test-log). If testing is not enabled, they are not executed at all. Do not
+put line breaks before and after your instructions. <userinput> without
+remap attribute are considered configuration instructions and executed last. You
+can also use remap="adjust" for the same purpose. -->
+<screen><userinput remap="configure">./configure --prefix=/tools \
+    PKG_CONFIG_PATH=/tools/lib/pkgconfig \
+    DUPATH=/tools/bin/du</userinput></screen>
+
+<screen><userinput remap="make">make</userinput></screen>
+
+<screen><userinput remap="install">make install</userinput></screen>
+
+<screen><userinput>sed -e 's@/usr@/tools at g' \
+    -e 's/\([^!]\)strip/\1!strip/' \
+    -e 's/\([^!]\)zipman/\1!zipman/' \
+    -i /tools/etc/makepkg.conf
+cat >> /tools/etc/makepkg.conf << EOF
+BUILDDIR=/sources
+PKGDEST=/var/lib/packages
+PACKAGER="Pierre Labastie <lnimbus at club-internet.fr>"
+EOF
+cat >> /tools/etc/pacman.conf << EOF
+DBPath   = /var/lib/pacman/
+CacheDir = /var/cache/pacman/pkg/
+LogFile  = /var/log/pacman.log
+SigLevel = Never
+# Repository: do not add one now: repo-add needs openssl.
+EOF</userinput></screen>
+
+  </sect2>
+
+</sect1>
+
+<!-- Mandatory section for creating dirs. These instructions are added at the
+end of the creating dirs instructions of the book. Do not change the
+following line -->
+<sect1 id="ch-pkgmngt-creatingdirs">
+
+<!-- Put the create dir intructions there. feel free to add
+any explaining <title>Title</title> and <para>explanations</para> -->
+<screen><userinput>mkdir -pv /var/{lib/{packages,pacman},cache/pkg}</userinput></screen>
+
+</sect1>
+<!-- Same for files. Do not change the following line -->
+<sect1 id="ch-pkgmngt-createfiles">
+
+<para>No file?</para>
+
+</sect1>
+
+<!-- Last but not least : Final instructions for installing the
+package manager at the end of chapter 6. Again, the scriptlet file name is
+taken from the dbhtml instruction, with digits added before and .html cut
+and the tarball name is formed from this name + version. So the file
+here _must_ be the same as in chapter 5. If rendering in html, both
+sets of instructions end up in the same file, which is usually not a problem.
+-->
+<sect1 id="ch-system-libarchive" role="wrap">
+  <?dbhtml filename="libarchive.html"?>
+  <sect2 role="installation">
+<screen><userinput remap="configure">./configure --prefix=/usr \
+            --disable-static</userinput></screen>
+<screen><userinput remap="make">make</userinput></screen>
+<screen><userinput remap="install">make DESTDIR=$PKG_DEST install</userinput></screen>
+  </sect2>
+
+</sect1>
+<sect1 id="ch-system-curl" role="wrap">
+  <?dbhtml filename="curl.html"?>
+  <sect2 role="installation">
+<screen><userinput remap="configure">./configure --prefix=/usr \
+            --disable-static \
+            --enable-threaded-resolver</userinput></screen>
+<screen><userinput remap="make">make</userinput></screen>
+<screen><userinput remap="install">make DESTDIR=$PKG_DEST install
+find docs \( -name "Makefile*" -o -name "*.1" -o -name "*.3" \) -exec rm {} \;
+install -v -d -m755 $PKG_DEST/usr/share/doc/curl-7.39.0
+cp -v -R docs/*     $PKG_DEST/usr/share/doc/curl-7.39.0</userinput></screen>
+  </sect2>
+
+</sect1>
+<sect1 id="ch-system-pkgmngt" role="wrap">
+  <?dbhtml filename="pacman.html"?>
+
+  <sect2 role="installation">
+
+<screen><userinput remap="configure">./configure --prefix=/usr \
+            --sysconfdir=/etc \
+            --localstatedir=/var</userinput></screen>
+
+<screen><userinput remap="make">make</userinput></screen>
+
+<!-- Those instructions are executed with PKG_DEST set. They are not processed
+in any way to add $PKG_DEST at some place, and the PKG_DEST directory is not
+populated before, so it is basically empty. You have thus to create any directory
+needed in $PKG_DEST and not otherwise created by the make install command. -->
+<screen><userinput remap="install">make DESTDIR=$PKG_DEST install</userinput></screen>
+
+<screen><userinput>sed -e 's/\([^!]\)strip/\1!strip/' \
+    -e 's/\([^!]\)zipman/\1!zipman/' \
+    -i /etc/makepkg.conf
+cat >> /etc/makepkg.conf << EOF
+BUILDDIR=/sources
+PKGDEST=/var/lib/packages
+PACKAGER="Pierre Labastie <lnimbus at club-internet.fr<"
+EOF
+cat >> /etc/pacman.conf << EOF
+DBPath   = /var/lib/pacman/
+CacheDir = /var/cache/pacman/pkg/
+LogFile  = /var/log/pacman.log
+SigLevel = Never
+EOF</userinput></screen>
+
+  </sect2>
+
+</sect1>
+</article>

Modified: jhalfs/trunk/pkgmngt/packageManager.xml.template
==============================================================================
--- jhalfs/trunk/pkgmngt/packageManager.xml.template	Sun Jan 18 07:58:15 2015	(r3818)
+++ jhalfs/trunk/pkgmngt/packageManager.xml.template	Sun Jan 18 08:58:24 2015	(r3819)
@@ -100,7 +100,7 @@
 
 <!-- Last but not least : Final instructions for installing the
 package manager at the end of chapter 6. Again, the scriptlet file name is
-taken from the dbhtml instruction, with digits added before and .html cut 
+taken from the dbhtml instruction, with digits added before and .html cut
 and the tarball name is formed from this name + version. So the file
 here _must_ be the same as in chapter 5. If rendering in html, both
 sets of instructions end up in the same file, which is usually not a problem.


More information about the alfs-log mailing list