]> diplodocus.org Git - nmh/blob - docs/historical/mh-jun-1982/MHgenerate
Added several historical source archives from the early days of MH.
[nmh] / docs / historical / mh-jun-1982 / MHgenerate
1 HOW TO GENERATE AN MH
2
3 ASSUMPTIONS/RESTRICTIONS:
4
5 All of the code is written for Version 7 C, and assumes the
6 existence of appropriate Version 7 /usr/include files. It also uses the
7 Version 7 stdio package, which is somewhat different from the
8 Phototypesetter stdio!
9
10 There is moderate usage of Version 7 UNIX features, including:
11
12 ftime() system call
13 execlp() & execvp() environment exec calls
14 getenv() environment access
15
16 also, login has to be changed to add the environment entry "USER=name".
17 This is used during scan listings to see if the message "From" should be
18 replaced by "To:name". This string is NOT used to determine the "From:
19 name" stamp on outgoing mail.
20
21 All of these usages ARE replaceable by subroutines which do the
22 same thing, only slower. That is, a line of the form:
23
24 homedir = getenv("HOME");
25
26 should be replaced by something like:
27
28 homedir = gethome();
29
30 and the routine gethome() written to return the home directory by
31 looking through /etc/passwd for the line matching the process' getuid().
32 This goes for the environment variable "USER" as well.
33
34 The routines execlp() & execvp() are simply fancy exec's, which use the
35 "PATH" environment variable to determine the search path by which to
36 find the executable image. They can be replaced by routines which use a
37 default search list. They also call a shell to execute the file in the
38 same way the shell handles shell scripts.
39
40
41
42 PROCEDURE:
43
44
45 1) Read the MH directory tree onto a file system.
46 On our system it lives in the directory "/usr/src/cmd/mh".
47
48 2) Edit mh.h, and define ARPANET if you are on the ARPANET.
49 If not, don't define it. If ARPANET is not defined and if you want to
50 assign your host a name for address formatting, change HOSTNAME in
51 adrparse.h. If you are on VMUNIX, define that in mh.h and set up the
52 JOBSLIB define in progs/Makefile.
53
54 3) Examine the C header files in the "Extras" directory. Copy them to
55 /usr/include or support/ and modify them for your installation.
56 If you are going to use mh over uucp and/or ARPANET links, you must edit
57 your /usr/include/whoami.h to be sure the defines for sysname (uucp) and
58 HOSTNAME & HOSTNUM (ARPANET) are correct. If you are not on the
59 ARPANET, delete HOSTNAME and HOSTNUM from whoami.h.
60
61 4) Examine all of the files in the "strings" directory. These contain
62 site-dependent strings, such as pathnames for programs used by MH. Most
63 of the files contain short descriptions of what the strings are.
64 'showproc.c' refers to a program which is found as support/l.c and which
65 is installed as 'c' linked to 'l'. You may want to use Berkeley's
66 'more' or some other program here. The BINDIR and MHDIR entries in
67 Makefile and */Makefile must agree with the contents of strings/*.c.
68 Also, the 'file' command in support/news/mh_receive should have the same
69 path as is in strings/fileproc.c. Make sure BINDIR (/usr/local as
70 distributed) is put into everyone's PATH by login or by shell startup
71 files.
72 Note: if you are installing mh `unofficially', and you don't have
73 permissions to make directories in /usr/spool/ and /etc/, then make
74 sure the paths in the strings/*.c files and in support/mailsys.h
75 are directories you have permission to make if they don't exist already.
76 In particular, /usr/spool/locks/ must be on the same file system as
77 /usr/spool/mail so that links can be made. Try /usr/tmp/locks if
78 you can't mkdir /usr/spool/locks/.
79
80 5) Install support/putenv.c into your system libc.a, or if you don't
81 want it as part of your standard C library, move it into subs. (Both
82 options work equally well for MH!)
83
84 6) Copy the file "support/MailAliases" to /etc. Then you should look at
85 it and see if you want to add any mail aliases.
86
87 7) In the top level directory, utter:
88
89 make all
90
91 This will make both of the libraries: strings.a and subs.a, and all
92 of the executable modules.
93 (Ignore the possible error message "nm: sysname.o--no name list")
94
95
96 8) For the 'news' facility of mh to work, you must:
97 Create a user called 'news' who belongs to the group 'mail',
98 with password '--none--' in /etc/passwd and /etc/group.
99 Creat a home directory for news: "/usr/news".
100 cd /usr/news
101 /etc/chown news * .??*
102
103 9)
104 make onceonly This renames conflicting bell
105 programs, and makes requisite
106 directories.
107
108 make install This puts all of the programs,
109 misc files, and man pages
110 into appropriate directories.
111
112 10) As SU:
113 cd progs; make installroot
114
115 - If /etc/chown isn't found, try linking /bin/chown to /etc/chown
116
117 - If [ isn't found, try linking /bin/test to /bin/[
118
119 - If "true" isn't found, create the executable NULL file /bin/true.
120
121 That's it. Take a close look at the Makefile--it does LOTS of work.
122 Especially note that it renames the V7 `file' program to `filetype'
123 because for historical and other reasons, mh has its own `file' command.
124 Also, MH has its own versions of `mail' and `rmail'. If you don't want
125 to install everything in standard places, run "make install" with the
126 variables MHDIR=newdir and BINDIR=newdir pointing wherever you wish. If
127 you do this, you probably have to change some of the path names in the
128 strings files. For most of them, you can get away with adding profile
129 entries to change where the default paths are sought.
130
131 If you don't have `make':
132
133 You'll have to use the make file as a template for commands to give
134 by hand. Basically each section of the make file defines the
135 sequence of shell commands needed to create the object before the
136 `:'. The list immediately after the `:' specifies the dependencies
137 for the object--that is, those objects which either must be made
138 first, or those modules that if they've changed, the object must be
139 rebuilt. The following lines (up to the next object) are simply
140 shell commands to be executed. Make knows how to create .o's from
141 .c's, and the "CFLAGS= -O" at the beginning tells it to include
142 optimization when it does a c compile.
143
144 If you don't have stdio (i.e. some version 7 C compiler):
145
146 Punt. I recently converted the whole package from the old
147 getc/putc/iobuf subroutines--including lots of upgrades/
148 improvements, it took me about a week. Expect it to take a couple
149 of weeks for someone good to convert back. Basically, convert the
150 subroutines, then once you've converted one module (start with show
151 or comp), you'll find all the rest VERY similar. Some day I may
152 split out all of the system dependencies, but don't hold your
153 breath.
154
155
156
157 As a last resort:
158
159 Feel free to send mail to me, but please don't expect me to spend
160 hours helping. Collect your questions/problems, and get in touch and
161 I'll see what I can do. I can be reached:
162
163 via ARPANET: Borden at Rand-UNIX
164
165 Mail: The Rand Corporation
166 1700 Main Street
167 Santa Monica, CA 90406
168
169 Bruce Borden
170 April, 1980
171
172
173 If you are accessible via the arpanet or via uucp mail, please
174 contact the secretary to the Director of the Information Systems Lab at
175 Rand, and get on our mh-bugs electronic mailing list. 213/393-0411
176
177 Dave Yost
178 Februar