24.4 Updating the Documentation Set

Besides the base system and the Ports Collection, documentation is an integral part of the FreeBSD operating system. While an up-to-date version of the FreeBSD Documentation Set is always available on the FreeBSD web site, some users might have slow or no permanent network connectivity at all. Fortunately, there are several ways to update the documentation shipped with each release by maintaining a local copy of the latest FreeBSD Documentation Set.

24.4.1 Using CVSup to Update the Documentation

The sources and the installed copy of the FreeBSD documentation can be updated with CVSup, using a mechanism similar to the one employed for the base system sources (c.f. Section 24.7). This section describes:

24.4.2 Installing CVSup and the Documentation Toolchain

Rebuilding the FreeBSD documentation from source requires a fairly large collection of tools. These tools are not part of the FreeBSD base system, because they need a large amount of disk space and they are not useful to all FreeBSD users; they are only useful to those users that are actively writing new documentation for FreeBSD or are frequently updating their documentation from source.

All the required tools are available as part of the Ports Collection. The textproc/docproj port is a master port that has been developed by the FreeBSD Documentation Project, to ease the initial installation and future updates of these tools.

Note: When no PostScript® or PDF documentation required, one might consider installing the textproc/docproj-nojadetex port instead. This version of the documentation toolchain includes everything except the teTeX typesetting engine. teTeX is a very large collection of tools, so it may be quite sensible to omit its installation if PDF output is not really necessary.

For more information on installing and using CVSup, see Using CVSup.

24.4.3 Updating the Documentation Sources

The CVSup utility can fetch a clean copy of the documentation sources, using the /usr/share/examples/cvsup/doc-supfile file as a configuration template. The default update host is set to a placeholder value in doc-supfile, but cvsup(1) accepts a host name through the command line, so the documentation sources can be fetched from one of the CVSup servers by typing:

# cvsup -h cvsup.FreeBSD.org -g -L 2 /usr/share/examples/cvsup/doc-supfile

Change cvsup.FreeBSD.org to the nearest CVSup server. See Section A.6.7 for a complete listing of mirror sites.

The initial download of the documentation sources may take a while. Let it run until it completes.

Future updates of the documentation sources may be fetched by running the same command. The CVSup utility downloads and copies only the updates since the last time it ran, so every run of CVSup after the first complete run should be pretty fast.

After checking out the sources, an alternative way of updating the documentation is supported by the Makefile of the /usr/doc directory. By setting SUP_UPDATE, SUPHOST and DOCSUPFILE in the /etc/make.conf file, it is possible to run:

# cd /usr/doc
# make update

A typical set of these make(1) options for /etc/make.conf is:

SUP_UPDATE= yes
SUPHOST?= cvsup.freebsd.org
DOCSUPFILE?= /usr/share/examples/cvsup/doc-supfile

Note: Setting the SUPHOST and DOCSUPFILE value with ?= permits overriding them in the command-line of make. This is the recommended way of adding options to make.conf, to avoid having to edit the file every time a different option value has to be tested.

24.4.4 Tunable Options of the Documentation Sources

The updating and build system of the FreeBSD documentation supports a few options that ease the process of updating only parts of the documentation, or the build of specific translations. These options can be set either as system-wide options in the /etc/make.conf file, or as command-line options passed to the make(1) utility.

The following options are some of these:

DOC_LANG

The list of languages and encodings to build and install, e.g. en_US.ISO8859-1 for the English documentation only.

FORMATS

A single format or a list of output formats to be built. Currently, html, html-split, txt, ps, pdf, and rtf are supported.

SUPHOST

The hostname of the CVSup server to use when updating.

DOCDIR

Where to install the documentation. It defaults to /usr/share/doc.

For more make variables supported as system-wide options in FreeBSD, see make.conf(5).

For more make variables supported by the build system of the FreeBSD documentation, please refer to the FreeBSD Documentation Project Primer for New Contributors.

24.4.5 Installing the FreeBSD Documentation from Source

When an up-to-date snapshot of the documentation sources has been fetched in /usr/doc, everything is ready for an update of the installed documentation.

A full update of all the languages defined in the DOC_LANG makefile option may be done by typing:

# cd /usr/doc
# make install clean

If make.conf has been set up with the correct DOCSUPFILE, SUPHOST and SUP_UPDATE options, the install step may be combined with an update of the documentation sources by typing:

