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