source: README.PACKAGE_MANAGEMENT@ 141d072

ablfs-more legacy trunk
Last change on this file since 141d072 was fd4a798, checked in by Pierre Labastie <pierre.labastie@…>, 3 years ago

Remove $Id$ comments, they are useless with git

  • Property mode set to 100644
File size: 5.2 KB
Line 
1TITLE : Package management in jhalfs
2BY : Pierre Labastie (work in progress)
3
41. INTRODUCTION:
5
6 There are several hints discussing package management for LFS, but
7 nothing under jhalfs. There used to be a patch for PACO that I cannot
8 find now. So there was a need for such a tool, and an infrastructure,
9 which allows using a package manager inside jhalfs, has been developped.
10 I hope it is flexible enough to support several package managers, at least
11 among those who use DESTDIR install and/or LD_PRELOAD during install.
12 It has been tested with dpkg from Debian, pacman from Arch Linux,
13 and porg. Sample configuration files are given for those three packages.
14 I am sorry to say I have (almost) no experience with rpm, so I cannot
15 tell whether it would fit.
16
172. OVERVIEW OF THE SYSTEM:
18
19 For now, package management is only available for LFS. The `porg style'
20 (see below) package management has been ported to BLFS, but not the distro
21 style one (the book layout makes it rather difficult). I have not attempted
22 to adapt this tool for the other flavours of LFS (TODO).
23
24 This tool comes in two flavours:
25 - for distros package managers (e.g dpkg or pacman), it basically performs
26 a "DESTDIR install" for all pages in chapter 6, 7 and 8 of the book. The
27 name of the DESTDIR directory is the same as the one of the executed
28 script. The path to this directory is available to the scriplets through
29 the PKG_DEST variable. The details of the DESTDIR part are given below.
30 After the package is installed in $PKG_DEST, a function "packInstall" is
31 called, which is supposed to create a binary package (e.g. make a .deb
32 file), store it to a repository and install it to the system.
33 - for porg style package manager, the install instructions are wrapped
34 between pairs of single quotes ('). This allows passing those instructions
35 to a function ("wrapInstall"), which may itself call porg or another
36 (e.g. fakeroot, not tested) instruction wrapper. Note that if the
37 instructions contain single quote charaters, they are changed to '\'',
38 which pass them literally. At the end of the installation, a function
39 "packInstall" is called, with a slighly different aim compared to the
40 DESTDIR one: it is used to make a tarball of the installed files (e.g.
41 using "porgball") and store them into some repository. But there is no
42 need to install them to the system, since this has already been done.
43
44 Note that with carefully crafted "packInstall" and "wrapInstall"
45 functions, a combination of the two methods could be used, for example for
46 DESTDIR installs using fakeroot. This is work in progress and not fully
47 implemented yet.
48
493. DETAILS:
50
51 The XSL stylesheet used for generating the scriptlets, automatically
52 adds DESTDIR install instructions when "package management" is selected.
53 Also all the paths beginning with " /" or ">/" (absolute paths) are prepended
54 with $PKG_DEST. This has the default that you might want to move
55 files to non existent directories. There is no simple way to automatically
56 create those directories, because you have sometimes to use the full path
57 (instructions of the form `cp file dir') and sometimes only the dirname
58 (instructions of the form `cp file1 file2'). So the XSL stylesheet
59 creates a reasonable subset of the FHS hierarchy into the destination
60 directory. Empty directories are then removed before packing the
61 binary package.
62
63 In order to use the package manager, it has to be installed at the end of
64 chapter 5 (temporary installation in /tools) and chapter 6 (final install).
65 Furthermore, the administrative files and directories have to be created
66 during the `Creating Directories' and `Creating Essential Files' stages.
67 For all this, the user has to supply a file in docbook XML format, with
68 the necessary instructions and enough information to download the tarball.
69 This file should reside in the `pkgmngt' directory and be named
70 `packageManager.xml'. A template named `packageManager.xml.template' is
71 provided in the `pkgmngt' subdirectory. There are also three XML files for
72 dpkg, pacman, and porg, respectively `packageManager.xml.dpkg',
73 `packageManager.xml.pacman', and `packageManager.xml.porg', that you can
74 copy to `packageManager.xml' and modify to suit your needs.
75 They are not updated often, so the versions used can be rather old.
76
77 The last thing to do is to tell how to use the package manager. The user
78 has to provide two functions, "wrapInstall" and "packInstall", as described
79 above. Please note that nothing has been done to manage configuration files,
80 which are ususally treated specially by package managers: depending on
81 the book layout, it is sometimes possible to create those files afterwards,
82 and sometimes not, which means that you have to check them after each
83 upgrade. Both functions should be defined in a file named `packInstall.sh',
84 residing in the `pkgmngt' directory. A template is provided (actually a copy
85 of the file for dpkg), as well as three example scripts for dpkg, pacman,
86 and porg. Pacman Note: due to the way pacman checks the available space on
87 disk, the root directory in chroot must be a mount point, otherwise the
88 installation of packages fails.
Note: See TracBrowser for help on using the repository browser.