5.10. Man Pages
Prev | Chapter 5. Configuring the Makefile | Next

## 5.10. Man Pages

The `MAN[1-9LN]` variables will automatically add any manpages to `pkg-plist` (this means you must not list manpages in the `pkg-plist`—see generating PLIST for more). It also makes the install stage automatically compress or uncompress manpages depending on the setting of `NO_MANCOMPRESS` in `/etc/make.conf`.

If your port tries to install multiple names for manpages using symlinks or hardlinks, you must use the `MLINKS` variable to identify these. The link installed by your port will be destroyed and recreated by `bsd.port.mk` to make sure it points to the correct file. Any manpages listed in MLINKS must not be listed in the `pkg-plist`.

To specify whether the manpages are compressed upon installation, use the `MANCOMPRESSED` variable. This variable can take three values, `yes`, `no` and `maybe`. `yes` means manpages are already installed compressed, `no` means they are not, and `maybe` means the software already respects the value of `NO_MANCOMPRESS` so `bsd.port.mk` does not have to do anything special.

`MANCOMPRESSED` is automatically set to `yes` if `USE_IMAKE` is set and `NO_INSTALL_MANPAGES` is not set, and to `no` otherwise. You do not have to explicitly define it unless the default is not suitable for your port.

If your port anchors its man tree somewhere other than `PREFIX`, you can use the `MANPREFIX` to set it. Also, if only manpages in certain sections go in a non-standard place, such as some `perl` modules ports, you can set individual man paths using `MAN`sect`PREFIX` (where `sect` is one of `1-9`, `L` or `N`).

If your manpages go to language-specific subdirectories, set the name of the languages to `MANLANG`. The value of this variable defaults to `""` (i.e., English only).

Here is an example that puts it all together.

MAN1= foo.1 MAN3= bar.3 MAN4= baz.4 MLINKS= foo.1 alt-name.8 MANLANG= "" ja MAN3PREFIX= ${PREFIX}/share/foobar MANCOMPRESSED= yes

This states that six files are installed by this port;

${MANPREFIX}/man/man1/foo.1.gz ${MANPREFIX}/man/ja/man1/foo.1.gz ${PREFIX}/share/foobar/man/man3/bar.3.gz ${PREFIX}/share/foobar/man/ja/man3/bar.3.gz ${MANPREFIX}/man/man4/baz.4.gz ${MANPREFIX}/man/ja/man4/baz.4.gz

Additionally `${MANPREFIX}/man/man8/alt-name.8.gz` may or may not be installed by your port. Regardless, a symlink will be made to join the foo(1) manpage and alt-name(8) manpage.

If only some manpages are translated, you can use several variables dynamically created from `MANLANG` content:

MANLANG= "" de ja MAN1= foo.1 MAN1_EN= bar.1 MAN3_DE= baz.3

This translates into this list of files:

${MANPREFIX}/man/man1/foo.1.gz ${MANPREFIX}/man/de/man1/foo.1.gz ${MANPREFIX}/man/ja/man1/foo.1.gz ${MANPREFIX}/man/man1/bar.1.gz ${MANPREFIX}/man/de/man3/baz.3.gz

Prev | Up | Next
5.9. `MASTERDIR` | Home | 5.11. Info Files

This, and other documents, can be downloaded from http://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>.