Index: pkgmngt/packInstall.sh.porg
===================================================================
--- pkgmngt/packInstall.sh.porg	(revision 316db229560c6efc479eb4c62c729d3a73f1bfd9)
+++ pkgmngt/packInstall.sh.porg	(revision 316db229560c6efc479eb4c62c729d3a73f1bfd9)
@@ -0,0 +1,56 @@
+# $Id:$
+# functions for recording installation of a package and make a tarball,
+# or using fakeroot type commands for install, then packing and installing
+# the package.
+# We only have access to variables PKGDIR and PKG_DEST. Other variables could
+# be set in the environment
+
+wrapInstall() {
+# a bash command is passed as an argument (that may be a compound command).
+# It is executed by this function, after various set-ups...
+
+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
+
+porg -lp ${PACKAGE}-${VERSION} sh << PORG_EOF
+$*
+PORG_EOF
+}
+
+#----------------
+packInstall() {
+
+# With porg, we need only the package name to make the tarball
+local TGTPKG=$(basename $PKG_DEST)
+local PACKAGE=$(echo ${TGTPKG} | sed 's/^[0-9]\{3\}-//' |
+           sed 's/^[0-9]\{1\}-//')
+local PCKGVRS=$(basename $PKGDIR)
+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
+# Building the binary package
+porgball ${PACKAGE}
+# The package is in the current directory
+mv -v ${PACKAGE}-${VERSION}.porg* /var/lib/packages
+}
Index: pkgmngt/packageManager.xml.porg
===================================================================
--- pkgmngt/packageManager.xml.porg	(revision 316db229560c6efc479eb4c62c729d3a73f1bfd9)
+++ pkgmngt/packageManager.xml.porg	(revision 316db229560c6efc479eb4c62c729d3a73f1bfd9)
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+  "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" >
+
+<article>
+
+<sect1 id="package">
+  <title>Package Information</title>
+        <para>Download: <ulink url="https://sourceforge.net/projects/porg/files/porg-0.10.tar.gz"/></para>
+        <para>MD5 sum: <literal>2eceb8a73bb188dbb06b12d90cabdbb4</literal></para>
+</sect1>
+
+<sect1 id="ch-tools-pkgmngt" role="wrap">
+  <?dbhtml filename="porg.html"?>
+  <title>Porg in tools</title>
+  <sect2 role="installation">
+    <title>Instructions</title>
+<screen><userinput remap="configure">./configure --prefix=/tools \
+           --disable-grop  \
+           --with-porg-logdir=/tools/var/porg</userinput></screen>
+
+    <para>
+      <parameter>--disable-grop</parameter> is needed to prevent the sytem from
+      trying to build the graphical interface, and
+      <parameter>--with-porg-logdir=...</parameter> is needed because
+      <command>make install</command> insists on creating a directory in
+      <filename class="directory">/var</filename>, where we do not want
+      to write.
+    </para>
+
+<screen><userinput remap="make">make</userinput></screen>
+
+<screen><userinput remap="install">make install</userinput></screen>
+
+<screen><userinput>cat &gt;&gt; /tools/etc/porgrc &lt;&lt; EOF
+# Porg logdir on LFS system
+LOGDIR=/var/lib/porg
+EOF
+sed -e '/EXCLUDE/{s/^#//;s@$@:/sources:/home@}' \
+    -i /tools/etc/porgrc</userinput></screen>
+
+  </sect2>
+
+</sect1>
+
+<sect1 id="ch-pkgmngt-creatingdirs">
+
+  <title>Directories</title>
+  <screen><userinput>mkdir -pv /var/lib/porg
+mkdir -pv /var/lib/packages</userinput></screen>
+
+</sect1>
+<sect1 id="ch-pkgmngt-createfiles">
+  <title>Files</title>
+  <para><command>porgball</command> needs <filename>porgrc</filename>
+    in <filename class="directory">/etc</filename>:</para>
+  <screen><userinput>cp /tools/etc/porgrc /etc</userinput></screen>
+</sect1>
+
+<sect1 id="ch-system-pkgmngt" role="wrap">
+  <?dbhtml filename="porg.html"?>
+  <title>Final Porg</title>
+  <sect2 role="installation">
+    <title>Instructions</title>
+
+<screen><userinput remap="configure">./configure --prefix=/usr     \
+            --disable-grop    \
+            --sysconfdir=/etc \
+            --with-porg-logdir=/var/lib/porg</userinput></screen>
+
+<screen><userinput remap="make">make</userinput></screen>
+
+<screen><userinput remap="install">porg -lD "make install"</userinput></screen>
+
+<screen><userinput>sed -e '/EXCLUDE/{s/^#//;s@$@:/sources:/home@}' \
+    -i /etc/porgrc</userinput></screen>
+  </sect2>
+
+</sect1>
+</article>
