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