# README	$Revision: 2.0.0.1 $

Oed2/Ox2 is a front-end to the Pat pattern searching applied to the Oxford
English Dictionary Version 2.  Version 2 of the OED comprises the merged
Version 1 dictionary and the Supplement.

At the request of Oxford University Press, this program should be installed
as ox2 (not oed2) at non-UIUC sites.

Pat combines very fast search capabilities over a very large text file
with an awkward user interface.  This is the price of generality.  Pat's
lack of knowledge about the structure of data it manipulates allows it
to work with many different text file formats.  In this regard Pat is
like many other UNIX tools.

The oed2/ox2 program does know about the structure of the dictionary file.
Combined with Pat, that knowledge allows easy retrieval of entire
entries or parts of entries (etymology, definitions, quotations, etc).

Oed2/Ox2 can operate in any of several modes.  Modes apply to select
operations (locate entire entries, definitions within entries, quotations
within entries, etc), and to output formats (raw, n/troff codes, VT2XX, or
formatted).

Oed2/Ox2 commands are a superset of the underlying Pat command set.  The
extra commands allow the selection of entire entries that encompass a match,
and easier manipulation of previous match results.

Because oed2/ox2 is a network resource, the oed2/ox2 program can be compiled
to use a remote Pat server.  In addition, a modified telnet server is
supplied for remote network access.  The directory telnetd-diffs has context
diffs for the 4.4 BSD telnet server.  The compiled server should be
installed as oed2d.  The following lines should then be added to
/etc/inetd.conf:

oed2	stream	tcp	nowait	root	/usr/local/etc/oed2d	oed2d
pat	stream	tcp	nowait	root	/usr/local/etc/patd	patd

Add the following to your /etc/services file:

pat		619/tcp
oed2		621/tcp

The use of ports 619 and 621 is strictly local convention at UIUC.  Any set
of ports can be used.

The Lib directory contains help, use/copy license, and a sample message of the
day file.  These are installed by default into /usr/local/lib/oed2 by the
"make install" command.

Clients need only install oed2/ox2 and add the pat entry to /etc/services.

System V users: Best results are obtained by upgrading your OS to 4.3 BSD.

MIPS users: Junk RISC 4.0 and install Ultrix.  Otherwise edit Makefile to
change install arguments, add "-systype bsd43" to CFLAGS, adjust man page
locations, etc.  A plague on vendors who offer "System V with Berkeley
enhancements".  Phooey.


Client Installation:
====================

0) Read this file completely first.  Please don't email questions to me
   until you've gone through the procedure once by the numbers.  Please
   phone only if your email system is broken.  Really.

1) Edit Makefile and oed2.h to verify the #define's follow local convention.
   The nroff invocation in PrtCmd.c may need tuning.

2) Edit Lib/motd for local tastes.  The copyright section may not be changed.

3) Do a make depend, then a make.  If mkdep doesn't exist on your system,
   get it.  Otherwise delete the dependencies at the bottom of the Makefile.

4) If any functions are un-defined, comment in the appropriate modules in
   the Makefile and repeat (2).

5) Test using a few commands such as "./oed2 vexillary" ("./ox2 vexillary").

6) Become su and do a make install.

7) Edit the /etc/services file as above.

Server Installation:
====================

Both oed2d and patd look for the user entry "oed2" in /etc/passwd to
determine the OED2 working directory.  Oed2d also uses the restricted ksh
for handling tty operations (erase, line kill, etc), and to provide limited
access to other UNIX commands.  Currently no other commands are enabled, but
hey, times might change.

The following file structure is assumed:

	/oed4		Parent directory for the oed2 usercode.
		.envfile	[Startup files from the DotFiles directory]
		.profile
		oed4 -> .	[Symlink to current directory so pathnames
				 work after /usr/local/etc/oed2d (modified
				 telnetd) does its chroot () call.]
	/oed4/2e	Directory with 2e data file and quotation files.
		2e
		2e.cntl
		2e.docs
		2e.offsets
		Eighteenth
		Eleventh
		Fifteenth
		Fourteenth
		Nineteenth
		PreEleven
		Seventeenth
		Sixteenth
		Thirteenth
		Twelfth
		Twentieth
		motd		[ printed by /oed4/.envfile ]
		pat		[ exec'ed by oed4/.envfile ]
	2e.tree		Directory (and mount point) for 2e index file
		2e.tree

Installation of patd is the minimum server installation.  To enable restricted
access to the oed2/ox2 program via telnet, the oed2d must be installed as well.

0) See step 0 for installing oed2/ox2.

1) Add the /etc/passwd entry:

	oed2:*:116:40:New OED2 user:/oed4:/bin/rksh

   Adjust the home directory as required.  Beware, oed2d has been tested only
   with the restricted ksh-88.

2) Edit the Makefile and set PAT_HOST to your Pat/OED2 server.  I recommend
   using an alias such as oed2.cso.uiuc.edu .  That way you won't have to
   re-compile clients all over creation should the server be moved to another
   machine.

3) Decide on port numbers to use for patd and for the optional oed2d services.
   Adjust the examples below to match.

  Patd Install:

  Edit patd.c and examine the chroot and chdir calls.  These will need to be
  changed if your file structure or /etc/passwd entry is different from the
  above.

  Do a make patd.  If functions are missing, edit Makefile and include them.
  Then repeat the make.

  As root, do a make server.  This installs patd into /usr/local/etc/patd.

  Edit /etc/inetd to include

    pat	stream	tcp	nowait	root	/usr/local/etc/patd	patd

  Re-start inetd.

Oed2d installation:

  First obtain the new telnet code from Berkeley using anon-FTP to
  ucbvax.berkeley.edu.  Install it as your default telnet.

  Copy the patch files in the telnetd-diffs to /usr/src/ucb/telnet/telnetd
  and apply with the patch program.

  Verify that the chdir calls in telnetd.c bracketed with #ifdef OED2,
  #endif /* OED2 */ reflect your directory hierarchy as does the rksh exec().

  Do a make oed2d.

  As root, copy oed2d to /usr/local/etc/oed2d, then edit /etc/inetd.conf to add

    oed2	stream	tcp	nowait	root	/usr/local/etc/oed2d	oed2d

  Edit /etc/services to include

    oed2		621/tcp

  Copy the files in DotFiles to the home directory of oed2.  Be sure that
  .envfile exec's oed2 with the -D flag to prohibit local file file writes
  (documented in main.c).

/pbp
