Posts Tagged ‘postgresql’

Build the PostgreSQL manual in Info format

Sunday, March 15th, 2009

Here’s a step-by-step guide to building the PostgreSQL manual in Info format on a Debian Lenny box:

1 – Install a few extra packages

The PostgreSQL manual is in Docbook format, so…

$ sudo apt-get install bzip2 docbook-dsssl docbook2x opensp
2 – Grab the PostgreSQL source, unpack and configure it

Change ~/workspace/src to suit your needs.

$ cd ~/workspace/src
$ apt-get source postgresql
$ cd postgresql-8.3-8.3.5
$ bunzip2 postgresql-8.3-8.3.5.tar.bz2
$ tar -xf postgresql-8.3-8.3.5.tar
## this next operation is not strictly necessary but...
$ sudo chown -R sebyte:sebyte postgresql-8.3.5  # change user/group name to suit
$ cd postgresql-8.3.5
$ ./configure
[...]
3 – Edit one of the Makefiles included in the source

We need to tell a program called osx to ignore any errors by editing the relevant Makefile using your favourite text editor.

$ cd doc/src/sgml
$ emacs -Q Makefile

## change line 227 to read:
##
##  $(OSX) -E0 -x lower $< | \
##          ^
##          |___ add this switch

While you are about it, you may also decide to edit the Makefile so that the resulting Info manual utilises the full width of your screen. (This greatly improves the look of tables within the manual, of which there are many).

## change line 263 to read:
##
## $(MAEKINFO) --fill-column 184 --enable-encoding --no-split --no-validate $< -o $@
##                            ^
## specify number of columns _|
4 – That’s it. You’re ready to roll.

Complete the process by running make:

# make postgres.info
[...]
# ls -l postgres.info
-rw-rw-r-- 1 sebyte sebyte 4939332 Jan 24 15:33 postgres.info

Job done :)

When I did it, ‘osx’ generated 108,484 errors, all of which were ignored, and there were 14 other warnings in the output, but the resulting Info manual is fine.