autogen.sh (new file): add script for running the GNU autotools in the
[mmh] / docs / README.developers
1 #
2 # README.developers
3 #
4 # $Id$
5 #
6
7 This file is intended to provide a few tips for anyone doing development on nmh.
8 Developers who learn things "the hard way" about the nmh codebase (as opposed to
9 local info best encoded in a comment) are encouraged to share their wisdom here.
10
11 The topics are organized alphabetically.
12
13
14 --------------
15 autoconf files
16 --------------
17
18 If you wish to change the `configure' script or its related files, you'll need
19 to first install GNU m4, available from <ftp://ftp.gnu.org/pub/gnu/m4/> and then
20 GNU autoconf (<ftp://ftp.gnu.org/pub/gnu/autoconf/>).  Nmh is currently using
21 a minimum of autoconf 2.54.
22
23 Most of the configure-related files are automatically generated.  The only files
24 you should need to manually edit are acconfig.h and configure.in.  Don't, for
25 instance, edit config.h.in.  Though it is an input file from the point of view
26 of the users (and the configure script) it is an output file from the point of
27 view of the developers (and the autoconf script).
28
29 Note that the automatically generated autoconf files (such as config.h.in,
30 stamp-h.in, and configure), are NOT kept in CVS.  Thus, when you check out
31 a CVS tree, you need to run the autogen.sh script before you can build
32 anything:
33
34         % ./autogen.sh
35
36 -------------------
37 directory structure
38 -------------------
39
40 Following is a list of nmh's directories along with a brief description of the
41 purpose of each one.  Meanings are given for the abbreviations, but note that
42 these meanings are just informed guesses as to what the MH developers were
43 thinking. 
44
45 ./
46     The top-level directory.  Contains files like README and INSTALL.
47
48 config/
49     Contains utility files for the `configure' process.  Ordinarily nothing in
50     here needs to be messed with.
51
52 doc/
53     Contains more specialized documentation, such as this file and
54     the FAQ.
55
56 etc/
57     Contains files, file templates, and scripts to generate files that will be
58     installed in the ${prefix}/etc directory.  Stuff like replcomps.
59
60 h/
61     Most of nmh's header (.h) files are kept not in the individual source
62     directories, but in this central location.
63
64 man/
65     Contains all the input files that are processed to generate nmh's manual
66     pages.
67
68 mts/
69     "mts" stands for "Message Transfer Service".  Source files specific to the
70     different MTSs go in the subdirectories.
71
72 mts/mmdf/ (deprecated)
73     "mmdf" stands for "Multichannel Memorandum Distribution Facility".  It is an
74     alternative to sendmail used primarily on SCO UNIX.
75
76 mts/sendmail/ (deprecated: handled by mts.conf)
77     When nmh is configured --with-mts=sendmail, the files in this directory are
78     used. 
79
80 mts/smtp/
81     When nmh is configured to just talk to an SMTP server over TCP/IP, the
82     source in this directory is compiled.
83
84 sbr/
85     "sbr" stands for "subroutine(s)".  For the most part, each source file in
86     this directory contains a single function with the same name as the source
87     file.  These functions are of general use and are called from throughout
88     nmh.  
89
90 uip/
91     "uip" stands for "User Interface Programs".  Most nmh commands have a file
92     in this directory named <command>.c containing the code for that command
93     (e.g. repl.c).  In some cases there is also an auxiliary file called
94     <command>sbr.c which contains additional subroutines called from <command>.c
95     (which would contain not much else besides main()).
96
97 zotnet/ (deprecated)
98     Files in this hierarchy were either written by or moved here by UCI
99     (University of California, Irvine) after they took over MH from the Rand
100     Corporation.  "Zot!" is the sound effect made by the anteater in the "B.C."
101     comic strip when its tongue lashes out at ants.  The anteater is UCI's
102     official mascot.  Not sure whether UCInet was once called ZotNet...
103
104 zotnet/bboards/ (deprecated)
105     UCI added Bulletin Board functionality to MH with the `bbc' command.  This
106     functionality has been removed from nmh but apparently files in this
107     directory are still needed for other purposes.
108
109 zotnet/mf/ (deprecated, now in sbr/)
110     "mf" stands for "Mail Filter".  The filtering in this case apparently refers
111     to translation between different address and mailbox formats.
112
113 zotnet/mts/ (deprecated, now in sbr/)
114     MTS code not specific to any single MTS apparently goes here.
115
116 zotnet/tws/ (deprecated, now in sbr/)
117     "tws" apparently stands for "time with structure", a rather odd phrase.
118     This directory used to be the place for date and time manipulation code, but
119     currently nothing in here is compiled.  There are new, more portable
120     versions of the key files in h/ and sbr/, and this directory will soon go
121     away completely.
122
123
124 -------------------------------------------------------
125 nmh-local functions to use in preference to OS versions
126 -------------------------------------------------------
127
128 For some system functions whose availability or behavior varies from OS to OS,
129 nmh conditionally uses a local definition with the same name as the OS function
130 (e.g. snprintf()).  For other functions, developers need to avoid the OS
131 versions and always use the nmh-supplied function.  Here is a list of such
132 functions: 
133
134 OS function  nmh-local version to use instead
135 ===========  ================================
136 getpass()    nmh_getpass()
137
138
139 -------------
140 releasing nmh
141 -------------
142
143 To make a public release of nmh (we'll use version 1.0.4 and my mhost.com
144 account, danh, as examples here; the convention for release candidates
145 is to use something like "1.0.4-RC1"):
146
147  1. % echo 1.0.4 > VERSION
148     % date +"%e %B %Y" > DATE
149     (DATE should contain something like "30 December 2000")
150
151  2. Put a comment like "Released nmh-1.0.4." in the ChangeLog.
152
153  3. % cvs commit ChangeLog VERSION DATE
154
155  4. % cvs tag nmh-1_0_4
156     (cvs treats dots specially, so underscores are substituted here.)
157
158  5. % make nmhdist
159
160  6. Untar nmh-1.0.4.tar.gz and `diff -r' it vs. your CVS tree.  Make sure no
161     files got left out of the distribution that should be in it (due to someone
162     forgetting to update the DIST variables in the Makefiles).
163
164  7. If you have root access on your machine, it's good at this point to do:
165
166     % chown -R 0:0 nmh-1.0.4
167     % tar cvf nmh-1.0.4.tar nmh-1.0.4
168     % gzip nmh-1.0.4.tar
169
170     If you leave the files in the archive as being owned by yourself, your UID
171     may coincide with one of a user on a machine where nmh is being installed,
172     making it possible for that user to Trojan the nmh code before the system
173     administrator finishes installing it.
174
175  8. Make sure your new tarball uncompresses and untars with no problem.  Make
176     sure you can configure, make, and install nmh from it.
177
178  9. If all is well and your tarball is final, go back to your CVS tree and do:
179
180     % echo 1.0.4+dev > VERSION
181
182 10. Put a comment like "Upped the version number to 1.0.4+dev until the next nmh
183     release." in the ChangeLog.
184
185 11. % cvs commit ChangeLog VERSION
186
187 12. If possible, make an MD5 hash and/or a PGP signature of nmh-1.0.4.tar.gz.
188     Assuming you have gpg set up, this should be:
189     % gpg --output nmh-1.0.4.tar.gz.sig --detach-sig nmh-1.0.4.tar.gz
190
191     You can verify the signature with
192     % gpg --verify nmh-1.0.4.tar.gz.sig nmh-1.0.4.tar.gz
193
194 13. Upload the files to savannah. First make sure they are mode 664 so
195     they will have the right permissions on the server end
196     (see https://savannah.gnu.org/maintenance/SharedDownloadArea)
197     % chmod 664 nmh-1.0.4.tar.gz*
198
199     Then scp them across:
200     % scp -p nmh-1.0.4.tar.gz* youruser@dl.sv.nongnu.org:/releases/nmh/
201
202 14. Update the http://www.nongnu.org/nmh/ homepage. (It lives in the 'webpages
203     repository'; see https://savannah.nongnu.org/cvs/?group=nmh)
204
205 15. Add a news item to the savannah nmh page. You'll have to submit it first
206     and then separately approve it (under News->Manage).
207
208 16. Send the release announcement email to the following places:
209      nmh-workers@nongnu.org
210      nmh-announce@nongnu.org
211      exmh-users@redhat.com
212      exmh-workers@redhat.com
213      mh-e-users@lists.sourceforge.net
214      mh-users@ics.uci.edu *or* comp.mail.mh (there is a bidirectional gateway)
215
216     If the release fixes significant security holes, also send an announcement
217     to bugtraq@securityfocus.com.  The exmh lists require you to be subscribed
218     in order to post.  Note that you don't need to post separately to
219     comp.mail.mh, as the mh-users mailing list is apparently bidirectionally
220     gatewayed to it.
221
222     Preferably, the announcement should contain the MD5 hash generated above,
223     and should be PGP-signed.  It should include the URL for the tarball as
224     well as the URL of the website.  It should contain a brief summary of
225     visible changes, as well as the URL of the cvsweb diff page that would show
226     a detailed list of changes.  The changes between 1.2 and 1.3 would be
227     shown by:
228
229         http://cvs.savannah.gnu.org/viewvc/nmh/ChangeLog?root=nmh&r1=1.215&r2=1.254.2.13
230