aboutsummaryrefslogtreecommitdiffstats
path: root/INSTALL
blob: 2a5e4c57022db2eab9d58b36f391f8c41dbcece1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
Ok, so you have downloaded the XML source. Now what? You are probably
wanting to convert these XML files to easier to read HTML, PS, PDF, TXT
or other formatted files. All that can be read below.

Let's start by downloading some software.

If all you want to do is being able to convert XML to HTML download the
following:

OpenJade                  - http://openjade.sourceforge.net/
DocBook-XML DTD           - http://www.docbook.org/xml/4.1.2/
Modified DocBook Entities - 
	http://ftp.linuxfromscratch.org/misc/docbook-4.1.2-newent.tar.bz2
DSSSL DocBook Stylesheets - http://www.nwalsh.com/docbook/dsssl/

As the DocBook DTD and Stylesheets are made available as zip archives you 
may need to download the unzip package as well if your Linux system doesn't 
have one:

Unzip                     - ftp://ftp.uu.net/pub/archiving/zip/src/

If you want to be able to convert the book into PS and PDF as well I
recommend using the Htmldoc program. This takes a html file (created
with openjade which you already downloaded) and converts it to PS or
PDF:

HTMLDOC                   - http://www.easysw.com/htmldoc/
FLTK (X front-end)        - http://sourceforge.net/projects/fltk

If you want to be able to convert the book into TXT as well I recommend
using lynx to convert HTML to TXT using the -dump option to lynx.

Lynx			  - http://lynx.browser.org


You have everything you need now. Let's install this stuff.

Create the /usr/share/docbook directory, cd into it and unpack the
docbook-xml dtd archive there. Move all the files and directories from
the newly created subdirectory to the current directory
(/usr/share/docbook). We don't really need a
/usr/share/docbook/docbook-<version> subdir for our purposes.

Remove the ent directory and unpack the docbook-4.1.2-newent.tar.bz2 file.
This will create a new ent directory with entity files that work better
with XML.

Create the /usr/share/dsssl directory, cd into it and unpack the dsssl
stylesheet archive in there. Rename the directory that's created by tar
into 'docbook'. Now copy the lfs.dsl file you will find in
the LFS-BOOK XML archive into /usr/share/dsssl/docbook/html

The last step is installing OpenJade.

In order for openjade to be able to convert the DocBook based documents
into other formats, it needs to know where the DocBook DTD related
files are located. This is sort of the DocBook equivalent for the $PATH 
variable. You have two ways of doing this:

1) You can set the $SGML_CATALOG_FILES variable and include the full
paths to the catalog files in it
   or
2) You can hard-code the paths into the openjade binary.

If you choose option 1, add the following to your bash configuration
file, system wide profile or wherever you wish to include it:

export SGML_CATALOG_FILES=/usr/share/docbook/docbook.cat:/usr/share/dsssl/docbook/catalog:/usr/share/dsssl/openjade/catalog

Followed by installing openjade by running:
	./configure --prefix=/usr
	make
	make install
	cp -av dsssl /usr/share/dsssl/openjade

If you choose option 2, install OpenJade as follows:
	./configure --prefix=/usr \
	> --enable-default-catalog=/usr/share/docbook/docbook.cat:/usr/share/dsssl/docbook/catalog:/usr/share/dsssl/openjade/catalog
	make
	make install
	cp -av dsssl /usr/share/dsssl/openjade

And you don't have to worry about the $SGML_CATALOG_FILES variable in
this case.


You're all set to convert XML to HTML (among a few other formats
supported by openjade) now. If you want to convert to PS and PDF as
well, install the following two packages.

FLTK (you can skip this one if you don't want the X front-end):
	./configure --prefix=/usr
	make
	make install

Install HTMLDOC by running:
	./configure --prefix=/usr
	make
	make install


The last package is Lynx which will be used for the HTML to TXT
conversion. Install it by running:
	./configure --prefix=/usr
	make
	make install

There, all set now. Go back to the README file for some examples how to
convert this XML to the various other formats.