[comp.unix] org. of local man

rgc@wam.umd.edu (Ross Garrett Cutler) (07/18/90)

Hello,
	I'm setting up local man pages on an Ultrix system.  Ideally,
I would want to put them in /usr/local/man, but DEC's man(1) doesn't
handle multiple paths.  And if I put them in /usr/man (e.g.  localprog.1l)
you have to type "man 1l localprog" to get any info!  I've tried to compile
Berkleys man.c (which does support mult. paths via MANPATH or -M), but I
could not get it to work.  Please help...Ross.

felps@convex.UUCP (Robert Felps) (10/10/90)

rgc@wam.umd.edu (Ross Garrett Cutler) writes:

>	I'm setting up local man pages on an Ultrix system.  Ideally,
>I would want to put them in /usr/local/man, but DEC's man(1) doesn't
>handle multiple paths.  And if I put them in /usr/man (e.g.  localprog.1l)
>you have to type "man 1l localprog" to get any info!  I've tried to compile
>Berkleys man.c (which does support mult. paths via MANPATH or -M), but I
>could not get it to work.  Please help...Ross.

Here is something I setup on a heterogeneous network to handle man pages
from various vendors/systems. It doesn't have to do all these checks,
just check for local man pages and run nroff -man file else run man.
Sorry the codes not shar'ed.

------------------------------ code starts --------------------------------
PATH=/bin:/usr/bin:$PATH
HOSTNAME=`hostname`
while [ -n "$*" ]
 do
  case "$1" in
              -*) OPTS="$OPTS $1" ;;
    [12345678ln]) SECTION=$1 ;;
               *) FILES="$FILES $1" ;;
  esac
  shift
 done
if [ -n "$SECTION" ]
then :
else SECTION="*"
fi
for F in $FILES
 do
	# local man pages stored in NFS fs /share under subdir man
  if [ -f /share/man/man${SECTION}/${F}.${SECTION} ]
  then tbl /share/man/man${SECTION}/${F}.${SECTION} |
       nroff -T$TERM -man $OPTS                     |
       more
  else
        if [ "$SECTION" = "*" ]
        then SECTION=""
        fi
	 # System V man pages are the default for the hp system
        if [ "$HOSTNAME" = "hp835" ]
        then man $OPTS $SECTION $F
        else # Notify user that BSD/Sun man pages are being used(net default)
	     echo "NOTE: using man pages from \"suni\""
             rsh suni man "$OPTS $SECTION $F" | more
        fi
  fi
 done

jwe@emx.utexas.edu (John W. Eaton) (10/17/90)

In some article in comp.unix, rgc@wam.umd.edu (Ross Garrett Cutler)
writes:

> I'm setting up local man pages on an Ultrix system.  Ideally,
> I would want to put them in /usr/local/man, but DEC's man(1) doesn't
> handle multiple paths.  And if I put them in /usr/man (e.g.  localprog.1l)
> you have to type "man 1l localprog" to get any info!  I've tried to compile
> Berkleys man.c (which does support mult. paths via MANPATH or -M), but I
> could not get it to work.  Please help...Ross.

I wrote a set of programs and scripts for the Ultrix system that I
manage to replace the man(1), manpath(1), apropos(1), and whatis(1)
that DEC supplied.  They seem to work pretty well.  If the environment
variable MANPATH is set, my man(1) searches that list of directories.
If MANPATH is not set, it uses manpath(1) to determine the set of
directories to search based on the current PATH environment variable
and a simple manpath.config file which maps known binary directories
to known manpage directories (e.g. on my system, /usr/bin --> /usr/man, 
/usr/local/bin --> /usr/local/man, etc.).

It can also find files like /usr/man/man1/foobar.1xyz when invoked as
simply `man foobar'.

It understands the PAGER environment variable (I have it set up to use
less(1) by default because I like to be able to page backwards, but
you can change easily this at compilation time).

There are manpages for man(1), apropos(1), and whatis(1).

There are still several things that could be improved:  there's
currently no support for formatted man pages (my system doesn't have
room for them and the source files, so I didn't add this feature), and
there's no neat-o config file so you'll need to edit a few files to
install it.

If you're interested in getting a copy of this, let me know.  If
there's sufficient interest, I'll post.

--
John Eaton
jwe@emx.utexas.edu
Department of Chemical Engineering
The University of Texas at Austin
Austin, Texas  78712

tchrist@convex.com (Tom Christiansen) (10/17/90)

Furthermore, if you have perl, you can get my man program, which has quite
a lot of other features as well, including maintaining the whatis database
in DBM form and dynamic indexing of man pages allowing "man ksh/alias" or
"man perl//study".  Retrieve it from the pub/perl/scripts/tchrist/man/
subdirectory on tut.cis.ohio-state.edu .  The program is described in "The
Answer to All Man's Problems", Proceedings of the 1990 USENIX Large
Systems Administration Conference (LISA) IV, Colorado Springs, CO, October
17-19, 1990.

--tom
--
 "UNIX was never designed to keep people from doing stupid things, because 
  that policy would also keep them from doing clever things." [Doug Gwyn]

brister@decwrl.dec.com (James Brister) (10/24/90)

On 17 Oct 90 16:14:32 GMT, tchrist@convex.com (Tom Christiansen) said:

> Furthermore, if you have perl, you can get my man program, which has quite
> a lot of other features as well, including maintaining the whatis database
> in DBM form and dynamic indexing of man pages allowing "man ksh/alias" or
> "man perl//study".  Retrieve it from the pub/perl/scripts/tchrist/man/
> subdirectory on tut.cis.ohio-state.edu .  The program is described in "The
> Answer to All Man's Problems", Proceedings of the 1990 USENIX Large
> Systems Administration Conference (LISA) IV, Colorado Springs, CO, October
> 17-19, 1990.

I just got back from LISA and saw Tom's talk--his program looks very
interesting and is definitely worth checking out. (Couldn't solve all this
man's problems though :-)

James
--
James Brister                                           brister@decwrl.dec.com
DEC Western Software Lab., Palo Alto, CA    {uunet,sun,pyramid}!decwrl!brister