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