# cd /usr/doc
# make update install clean

If an update of only a specific language is desired, make(1) can be invoked in a language specific subdirectory of /usr/doc, i.e.:

# cd /usr/doc/en_US.ISO8859-1
# make update install clean

The output formats that will be installed may be specified by setting the FORMATS make variable, i.e.:

# cd /usr/doc
# make FORMATS='html html-split' install clean

24.4.6 Using Documentation Ports

Based on the work of Marc Fonvieille.

In the previous section, we have presented a method for updating the FreeBSD documentation from sources. It required one to install the documentation toolchain, check out the latest source files, and rebuild them. This process is very similar to rebuilding the world, i.e.: the FreeBSD sources, and it can be a bit cumbersome, and unnecessarily difficult.

An easier way to update the documentation while still staying close to the sources is to use the documentation ports provided monthly for every supported language by the Documentation Engineering Team . These ports are listed in the FreeBSD Ports Collection, under the virtual category named docs.

Basically, this technique implements almost the same method as CVSup, but here the entire process can be controlled by a simple command, and compilation of the sources might be skipped through the use of a pre-built binary package provided by the FreeBSD package building cluster. Thus, the user can decide how to update the documentation set.

Note: If building from sources is preferred, the tools needed to build the documentation will be automatically installed as a dependency.

24.4.6.1 Building and Installing Documentation Ports

Organization of the documentation ports is as follows:

  • There is a “master port”, misc/freebsd-doc-en, where the documentation port files can be found. It is the base of all documentation ports. By default, it builds the English documentation only.

  • There is an “all in one port”, misc/freebsd-doc-all, and it builds and installs all documentation in all available languages.

  • Finally, there is a “slave port” for each translation, e.g.: misc/freebsd-doc-hu for the Hungarian-language documents. All of them depend on the master port, and are present only for the ease of installation.

To install a documentation port from source, issue the following commands (as root):

# cd /usr/ports/misc/freebsd-doc-en
# make install clean

This will build and install the English documentation in split HTML format (the same as used on http://www.FreeBSD.org) in the /usr/local/share/doc/freebsd directory.

24.4.6.1.1 Common Knobs and Options

There are many other options for modifying the default behavior of the documentation ports. The following is just a short list:

WITH_HTML

Allows the build of the HTML format: a single HTML file per document (article.html, or book.html, as appropriate, plus images).

WITH_PDF

Allows the build of the Adobe® Portable Document Format, for use with Adobe Acrobat Reader® or Ghostscript (article.pdf, or book.pdf, as appropriate).

DOCBASE

Where to install the documentation. It defaults to /usr/local/share/doc/freebsd.

Note: Notice that the default target directory differs from the directory used by the CVSup method. This is because we are installing a port, and ports are usually isolated in the /usr/local directory. This can however be overriden, by adding the PREFIX variable.

Here is a brief example on how to use the variables mentioned above to install the Hungarian documentation in Portable Document Format:

# cd /usr/ports/misc/freebsd-doc-hu
# make -DWITH_PDF DOCBASE=share/doc/freebsd/hu install clean

24.4.6.2 Using Packages

If resources are not available for the complete process of building and installing the documentation ports, or we simply want to have the documentation installed in a more convenient way, binary packages are a convenient option. They can be managed as normal FreeBSD packages, via pkg_add(1), pkg_delete(1), and so on.

Note: When binary packages are used, documentation will be installed in all available formats for the given language.

The following command will install the latest monthly version of the Hungarian documentation from package:

# pkg_add -r hu-freebsd-doc

Note: Packages have the following name format that differs from the corresponding port's name: lang-freebsd-doc. Here lang is the short format of the language code, i.e. hu for Hungarian, or zh_cn for Simplified Chinese.

24.4.6.3 Updating Documentation Ports

To update a previously installed documentation port, any tool suitable for updating ports is sufficient. For example, the following command updates the installed Hungarian documentation via the ports-mgmt/portupgrade tool by using packages only:

# portupgrade -PP hu-freebsd-doc

This, and other documents, can be downloaded from ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/.

For questions about FreeBSD, read the documentation before contacting <questions@FreeBSD.org>.
For questions about this documentation, e-mail <doc@FreeBSD.org>.