[lsb-discuss] How to handle man pages in packages installed into/opt

Stew Benedict stewb at aysenterprises.com
Tue Apr 10 05:04:11 PDT 2007

On Mon, 9 Apr 2007, Till Kamppeter wrote:

> There is a $MANPATH variable, but it is of limited use, as if you set 
> it, all other search locations of man are deactivated. So you need to 
> find out these locations and add them to $MANPATH if you want to use 
> In the build environment with installed Gutenprint (my LSB package) you get
> man ls -> OK
> MANPATH=/opt/gutenprint/man/ man ls -> not found
> MANPATH=/opt/gutenprint/man/ man escputil -> OK
> MANPATH=/opt/gutenprint/man/:/usr/share/man/ man ls -> OK
> MANPATH=/opt/gutenprint/man/:/usr/share/man/ man escputil -> OK
> To find the system's manpath there is no unique solution (another hole 
> in the LSB). Ubuntu (and probably also Debian) shows it with the command 
> "manpath", the LSB build environment needs "man --path". So assuming if 
> all distros use one of these methods, the ugly piece of code to add to 
> /etc/profile(.d) by a package's maintainer script would be
> oldmanpath=`manpath 2>/dev/null` || oldmanpath=`man --path 2>/dev/null`
> export MANPATH=/opt/PACKAGE/man:$oldmanpath
> unset oldmanpath


Doesn't work?
I do this in my personal .bash_profile for tet, and it seems to work, even 
though MANPATH isn't previously set.

Stew Benedict

More information about the lsb-discuss mailing list