Hi,

Paco Esteban wrote on Wed, Jul 24, 2019 at 06:45:45PM +0200:
> On Wed, 24 Jul 2019, Jungle Boogie wrote:
 
>> Turns out I don't know everything and I need to read man pages from
>> time-to-time. I'm sure you're like me and also want to consult the
>> man pages.

Absolutely.  Even though i tend to improve at least one manual page
almost every day, i typically consult many different manual pages
every day in addition to that, without intending to change them,
merely to look something up that i need.

>> How do you do it on applications you've installed from source?

I almost never install applications from source.

When possible, i install packages with pkg_add(1) that were compiled
on the official OpenBSD package build infrastructure.

When i want to use packages newer than the official ones (which
happens rarely because packages are officially updated at least
daily) or when i work on updating a package, i build the package
myself from the port and install the resulting package.

When i want to use software that has not been ported yet, i tend
to create a port.  That happens rarely because vast amounts of
software have already been ported.

When temporarily using or testing software that i do not want to
port, i typically use the "man -l" option.

>> Reading makewhatis.8, I think this is the tool I would use.

Yes.

>> # makewhatis -D -a /usr/local/share/man

Not exactly the question asked by the OP - but using that particular
directory for that partivular purpose is an odd choice.

In general, regard the whole tree below /usr/local/ as reserved for
packages.  Do not install anything manually there, always use pkg_add(1)
only to change anything below /usr/local/.

Admitted, packages do not use /usr/local/share/man/, so this particular
directory is unlikely to cause conflicts now or in the future, but
it is confusing nonetheless.

> As far as I know, that will create a mandoc.db on /usr/local/share/man
> That's an index for use with apropos(1) and whatis(1).

Correct.

>> but this doesn't work:
>> $ man 1 nmap
>> man: No entry for nmap in section 1 of the manual.

Try

  $ pkg_locate bin/nmap
  $ doas pkg_add nmap
  $ man nmap

>> What am I doing wrong?

> You have to tell man to look on other paths.  That can be done setting
> the MANPATH env variable.  In your case something like:
> 
> MANPATH=/usr/local/share/man:
> 
> Note the ':' at the end. That means that path will be prepended to the
> default list of paths to look for man pages.
> 
> Check man(1) for more info.

Correct.

However, *if* you want to globally install manually installed
software to be used by all users of the system, then adding your
custom manpath directory globally and system-wide may be even better.

For example, create /etc/man.conf similar to this:

  manpath /usr/share/man
  manpath /usr/X11R6/man
  manpath /usr/local/man
  manpath /usr/local/share/man

See man.conf(5) for details.

The advantages are:

 * Users need not remeber setting MANPATH
 * weekly(8) will keep /usr/local/share/man/mandoc.db up to date.

Yours,
  Ingo

Reply via email to