Ignore:
Timestamp:
03/20/2017 03:14:54 PM (7 years ago)
Author:
Pierre Labastie <pierre@…>
Branches:
new_features
Children:
085739c
Parents:
89b7cce
Message:
  • Update README.PACKAGE_MANAGEMENT for porg
  • Improve (?) README test
  • Make VERSION lowercase in packInstall.sh.porg, since porg will do that anyway
File:
1 edited

Legend:

Unmodified
Added
Removed
  • README.PACKAGE_MANAGEMENT

    r89b7cce r2706ad5  
    11TITLE : Package management in jhalfs
    22BY    : Pierre Labastie (work in progress)
     3$Id$
    34
    451. INTRODUCTION:
     
    67      There are several hints discussing package management for LFS, but
    78  nothing under jhalfs. There used to be a patch for PACO that I cannot
    8   find now. This is a modification ("DESTDIR install" automation), which
    9   allows to use a package manager inside jhalfs. I hope it is flexible enough
    10   to support several package managers, at least among those who use DESTDIR
    11   install. My initial implementation used dpkg, from Debian, in a very
    12   crude way (Debian has a sophisticated package management system, which
    13   I have not tried to use here). There is also a port to Pacman from
    14   Arch Linux (http://www.archlinux.org). I am sorry to say I have (almost)
    15   no experience with rpm, so I cannot tell whether it would fit.
     9  find now. So there was a need for such a tool, and an infrastructure,
     10  which allows using a package manager inside jhalfs, has been developped.
     11  I hope it is flexible enough to support several package managers, at least
     12  among those who use DESTDIR install and/or LD_PRELOAD during install.
     13  It has been tested with dpkg from Debian, pacman from Arch Linux,
     14  and porg. Sample configuration files are given for those three packages.
     15  I am sorry to say I have (almost) no experience with rpm, so I cannot
     16  tell whether it would fit.
    1617
    17182. OVERVIEW OF THE SYSTEM:
    1819
    19       Presently, package management is only available for LFS. I plan to
    20   upgrade BLFS tools, but nothing usable right now. I have not attempted
    21   to adapt this tool for the other flavours of LFS.
     20      For now, package management is only available for LFS. The `porg style'
     21  (see below) package management has been ported to BLFS, but not the distro
     22  style one (the book layout makes it rather difficult). I have not attempted
     23  to adapt this tool for the other flavours of LFS (TODO).
    2224
    23       To use package management, you need to create the required files in
    24   the pkgmngt directory (see below), and to select "package management" in
    25   the build settings. Note that this is incompatible with creating an SBU
    26   and usage report.
     25      This tool comes in two flavours:
     26  - for distros package managers (e.g dpkg or pacman), it basically performs
     27    a "DESTDIR install" for all pages in chapter 6, 7 and 8 of the book. The
     28    name of the DESTDIR directory is the same as the one of the executed
     29    script. The path to this directory is available to the scriplets through
     30    the PKG_DEST variable. The details of the DESTDIR part are given below.
     31    After the package is installed in $PKG_DEST, a function "packInstall" is
     32    called, which is supposed to create a binary package (e.g. make a .deb
     33    file), store it to a repository and install it to the system.
     34  - for porg style package manager, the install instructions are wrapped
     35    between pairs of single quotes ('). This allows passing those instructions
     36    to a function ("wrapInstall"), which may itself call porg or another
     37    (e.g. fakeroot, not tested) instruction wrapper. Note that if the
     38    instructions contain single quote charaters, they are changed to '\'',
     39    which pass them literally. At the end of the installation, a function
     40    "packInstall" is called, with a slighly different aim compared to the
     41    DESTDIR one: it is used to make a tarball of the installed files (e.g.
     42    using "porgball") and store them into some repository. But there is no
     43    need to install them to the system, since this has already been done.
    2744
    28 3. DETAILS OF OPERATION:
     45      Note that with carefully crafted "packInstall" and "wrapInstall"
     46  functions, a combination of the two methods could be used, for example for
     47  DESTDIR installs using fakeroot. This is work in progress and not fully
     48  implemented yet.
    2949
    30       This system performs basically a "DESTDIR install" for all pages
    31   in chapter 6, 7 and 8 of the book. The name of the DESTDIR directory is the
    32   same as the one of the executed script. The path to this directory is
    33   made available to the scriplets through the PKG_DEST variable.
     503. DETAILS:
     51
    3452      The XSL stylesheet used for generating the scriptlets, automatically
    3553  adds DESTDIR install instructions when "package management" is selected.
     
    4361  directory. Empty directories are then removed before packing the
    4462  binary package.
     63
    4564      In order to use the package manager, it has to be installed at the end of
    4665  chapter 5 (temporary installation in /tools) and chapter 6 (final install).
     
    5170  This file should reside in the `pkgmngt' directory and be named
    5271  `packageManager.xml'. A template named `packageManager.xml.template' is
    53   provided in the `pkgmngt' subdirectory. There are also two XML files for
    54   dpkg and pacman, respectively `packageManager.xml.dpkg' and
    55   `packageManager.xml.pacman', that you can copy to `packageManager.xml'.
     72  provided in the `pkgmngt' subdirectory. There are also three XML files for
     73  dpkg, pacman, and porg, respectively `packageManager.xml.dpkg',
     74  `packageManager.xml.pacman',  and `packageManager.xml.porg', that you can
     75  copy to `packageManager.xml' and modify to suit your needs.
    5676  They are not updated often, so the versions used can be rather old.
    57       The last thing to do is to tell how to use the package manager. When
    58   the binary package is ready, the scriptlets call a shell function named
    59   `packInstall', which should pack the binary package and install it on the
    60   system. Note that nothing has been done to manage configuration files,
     77
     78      The last thing to do is to tell how to use the package manager. The user
     79  has to provide two functions, "wrapInstall" and "packInstall", as described
     80  above. Please note that nothing has been done to manage configuration files,
    6181  which are ususally treated specially by package managers: depending on
    6282  the book layout, it is sometimes possible to create those files afterwards,
    6383  and sometimes not, which means that you have to check them after each
    64   upgrade. The user has to write his own `packInstall' function. The shell
    65   function should be defined in a file named `packInstall.sh', residing in
    66   the `pkgmngt' directory. A template is provided, as well as two example
    67   scripts for dpkg and pacman. Note that, due to the way pacman checks the
    68   available space on disk, the root directory in chroot must be a mount point,
    69   otherwise the installation of packages fails.
     84  upgrade. Both functions should be defined in a file named `packInstall.sh',
     85  residing in the `pkgmngt' directory. A template is provided (actually a copy
     86  of the file for dpkg), as well as three example scripts for dpkg, pacman,
     87  and porg. Pacman Note: due to the way pacman checks the available space on
     88  disk, the root directory in chroot must be a mount point, otherwise the
     89  installation of packages fails.
Note: See TracChangeset for help on using the changeset viewer.