Moved "make check" to after "make install".
[mmh] / INSTALL
1 #
2 # INSTALL -- installation instructions
3 #
4
5 --------------
6 Installing nmh
7 --------------
8 Please read all of the following instructions before you begin
9 building nmh.
10
11 You should check the MACHINES file to see if there are any specific
12 build instructions for your operating system.  To build nmh, you will
13 need an ANSI C compiler such as gcc.
14
15 0) If you have obtained nmh by checking it out of the git repository,
16    you will need to run the GNU autotools to regenerate some files.
17    (If your directory already contains a file 'config.h.in' then this
18    has already been done and you do not need to do it.)  You can
19    regenerate the files by running the command
20
21    ./autogen.sh
22
23    (Note that if you're doing nmh development, you should look at
24    docs/README.developers, since there is other developer-friendly
25    advice there as well.)
26
27    If you have obtained nmh in the form of a tar archive and are
28    trying to unpack it with cpio:  due to an apparent bug in cpio, it
29    might fail with "Malformed number" error messages.  Try another
30    tool to unpack, such as tar or pax.
31
32 1) From the top-level source directory, run the command
33
34    ./configure [options]
35
36    This will check the configuration of your OS, and create the
37    include file config.h, as well as the Makefile.
38
39    The configure script accepts various options.  The options of
40    most interest are listed in a section below.  To see the list
41    of all available options, you can run
42
43    ./configure --help
44
45 2) Look through the user configuration section at the beginning
46    of the generated include file `config.h'. You may
47    want to customize some #defines for your environment, though
48    that is usually unnecessary.  Note the configure options below
49    control some of the #defines.
50
51 3) make
52
53 4) make install
54
55    Note that if you have [n]mh files in your install directories with
56    the same names as the files being installed, the old ones will get
57    overwritten without any warning.  The only directory that isn't
58    true for is the `etc' directory -- in that directory, the previous
59    copy of each <file> will be backed up as <file>.prev if it differs
60    from the newly-installed copy.  Watch for any diff output while
61    make is processing that directory to see if you need to merge
62    changes from *.prev files into the new versions.
63
64 5) Edit the file `mts.conf' (installed in the nmh `etc' directory)
65    and make any necessary changes for the mail transport interface
66    you are using.
67
68    The default `mts.conf' file assumes you retrieve new mail from
69    a local (or NFS mounted) maildrop, and send outgoing mail by
70    injecting the message to a mail transfer agent (such as sendmail)
71    on the local machine via SMTP.
72
73    If, instead, all your mail sending and receiving occurs on a
74    remote POP/SMTP server, you will need to look at the values of the
75    variables "localname", "pophost", and "servers":
76
77     a) "localname" defines the hostname that nmh considers local.
78        If not set, then nmh queries your OS for this value.  You will
79        want to change this if you wish your e-mail to appear as if it
80        originated on the POP server.
81
82     b) "pophost" defines the server that runs the POP daemon, and to
83        which `inc' and `msgchk' will always query for new mail.
84
85     c) "servers" defines the server to which you send outgoing SMTP
86        traffic.  See the discussion of the --with-smtpserver configure
87        option below.
88
89    If you compile with POP support, but don't want to use it exclusively,
90    you can use the `-host' and `-user' options to `inc' and `msgchk'
91    rather than hardcoding pophost in `mts.conf'.
92
93    Check the `mh-tailor' man page for a list of all the available options
94    for this file ("masquerade" may be of particular interest, though its
95    default value allows the most flexibility.  See the discussion of the
96    --enable-masquerade configure option below).
97
98 6) Edit the file `mhn.defaults' (installed in the nmh `etc' directory).
99    This file contains the default profile entries for the nmh command
100    `mhn' and is created by the script `mhn.defaults.sh'.  This script
101    will search a generic path (essentially your $PATH) for programs to
102    handle various content types (for example, xv to display images).
103    You can re-run this script and give it a more tailored path.  You may
104    want to re-run this script later if you install new programs to
105    display content.  An example of this is:
106
107     % cd support/general
108     % ./mhn.defaults.sh /usr/local/bin:/usr/X11/bin:/usr/ucb > mhn.defaults
109
110    and then move `mhn.defaults' into the nmh `etc' directory.
111
112    The `mhn.defaults.sh' script only searches for a simple set of programs.
113    If you have specialized programs to handle various types, you will need
114    to edit the `mhn.defaults' file manually.  The syntax of this file is
115    described in the man page for `mhn', and in section 9.4 of the book
116    "MH & xmh: Email for Users and Programmers", 3rd edition, by Jerry Peek,
117    on the Internet at <http://rand-mh.sourceforge.net/book/mh/confmhn.html>.
118
119 7) make check
120
121    This takes a bit of time, around one minute on a modern machine,
122    but is highly recommended.  If you're going to run it, it must be
123    run after installation.  If you want to run the nmh test suite
124    prior to installation, use "make distcheck".
125
126 8) Add an optional global mh.profile, if desired.  This profile should be
127    placed in the nmh `etc' directory with the name `mh.profile'.  This
128    file will be used to construct the initial .mh_profile of a new nmh
129    user, but will not be consulted after that.
130
131 -----------------------------------------------
132 Compiler options, or using a different compiler
133 -----------------------------------------------
134
135 By default, configure will use the "gcc" compiler if found.  You can
136 use a different compiler, or add unusual options for compiling or
137 linking that the "configure" script does not know about, by giving
138 "configure" initial values for these on its command line or in its
139 environment.  For example,
140
141     ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
142
143 If you wish to add options that are only used at compile time instead of
144 link time, you can use the CPPFLAGS variable:
145
146    ./configure CPPFLAGS='-Wextra -Wno-sign-compare'
147
148 If you want to add to both compile and link flags at build time
149 without putting them in the configuration, you can use the AM_CFLAGS
150 Makefile macro:
151
152     make AM_CFLAGS=--coverage
153
154 ----------------------------------------
155 Building nmh on additional architectures
156 ----------------------------------------
157 To build nmh on additional architectures, you can do a "make distclean".
158 This should restore the nmh source distribution back to its original
159 state.  You can then configure nmh as above on other architectures in
160 which you wish to build nmh.  Or alternatively, you can use a different
161 build directory for each architecture.
162
163 ---------------------------------
164 Using a different build directory
165 ---------------------------------
166 You can compile the nmh in a different directory from the one containing
167 the source code.  Doing so allows you to compile it on more than one
168 architecture at the same time.  To do this, you must use a version of
169 "make" that supports the "VPATH" variable, such as GNU "make".  "cd" to
170 the directory where you want the object files and executables to go and
171 run the "configure" script.  "configure" automatically checks for the
172 source code in the directory that "configure" is in.  For example,
173
174     cd /usr/local/solaris/nmh
175     /usr/local/src/nmh-1.5/configure
176     make
177
178 ---------------------
179 Options for configure
180 ---------------------
181 --prefix=DIR     (DEFAULT is /usr/local/nmh)
182      This will change the base prefix for the installation location
183      for the various parts of nmh.  Unless overridden, nmh is installed
184      in ${prefix}/bin, ${prefix}/etc, ${prefix}/lib, ${prefix}/man.
185
186 --bindir=DIR     (DEFAULT is ${prefix}/bin)
187      nmh's binaries (show, inc, comp, ...) are installed here.
188
189 --libdir=DIR     (DEFAULT is ${prefix}/lib)
190      nmh's support binaries (post, slocal, mhl, ...) are installed here.
191
192 --sysconfdir=DIR     (DEFAULT is ${prefix}/etc)
193      nmh's config files (mts.conf, mhn.defaults, ...) are installed here.
194
195 --mandir=DIR     (DEFAULT is ${prefix}/man)
196      nmh's man pages are installed here.
197
198 --enable-debug
199      Enable debugging support.
200
201 --enable-masquerade[='draft_from mmailid username_extension']
202      By default, all three masquerade options are enabled.
203
204      If this option is disabled, the mts.conf file will contain the
205      line "masquerade: " (with no value), which may be manually edited
206      later.  You may find it convenient to specify a value at
207      configure-time, however, so that each time nmh is reinstalled,
208      the right value will be there.
209
210      See the mh-tailor(5) man page for full documentation of "masquerade:".
211
212      This option will likely be removed in a future version of nmh.
213
214 --enable-pop
215      Enable client-side support for pop.
216
217 --enable-apop
218      Enable client-side support for apop (Authenticated POP).
219
220 --with-editor=EDITOR  (DEFAULT is vi)
221      specify the full path of the default editor to use.  If this
222      option is not given, then the configuration process will search
223      for the `vi' command and use it as the default.  If you wish to
224      specify an interface which is compatible with MH, then use the
225      nmh command `prompter'.  If you specify `prompter', then you don't
226      need to give the full pathname.
227
228 --with-hesiod=PREFIX
229      Specify the location of Hesiod.
230
231 --with-krb4=PREFIX
232      Specify the location of Kerberos V4 for KPOP support. After
233      running configure, you will need to change the POPSERVICE #define in
234      config.h if you want to use KPOP exclusively (rather than being able
235      to switch between KPOP and normal POP3).  See the comments inside
236      config.h for details.
237
238 --with-locking=LOCKTYPE    (DEFAULT is dot)
239      Specify the locking mechanism when attempting to "inc" or
240      "msgchk" a local mail spool. Valid options are "dot",
241      "fcntl", "flock", and "lockf". Of the four, dot-locking
242      requires no special kernel or filesystem support, and simply
243      creates a file called "FILE.lock" to indicate that "FILE" is
244      locked.
245
246      In order to be effective, you should contact the site
247      administrator to find out what locking mechanisms other
248      mail delivery and user programs respect. The most common
249      reason not to use dot-locking is if the mail spool directory
250      is not world- or user-writeable, and thus a lock file cannot
251      be created.
252
253 --with-mts=MTS   (DEFAULT is smtp)
254      Specify the default mail transport system you want to use.  The two
255      acceptable options are "smtp" (which is the default), and
256      "sendmail".  This value will be put into the mts.conf file.  You
257      may find it convenient to specify a value at configure-time,
258      however, so that each time nmh is reinstalled, the right value will
259      be there.
260
261      If you use "smtp", this will enable a direct SMTP (simple mail
262      transport protocol) interface in nmh.  When sending mail, instead
263      of passing the message to the mail transport agent, `post' will
264      open a socket connection to the mail port on the machine specified
265      in the `mts.conf' file (default is localhost), and speak SMTP
266      directly.
267
268      If you use "sendmail", then `post' will send messages by forking a
269      local copy of sendmail.  Currently it will still speak SMTP with
270      this local copy of sendmail.
271
272      If you wish to use a transport agent other than sendmail, you will
273      need to use a `sendmail wrapper'.
274
275 --with-ndbm=LIB    (DEFAULT is to autodetect)
276 --with-ndbmheader=HEADER     (DEFAULT is to autodetect)
277      Specify the header file (eg ndbm.h) and library (eg ndbm) to use
278      to compile against the ndbm database library. By default, configure
279      will try various possibilities until it finds one that works; this
280      option only needs to be specified if the autodetection fails or
281      makes the wrong choice.
282
283      If either of these options is given then the other must also be
284      specified.
285
286 --with-pager=PAGER    (DEFAULT is more)
287      Specify the default pager (file lister) to use.  If this option
288      is not given, then the configuration process will search for the
289      command `more' and use it as the default.
290
291 --with-smtpservers='SMTPSERVER1[ SMTPSERVER2...]'    (DEFAULT is localhost)
292      If this option is not specified, the mts.conf file will contain
293      the line "servers: localhost", which may be manually edited later.
294      You may find it convenient to specify a value at configure-time,
295      however, so that each time nmh is reinstalled, the right value will be
296      there.
297
298      See the mh-tailor(5) man page for full documentation of "servers:".
299
300 --
301 The nmh team
302 nmh-workers@nongnu.org