Changeset bd00951 for README.PACKAGE_MANAGEMENT
- Timestamp:
- 01/18/2015 04:58:24 PM (9 years ago)
- Branches:
- 2.4, ablfs-more, legacy, new_features, trunk
- Children:
- f2e80ac
- Parents:
- 4195a40
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
README.PACKAGE_MANAGEMENT
r4195a40 rbd00951 18 18 19 19 For now, package management is only available for LFS. I plan to 20 upgrade BLFS tools, but nothing usable right now. The other flavours of 21 LFS do not seem very active, so there is no point in updating jhalfs 22 for them. 23 The first thing to do is to modify the install instructions of the 24 chapter 6, 7 and 8 of the book so that the installed files end up in a 25 directory other than `/'. We choose to call this directory by the name 26 of the executed script, and to put the path to this directory in the 27 PKG_DEST variable which is made available to the scriplets. 28 Almost all the packages have a way to redirect the destination of 29 the files they install at the `make install' stage with the variable 30 DESTDIR. Furthermore, the authors of the book have been kind enough to 31 flag the installation instructions with `remap=install'. This allows an 32 xsl stylesheet to find those instructions. Then, places where `make ' 33 occurs (make followed by a space) are replaced by `make DESTDIR=$PKG_DEST '. 34 Places where the book instructions move files into their destination 35 are harder to deal with: it is possible to change all occurences of ` /' or 36 `>/' (beginning of absolute paths) to `$PKG_DEST', but you end up moving 20 upgrade BLFS tools, but nothing usable right now. I have not attempted 21 to adapt this tool for the other flavours of LFS. 22 This system performs basically a "DESTDIR install" for all pages 23 in chapter 6, 7 and 8 of the book. The name of the DESTDIR directory is the 24 same as the one of the executed script. The path to this directory is 25 available to the scriplets through the PKG_DEST variable. 26 The XSL stylesheet used for generating the scriptlets, automatically 27 adds DESTDIR install instructions when "package management" is selected. 28 Also all the paths beginning with " /" or ">/" (absolute paths) are prepended 29 with $PKG_DEST. This has the default that you might want to move 37 30 files to non existent directories. There is no simple way to automatically 38 31 create those directories, because you have sometimes to use the full path 39 32 (instructions of the form `cp file dir') and sometimes only the dirname 40 (instructions of the form `cp file1 file2'). So I am conservative and41 create 42 directory. Empty directories should then beremoved before packing the33 (instructions of the form `cp file1 file2'). So the XSL stylesheet 34 creates a reasonable subset of the FHS hierarchy into the destination 35 directory. Empty directories are then removed before packing the 43 36 binary package. 44 Supposing now that the scriptlets have been adequately modified, the 45 package manager installation instructions have to be added at the end of 46 chapter 5 and chapter 6. Furthermore, the administrative files and 47 directories have to be created during the `Creating Directories' and 48 `Creating Essential Files' stage. For all this, the user has to supply a 49 file in docbook format, with the necessary instructions and enough 50 information to download the tarball. A template is provided in the pkgmngt 51 subdirectory. 37 In order to use the package manager, it has to be installed at the end of 38 chapter 5 (temporary installation in /tools) and chapter 6 (final install). 39 Furthermore, the administrative files and directories have to be created 40 during the `Creating Directories' and `Creating Essential Files' stages. 41 For all this, the user has to supply a file in docbook XML format, with 42 the necessary instructions and enough information to download the tarball. 43 This file should reside in the `pkgmngt' directory and be named 44 `packageManager.xml'. A template named `packageManager.xml.template' is 45 provided in the `pkgmngt' subdirectory. There are also two XML files for 46 dpkg and pacman, respectively `packageManager.xml.dpkg' and 47 `packageManager.xml.pacman', that you can copy to `packageManager.xml'. 48 They are not updated often, so the versions used can be rather old. 52 49 The last thing to do is to tell how to use the package manager. When 53 50 the binary package is ready, the scriptlets call a shell function named 54 51 `packInstall', which should pack the binary package and install it on the 55 52 system. Note that nothing has been done to manage configuration files, 56 which are ususally treated specially by package managers . Depending on53 which are ususally treated specially by package managers: depending on 57 54 the book layout, it is sometimes possible to create those files afterwards, 58 55 and sometimes not, which means that you have to check them after each 59 upgrade. The user has to provide his own function. A template is provided 60 in the pkgmngt subdirectory. 61 62 3. DETAILED INSTRUCTIONS: 63 64 Before beginning, you should know which package manager you want, where 65 to get the sources, and how to use it for: 66 a) Making a package from a directory tree. Usually, there is some control 67 file containing the version, pacakager, build system (32 or 64 bits at 68 least) or other more or less usefull but mandatory bits of information 69 which you should understand. 70 b) Unpack the package. 71 72 Second, you ought to have a basic knowledge of bash scripting and 73 docbook-xml writing, because you have to write a bash function for packing 74 and unpacking the package, and a set of instructions to install the PM. 75 56 upgrade. The user has to write his own `packInstall' function. The shell 57 function should be defined in a file named `packInstall.sh', residing in 58 the `pkgmngt' directory. A template is provided, as well as two example 59 scripts for dpkg and pacman.
Note:
See TracChangeset
for help on using the changeset viewer.