| 1 |
AUTHOR: Joern Abatz <joern@abatz.de> |
|---|
| 2 |
DATE: 2003-09-23 |
|---|
| 3 |
LICENSE: GNU Free Documentation License |
|---|
| 4 |
SYNOPSIS: Bring a Dependency Tree into linear Order |
|---|
| 5 |
PRIMARY URI: http://www.abatz.de/linux/blfs-dependencies.html |
|---|
| 6 |
|
|---|
| 7 |
DESCRIPTION: |
|---|
| 8 |
This is for newbies who install things from the BLFS book for the very |
|---|
| 9 |
first time. You cannot install the BLFS book from top to bottom. Sooner or |
|---|
| 10 |
later you will get to some package, that depends on other packages, that |
|---|
| 11 |
depend on even more other packages. This hint shall help you to keep track |
|---|
| 12 |
of what you're doing and where you are. |
|---|
| 13 |
|
|---|
| 14 |
PREREQUISITES: BLFS-BOOK-1.0.txt blfs-dependencies.tar.gz |
|---|
| 15 |
|
|---|
| 16 |
HINT: |
|---|
| 17 |
|
|---|
| 18 |
Index: |
|---|
| 19 |
------ |
|---|
| 20 |
1. How to work with depsort |
|---|
| 21 |
2. What's in the tarball |
|---|
| 22 |
3. Compiling depsort.c |
|---|
| 23 |
4. Virtual packages |
|---|
| 24 |
5. Omitted dependencies |
|---|
| 25 |
6. Format of deps.txt |
|---|
| 26 |
7. Extracting dependencies from the BLFS book |
|---|
| 27 |
8. To do |
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
1. How to work with depsort: |
|---|
| 31 |
---------------------------- |
|---|
| 32 |
|
|---|
| 33 |
That tarball http://www.abatz.de/linux/blfs-dependencies.tar.gz contains: |
|---|
| 34 |
|
|---|
| 35 |
deps.txt - a list of packages and their dependencies (from the BLFS book) |
|---|
| 36 |
depsort - a program that brings those dependencies into a linear order |
|---|
| 37 |
|
|---|
| 38 |
1. There are two lines in "deps.txt" that need editing before use: |
|---|
| 39 |
|
|---|
| 40 |
In the line |
|---|
| 41 |
mta sendmail-8.12.9 or postfix-2.0.7 or qmail-1.03 or exim-4.14 |
|---|
| 42 |
choose one MTA to install and remove the others (and remove the 'or's too) |
|---|
| 43 |
|
|---|
| 44 |
In the line |
|---|
| 45 |
xine-lib-1-beta9 xfree86-4.3.0 alsa-0.9.2 esound-0.2.29 or arts-1.1 .... |
|---|
| 46 |
choose either esound-0.2.29 or arts-1.1 and remove the other one |
|---|
| 47 |
|
|---|
| 48 |
2. Now write a list of those packages from the BLFS book, that you have |
|---|
| 49 |
already installed (one name per line) and save it as "inst.txt". If you |
|---|
| 50 |
have installed nothing of BLFS yet (only LFS), create an empty file, with: |
|---|
| 51 |
|
|---|
| 52 |
|
|---|
| 53 |
>> inst.txt |
|---|
| 54 |
|
|---|
| 55 |
|
|---|
| 56 |
3. Now write a list of packages that you want to install and save it as |
|---|
| 57 |
"wish.txt". To make a list of all the packages in "deps.txt", say: |
|---|
| 58 |
|
|---|
| 59 |
cat deps.txt | awk '{print $1}' > wish.txt |
|---|
| 60 |
|
|---|
| 61 |
(You shouldn't do that, though. Things get much clearer, if you install |
|---|
| 62 |
one package - with dependencies - at a time.) |
|---|
| 63 |
|
|---|
| 64 |
4. Then call: |
|---|
| 65 |
|
|---|
| 66 |
./depsort |
|---|
| 67 |
|
|---|
| 68 |
That produces a file named "result.txt", with a list of packages, that can |
|---|
| 69 |
be installed top to bottom. |
|---|
| 70 |
|
|---|
| 71 |
|
|---|
| 72 |
2. What's in the tarball: |
|---|
| 73 |
------------------------- |
|---|
| 74 |
|
|---|
| 75 |
deps.txt - a list of packages and their dependencies (from the BLFS book) |
|---|
| 76 |
depsort - a program that brings dependencies into a linear order |
|---|
| 77 |
depsort.c - the source code |
|---|
| 78 |
mkrawdeps1 - script to extract dependencies from the BLFS book (text |
|---|
| 79 |
version) |
|---|
| 80 |
mkrawdeps2 - script to add version numbers to the package names |
|---|
| 81 |
mkrawdeps3 - script to bring dependencies morepkgs.txt - packages to |
|---|
| 82 |
resolve open dependencies |
|---|
| 83 |
|
|---|
| 84 |
|
|---|
| 85 |
3. Compiling depsort.c: |
|---|
| 86 |
----------------------- |
|---|
| 87 |
|
|---|
| 88 |
Say: |
|---|
| 89 |
|
|---|
| 90 |
make depsort |
|---|
| 91 |
|
|---|
| 92 |
|
|---|
| 93 |
4. Virtual packages: |
|---|
| 94 |
-------------------- |
|---|
| 95 |
|
|---|
| 96 |
There are some package names in the list, that don't really exist: |
|---|
| 97 |
"mta", "alsa" and "cvs-server". I put them in, because there are packages |
|---|
| 98 |
in the BLFS book, that depend on "alsa" or on "an MTA from chapter 22" and |
|---|
| 99 |
there is a package named "cvs-server" being discussed in the book. |
|---|
| 100 |
|
|---|
| 101 |
Let's look at "alsa", "mta" and "cvs-server" as "virtual packages". |
|---|
| 102 |
They don't have tarballs of their own, just dependencies: |
|---|
| 103 |
"alsa" depends on 3 packages: alsa-lib, alsa-utils and alsa-tools. |
|---|
| 104 |
"mta" depends on 1 of 4 packages: sendmail or postfix or qmail or exim. |
|---|
| 105 |
"cvs-server" depends on 2 packages: cvs and openssh. |
|---|
| 106 |
|
|---|
| 107 |
|
|---|
| 108 |
5. Omitted dependencies: |
|---|
| 109 |
------------------------ |
|---|
| 110 |
|
|---|
| 111 |
The following dependencies from the BLFS book are not contained in this |
|---|
| 112 |
hint: |
|---|
| 113 |
- oss (because I prefer alsa, and oss was an optional dependency anyway) |
|---|
| 114 |
|
|---|
| 115 |
|
|---|
| 116 |
6. Format of deps.txt: |
|---|
| 117 |
---------------------- |
|---|
| 118 |
|
|---|
| 119 |
The first word on each line is the name of the package to be installed. |
|---|
| 120 |
The following words are the names of packages it depends on. |
|---|
| 121 |
The words must be separated by one space only. |
|---|
| 122 |
Leading or trailing whitespace is not allowed. |
|---|
| 123 |
|
|---|
| 124 |
|
|---|
| 125 |
7. Extracting dependencies from the BLFS book: |
|---|
| 126 |
---------------------------------------------- |
|---|
| 127 |
|
|---|
| 128 |
You need three files: mkrawdeps1, mkrawdeps2, mkrawdeps3, (all set |
|---|
| 129 |
executable) and a copy of the BLFS book (text version) in the same |
|---|
| 130 |
directory. |
|---|
| 131 |
|
|---|
| 132 |
mkrawdeps1 scans the book for lines containing "depends on:" and collects |
|---|
| 133 |
those lines (and the following five lines too) in a file "rawdeps1.txt". |
|---|
| 134 |
It also collects the package names (short names without version numbers) |
|---|
| 135 |
in a file "shortnames.txt". And it extracts the long package names (with |
|---|
| 136 |
version numbers) from the index part of the book and saves them in |
|---|
| 137 |
"longnames.txt". |
|---|
| 138 |
|
|---|
| 139 |
You are supposed to remove errors from those three files by hand. There |
|---|
| 140 |
are some line breaks, some smaller inconsistencies like dash "-" and |
|---|
| 141 |
underscore "_" used in package names, and some garbage to be removed. |
|---|
| 142 |
|
|---|
| 143 |
The format of the packages in the KDE section slightly differs from the |
|---|
| 144 |
rest of the book. The output of "mkrawdeps1" is somewhat garbled there. |
|---|
| 145 |
That must be fixed by hand too. |
|---|
| 146 |
|
|---|
| 147 |
And please don't delete the package separating lines "--". |
|---|
| 148 |
|
|---|
| 149 |
mkrawdeps2 then reads the file rawdeps1.txt and tries to add version |
|---|
| 150 |
numbers from "longnames.txt" and saves the result in "rawdeps2.txt". |
|---|
| 151 |
|
|---|
| 152 |
You are supposed to edit "rawdeps2.txt", remove remaining errors and add |
|---|
| 153 |
package names that the script did not find in the book. (Please add |
|---|
| 154 |
separator lines "--" if you add package names.) |
|---|
| 155 |
|
|---|
| 156 |
mkrawdeps3 then reads the file rawdeps2.txt and reformats it as the |
|---|
| 157 |
"depsort" program expects: one package name and its dependencies on one |
|---|
| 158 |
line, separated by spaces. The output is saved in "rawdeps3.txt", where it |
|---|
| 159 |
is still in book order. |
|---|
| 160 |
|
|---|
| 161 |
Compare the content of rawdeps3.txt to the dependencies in the book for a |
|---|
| 162 |
last time, then "sort | uniq" it to "deps.txt", and run ./depsort |
|---|
| 163 |
|
|---|
| 164 |
|
|---|
| 165 |
8. TODO: |
|---|
| 166 |
-------- |
|---|
| 167 |
- Handle version information as "... or newer" |
|---|
| 168 |
- Distinguish between "depends on" and "will utilize" |
|---|
| 169 |
- Create "deps.txt" automatically from the BLFS book (XML) |
|---|
| 170 |
|
|---|
| 171 |
|
|---|
| 172 |
|
|---|
| 173 |
CHANGELOG: |
|---|
| 174 |
|
|---|
| 175 |
2003-09-16 |
|---|
| 176 |
- added 3 scripts to extract the dependencies from 'the book' (text |
|---|
| 177 |
version) |
|---|
| 178 |
- all package names have now a version number (not yet handled as |
|---|
| 179 |
'... or later') - added virtual package 'mta' depending on 'sendmail or |
|---|
| 180 |
postfix or qmail or exim' - added virtual package 'cvs-server' depending |
|---|
| 181 |
on cvs and openssh 2002-9-30 |
|---|
| 182 |
- removed a bug in the program that let it see "gal" too when "galeon" was |
|---|
| 183 |
in the list |
|---|
| 184 |
- removed additional package mozilla because it is the book now - added |
|---|
| 185 |
abiword, at-spi, gconf-editor, gdm, gnumeric, libgail-gnome, mozilla, |
|---|
| 186 |
pan to the dependencies |
|---|
| 187 |
- changed dependencies for mozilla, docbook - added additional packages |
|---|
| 188 |
mentioned in the book. |
|---|