/*------- man version 1.5g for OS/2 release 2 (Jan-15-2000) -------------*/ Table of contents ================= Introduction @int History of OS/2 Port @his Required Executables @req OS/2 Note @os2 Installation @ins How to Install Manpages @how Important Notice @imp Compressed Manpages @com Whatis Database @wha About `viewman.cmd' @vie Pager for X terminal @pag Build from Source @bui Introduction @int ============ This is an OS/2 port of man version 1.5g. If you have questions and suggestions, please mail me. SAWATAISHI JUN, YOKOHAMA JAPAN http://www2s.biglobe.ne.jp/~vtgf3mpr/indxos2.htm History of OS/2 Port @his ==================== Jan 15 2000: release 2 makewhatis.cmd, whatis.cmd, and apropos.cmd are ported to OS/2 (jmakewhatis.cmd for Japanese users) Dec 13 1999: release 1 Required Executables @req ==================== HOBBES=ftp://hobbes.nmsu.edu/pub/os2 LEO=ftp://ftp.leo.org/pub/comp/os/os2/leo JSAWA=http://www2s.biglobe.ne.jp/~vtgf3mpr emx runtime version 0.9d (or later): Not included HOBBES/dev/emx/v0.9d/emxrt.zip GNU groff system English only version (obsolete) HOBBES/apps/wp/gnugroff.zip ; v1.10 LEO/gnu/doc/gnugroff.zip ; v1.10 GNU groff v1.15 with Japanization patch JSAWA/manpage/manpage-e.htm [English] JSAWA/manpage/manpage.htm [Japanese] GNU grep HOBBES/util/file/gnugrep.zip ; v2.0 LEO/gnu/systools/gnugrep.zip ; v2.0 JSAWA/gnu/grep.htm ; v2.3h or later [Japanized version] for `jmakewhatis.cmd' http://homepage1.nifty.com/jsawa/gnu/grep20mb.zip ; v2.0j Pager : I strongly recommend you to install `less' less 332 with Japanese patch: http://hp.vector.co.jp/authors/VA000199/os2/ You can use this in virtual terminal (xterm etc) of XFree86 for OS/2. You should get this one if you'd like to see manpages in XFree86. less 329 without XFree86 capability LEO/unix/gnu/less329-2.zip HOBBES/unix/util/util/file/less329-2.zip `gzip' and `bzip2' [gzip] HOBBES/util/archiver/gz124_32.zip LEO/gnu/archiver/gz124-32.zip [bzip2] HOBBES/util/archiver/bzip090b.zip LEO/archiver/bzip090b.zip http://www.muraroa.demon.co.uk/ JSAWA/rpm/bzip2.htm ; v0.9.5d --- this version preserve time stamp http://netpassport-wc.netpassport.or.jp/~wmakoto/CLUB-bzip2.html If you'd like to use `makewhatis.cmd'(`jmakewhatis.cmd' for Japanese) and its related shell script, these utilities must have been installed. GNU Awk [English version] HOBBES/dev/awk/gnuawk.zip ; v3.0.3 [Japanized version] for `jmakewhatis.cmd' JSAWA/gnu/awk.htm ; v3.0.4 GNU find LEO/gnu/systools/gnufind.zip ; v4.1 HOBBES/util/disk/gnufind.zip ; v4.1 GNU sed LEO/gnu/systools/gnused.zip ; v2.05 HOBBES/apps/editors/gnused.zip ; v3.0 JSAWA/gnu/sed.hgm ; v3.02.80 `tr' and `cat' included in GNU text utilities LEO/gnu/systools/gnututil.zip ; v1.19 HOBBES/util/file/gnututil.zip ; v1.19 JSAWA/gnu/text-util.htm ; v1.22f or later `sh' included in KSH package LEO/shells/pdksh-5.2.13-emx.zip HOBBES/util/shell/ksh527rt.zip `chmod' included in GNU file utilities LEO/gnu/systools/gnufutil.zip ; v3.13 HOBBES/util/file/gnufutil.zip ; v3.13 JSAWA/gnu/fileutils.htm ; v3.16 Instead of `chmod', you can use `attrib'. Kanji code converter (only for Japanese users) `kcc' executable is included in this package. OS/2 Note @os2 ========= 0. MAN_CONF environment variable is used to specify configuration file If MAN_CONF is not set, `c:/os2/etc/man.conf' is searched. 1. LANG environment variable is omitted!! 2. Configuration file `man.conf' - Directory sepatator of MANSECT must be ';' not ':' - Definition of MANPATH or MANPATH_MAP is meaningless 3. Dirctory separator of MANPATH environment variable must be ';' not ':'. Installation @ins ============ GNU groff system must have been properly installed! Install files ~~~~~~~~~~~~~~ In a drive you installed emx do like this: (I assume you install emx in E drive) c:\tmp> unzip SOMEWHERE/man15g.zip c:\tmp> dir README-man.os2 emx-man.zip c:\tmp> unzip emx-man -d e:\ c:\tmp> copy README-man.os2 e:\emx\doc\man-1.5g\ ( If you do not want to install in emx drive d:\> mkdir tmp d:\> cd tmp d:\tmp> unzip SOMEWHERE/man15g.zip d:\tmp> xcopy /s emx\* f:\foo\bar\ d:\tmp\> rm -fr emx/ ) Files are extracted as follows. emx/bin: jman.exe # Japanese message man.exe # English message man2html.exe # manpage source to HTML converter makewhatis.cmd # script to make "whatis database" jmakewhatis.cmd # for Japanese users whatis.cmd # search the whatis database for complete words apropos.cmd # search the whatis database for strings viewman.cmd # view manpage directory kcc.exe # kanji code converter (only for Japanese) gxditview.exe # viewer for groff output in XFree86 emx/diff: man-1.5g-OS2.diff.gz # patch for OS/2 emx/doc/man-1.5g: COPYING INSTALL LSM README README-man.os2 (this file you copied here) emx/etc: man.conf # configuration file sample termcap.good # for beautiful color with pager emx/man/man1: apropos.1.gz man.1.gz man2html.1.gz whatis.1.gz # English emx/man/man5: man.conf.5.gz # English emx/man/ja_JP.ujis/man1: apropos.1.gz man.1.gz whatis.1.gz # Japanese (EUC) kcc.1 emx/man/ja_JP.ujis/man5: man.conf.5.gz # Japanese (EUC) Setup Environment Variables ~~~~~~~~~~~~~~~~~~~~~~~~~~~ In your `config.sys': set MAN_CONF=e:/emx/etc/man.conf (Do not use "\") set MANPATH=e:/emx/man;e:/emx/man/ja_JP.ujis; # Separate manpage directories with ';' # If you have another directories for # manpage add them. set MANPAGER=less # OS/2 default `more' can be used, but not # recommended. If you are Japanese, `less' # should support Japanese charactor code. or set PAGER=less If you do not set MANPAGER, PAGER environment variable is read. You can do without settin MANPAGER nor PAGER. This case define PAGER in `man.conf'. If you don't want to set MAN_CONF env. var., copy `man.conf' in `c:/os2/etc'. Other env. vars. are optional. To know them, view manpage for `man' after installation. If you'd like to see manpage more beautifully with `less' set TERMCAP=e:/emx/etc/termcap.good set TERM=os2 We can't find beautiful setting for TERM environment variable in `termcap.dat' included in emx package. So I strongly recommend you to use this modified `termcap.dat'. Edit `man.conf' in `e:/emx/etc' If you don't set environment variable PAGER nor MANPAGER, PAGER definition in `man.conf' adopted. If you'd like to compress manpage with `bzip2' COMPRESS bzip2 COMPRESS_EXT .bz2 For Japanized groff system NEQN neqn -Tnippon NROFF -mandocj -Tnippon TROFF groff -Tps -mandocj For non-Japanized groff system NEQN neqn -Tascii(or latin1) NROFF -mandocj -Tascii(or latin1) TROFF groff -Tps -mandoc You may have to add some suffixes to MANSECT If you'd like to use pager `more' which have no color capability Add " -P-u -P-b" to your NROFF definition like this; NROFF -mandocj -Tascii -P-u -P-b Now, installation has neary finished. Test manpage system. In command line c:\> set MANPATH=e:/emx/man;e:/emx/man/ja_JP.ujis; c:\> set MAN_CONF=e:/emx/etc/man.conf c:\> set MANPAGER=less c:\> man man If you can view manpage for `man', installaion is O.K. If this test succeeds, reboot your machine. How to Install manpages @how ======================= Determine root directory of manpages. If you decided to install them in `x:/foo/bar/man', directory structure should be as follows. x:/foo/bar/man x:/foo/bar/man/man1/*.1 x:/foo/bar/man/man2/*.2 x:/foo/bar/man/man3/*.3 ......... ......... x:/foo/bar/man/man9/*.9 x:/foo/bar/man/mann/*.n ......... Next, you should make "cat" directories like this x:/foo/bar/man/cat1/ # When "cat" directories are exist, x:/foo/bar/man/cat2/ # formatted manpages are stored in x:/foo/bar/man/cat3/ # those. When formatted manpage ......... # exists, `man' will open it ......... # without using groff formatter. x:/foo/bar/man/cat9/ x:/foo/bar/man/catn/ ......... If you'd like to install manpage not in manN (N is number), freely do it. x:/foo/bar/man> mkdir manX1 x:/foo/bar/man> cp SOMEWHRE/man/*.? manX1/ x:/foo/bar/man> cd manX1 x:/foo/bar/man/manX1> rename *.? *.X1 x:/foo/bar/man/manX1> bzip2 *.X1 Add "X1" to MANSECT in `man.conf' MANSECT 1;8;2;3;4;5;6;7;9;tcl;n;l;p;o;X1; Test installed man > set MANPATH=%MANPATH%;x:/foo/bar/man; > man FOO Add new directories to MANPATH environment variable in your `config.sys' like this set MANPATH=e:/emx/man;e:/emx/man/ja_JP.ujis;x:/foo/bar/man; IMPORTANT NOTICE @imp ================ Full pathname of manpage must be this form. MAN_PATH/manSEC/name.SEC[ADD][.COMP_SUFFIX] MAN_PATH: One of a directory defined by MANPATH env. var. ADD: Any string which does not include '.' SEC: One of a section defined by MANSECT in `man.conf' .COMP_SUFFIX: This is optional (.bz2, .gz, .Z, ...) When MANSECT is "1;8;2;3;4;5;6;7;9;tcl;n;l;p;o", MANPATH is "e:/emx/man" About ADD e:/emx/man/man1/foo.1x O.K. e:/emx/man/man1/foo.gz Bad e:/emx/man/man1/foo.x Bad e:/emx/man/man1/foo.1fo.gz O.K. e:/emx/man/man7/foo.7man O.K. e:/emx/man/man7/foo.7man O.K. I present you some examples of improperly installed manpages Section name and file name are incompatible e:/emx/man/man1/foo.5 e:/emx/man/mantcl/foo.1 Section name is missed e:/emx/man/man1/foo.gz Section name is not defined by MANSECT e:/emx/man/manX/foo.X.5 Location of manpage is not in MANPATH directories e:/emx/man/foo.1 e:/usr/man/man1/foo.1 e:/emx/man/ja/man1/foo.1 About Compressed Manpage @com ======================== If you have installed `gzip' and `bzip2', you can view compressed manpages Simply compress manpages like this. e:\emx\man> dir e:\emx\man> cd man1 e:\emx\man\man1> bzip2 *.? e:\emx\man\man1> cd ..\man5 e:\emx\man\man5> bzip2 *.? ............. ............. Or e:\emx\man> find . -name *.* ! -name *gz ! -name *bz2 | xargs bzip2 -f If and only if you have made "cat" directories, formatted manpages are reserved in that directories, if you properly defined COMPRESS and COMPRESS_EXT in `man.conf'. Let's think about this example. e:/emx/man/man1/* # Formatted manpages for "man1", "man5", and cat1/ # "manBAR" are stored in theire cat directories, man3/* # if and only if MANSECT, COMPRESS, and man5/* # COMPRESS_EXT are properly defined in cat5/ # `man.conf'. manFOO/* manBAR/* # Formatted manpages for "man3" or "manFOO", catBAR/ # are not saved in disk, even if MANSECT, # COMPRESS, and COMPRESS_EXT are properly set. About Whatis Database @wha ===================== I recommend you to make whatis-database using `makewhatis'. After you made the database, you can query keyword about manpages. The structure of whatis-database is simple. c.f. md5sum (1) - generates or checks MD5 message digests nkf (1) - Network Kanji code conversion Filter v1.7 sgml2html (1) - create HTML output from a SGML source file .............. .............. In the database, NAME, SECTION, and short DESCRIPTION is ordered this way. - whatis.cmd: You give _exact_ keyword[s] about NAME c.f. c:\foo> whatis bzip2 bzip2, bunzip2 (1) - a block-sorting file compressor, v0.9.5 c:\foo> whatis chmod cat chmod (1) - change the access permissions of files cat (1) - concatenate files and print on the standard output c:\foo> whatis chmog cat chmog: nothing appropriate cat (1) - concatenate files and print on the standard output - apropos.cmd: Argument[s] are keyword[s] about both NAME and short DESCRIPTION When you'd like to know what kind of manpages related to LaTex is installed, do like this. c:\foo> apropos latex amslatex (1) - structured text formatting and typesetting jbibtex (1) - make a (Japanese) LaTeX bibliography latex, elatex, lambda, pdflatex (1) - structured text formatting and typesetting sgml2latex (1) - create plain text output from a SGML source file slitex (1) - make LaTeX slides reLyX (1) - translate well-behaved LaTeX into LyX I qeuried translation. Obtained output is shown below. c:\foo> apropos traslate dmp (1) - translate Troff output to low-l .... dvitype (1) - translate a dvi file for humans .... fig2tex (1) - translates Fig intermediate cod .... gftype (1) - translate a generic font file f .... makeinfo (1) - translate Texinfo documents .... mft (1) - translate Metafont code to TeX .... pfbtops (1) - translate a PostScript font in .... pktype (1) - verify and translate a packed f .... plot (1) - translate GNU metafiles to othe .... rast (1) - translate output of sgmls to RA .... sgmlsasp (1) - translate output of sgmls using .... tangle (1) - translate WEB to Pascal .... tek2plot (1) - translate Tektronix files to ot .... tr (1) - translate or delete characters .... weave (1) - translate WEB to TeX .... MIME::Latin1 (3) - DEPRECATED package to translate .... pl2pm (1) - Rough tool to translate Perl4 . .... pod2man (1) - translate embedded Perl pod dir .... reLyX (1) - translate well-behaved LaTeX in .... Tcl_TranslateFileName (3) - convert file name to nati .... _Before_ you run `makewhatis', carefully read instructions below!! - makewhatis.cmd: First of all read manpage for it (1) DEFMANPATH and DEFCATPATH I recommend you not to define DEFMANPATH nor DEFCATPATH, because all defined directories are searched when `makewhatis' is invoked without argument; it costs time. You'd better give `makewhatis' one directory for making database. If you'd like to define default path, do like this. line 89: DEFMANPATH='e:/emx/man;k:/usr/man/ja_JP.ujis;k:/usr/man' (2) For Japanese Users GNU awk, GNU grep, and `less' should be Japanese version. You may copy `jmakewhatis.cmd' to `makewhatis.cmd'. (3) Setup temporaty directory Define temporaty directory for `makewhatis' in your `config.sys' or `makewhatis.cmd' If you'd like to use "f:/tmp" as tmp. dir. Confirem "f:/tmp" exists In your `config.sys': set TMPDIR=f:/tmp Or modify `makewhatis.cmd': line 38: if [ -z "$TMPDIR" ] # This means "if TMPDIR env. var. then # is not exist" TMPDIR=f:/tmp # Change this line according to fi # your environment. (4) Specify sections for searching Because `makewhatis' does not read your `man.conf' which defines MANSECT, modify a line about sections if needed. line 98: sections="1 2 3 4 5 6 7 8 9 n l" (5) Select `chmod' (GNU file utilities) or `attrib' File permission must be changed to read/write. line 64: CHMOD_CMD='chmod +rw' or CHMOD_CMD='attrib -h -s -r' (6) Decide whether manpages are compressed or not If you do not compress them, define COMPRESS_CMD as empty line 58: COMPRESS_CMD= # _Do_ _not_ add space or tab # after '=' Now, you can use `makewhatis'. Test it in command line. c:\> makewhatis -h # for HELP c:\> makewhatis # If DEFMANPATH is defined in # makewhatis.cmd, database will # be made c:\> whatis man.conf # Manpage about man.conf will be shown c:\> makewhatis e:/emx/man # If _one_ directory for manpage is # given, only this directory is searched # to make database, even if you defined # DEFMANPATH c:\> makewhatis -w # Execution of "man -w" outputs, MANPATH # environment variable. When `make- # whatis' is invoked with "-w" option # directories of MANPATH are searched, # with no relation to DEFMANPATH. - `whatis.cmd' and `apropos.cmd' If the name of your GNU grep is not "grep", specify its real name. Japanese user's note: If your `grep' do not support Japanese code, sometimes these script will fail. About `viewman.cmd' @vie ================== `viewman.cmd' : A shell script to view given manpage - recognize whether manpage is formatted or not; compressed or not. -- Setting up Open `viewman.cmd' with your editor and modity lines if needed. line 45: device=nippon This line specifies default device in VIO mode. If you are not Japanese, device should be "ascii" or "latin1". line 64: device=X100-12 When `viewman' is invoked with "-x" option, "X100-12" device is used. Choose a device for X window among "X100", "X100-12", "X75", and "X75-12". When `viewman' is invoked without option nor argument, it outputs usage information. x:\src> viewman Read manpage with 'groff' and PAGER If PAGER environment variable in not set, OS/2 default 'more' is used Usage: viewman [-x] x:/foo/bar/manpage.3.gz echo -x: output in X window View manpages like this. x:\src> viewman e:/emx/man/man1/foo.1.bz2 x:\src> viewman e:/emx/man/man1/bar.1 x:\src> viewman e:/emx/man/man1/hoge.1.gz x:\src> viewman k:/src/FOO/moge.1 In `xterm' x:\src> viewman e:/emx/man/man1/bar.1.bz2 x:\src> viewman -x e:/emx/man/man1/bar.1.bz2 Pager for X terminal @pag ==================== As mentioned above, you can view manpage in X terminals, xterm, rxvt, kterm.., if and only if `less' supporting XFree86 is installed. `gxditview' included in GNU groff system is X window based viewer, which is invoked by `groff' with option like "-TX100". I recommend you to use `viewman.cmd' with "-x" option in XFree86. x:\> viewman -x SOMEWHERE/man/man1/foo.1.gz You will see manpage "foo" in `gxditview's window. Options for X terminal output are "X100", "X100-12", "X75", "X75-12". Compile from source @bui =================== Man source can be retrieved via ftp ftp://ftp.win.tue.nl/pub/linux-local/utils/man/man-1.5g.tar.gz To run shell script in `Makefile', `sh.exe' must be available. You can get its copy from ftp sites: ftp.leo.org/pub/comp/os/os2/leo/shells/pdksh-5.2.13-emx.zip Use GNU patch, `patch.exe' or `gpatch.exe': OS/2 default `patch.exe' can't be used. GNU gcc and GNU file utilities must be available. > tar zxvf SOMEWHERE man-1.5g.tar.gz > cd man-1.5g man-1.5g> gzip -dc e:/emx/src/man-1.5g-OS2.diff.gz | patch -p1 man-1.5g> make That's all SAWATAISHI JUN, YOKOHAMA JAPAN http://www2s.biglobe.ne.jp/~vtgf3mpr/indxos2.htm /*----- end of document -----------------------------------------------------*/