bae6d9ccffdba678201574c932c5d922ba1db4c7
[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 & automake files
14 -------------------------
15
16 If you wish to change the `configure' script, the generated Makefile
17 or other related files, you'll need to first install GNU m4, available
18 from <ftp://ftp.gnu.org/pub/gnu/m4/>, then GNU autoconf
19 (<ftp://ftp.gnu.org/pub/gnu/autoconf/>) and GNU automake
20 (<ftp://ftp.gnu.org/pub/gnu/automake/>).  Nmh is currently using a
21 minimum of autoconf 2.61 and automake 1.10.
22
23 Most of the configure-related files are automatically generated.
24 The only files you should need to manually edit are configure.ac
25 and any autoconf macros in the m4 directory.  Don't, for instance,
26 edit config.h.in.  Though it is an input file from the point of
27 view of the users (and the configure script) it is an output file
28 from the point of view of the developers (and the autoconf script).
29
30 If you wish to add a new autoconf macro, it should be placed in it's
31 own file and put in the m4 directory; aclocal will automatically pick
32 it up and automake will add it to the distribution target automatically.
33
34 If you wish to make changes to the Makefile, you will need to edit
35 Makefile.am.  See the automake documentation if you need further help.
36 You should always check changes to Makefile.am by using "make distcheck".
37
38 Note that the automatically generated autotools files (such as config.h.in,
39 Makefile.in, and configure), are NOT kept in git.  Thus, when you check out
40 a git tree, you need to run the autogen.sh script before you can build
41 anything:
42
43         % ./autogen.sh
44
45
46 -------------------
47 directory structure
48 -------------------
49
50 Following is a list of nmh's directories along with a brief description of the
51 purpose of each one.  Meanings are given for the abbreviations, but note that
52 these meanings are just informed guesses as to what the MH developers were
53 thinking.
54
55 ./
56     The top-level directory.  Contains files like README and INSTALL.
57
58 config/
59     Contains utility files for the `configure' process.  Ordinarily nothing in
60     here needs to be messed with.
61
62 docs/
63     Contains more specialized documentation, such as this file and
64     the FAQ.
65
66 etc/
67     Contains files, file templates, and scripts to generate files that will be
68     installed in the ${prefix}/etc directory.  Stuff like replcomps.
69
70 h/
71     Most of nmh's header (.h) files are kept not in the individual source
72     directories, but in this central location.
73
74 man/
75     Contains all the input files that are processed to generate nmh's manual
76     pages.
77
78 mts/
79     "mts" stands for "Message Transfer Service".  Source files specific to the
80     different MTSs go in the subdirectories.
81
82 mts/smtp/
83     When nmh is configured to just talk to an SMTP server over TCP/IP, the
84     source in this directory is compiled.
85
86 sbr/
87     "sbr" stands for "subroutine(s)".  For the most part, each source file in
88     this directory contains a single function with the same name as the source
89     file.  These functions are of general use and are called from throughout
90     nmh.
91
92 test/
93     The num unit test suite.
94
95 uip/
96     "uip" stands for "User Interface Programs".  Most nmh commands have a file
97     in this directory named <command>.c containing the code for that command
98     (e.g. repl.c).  In some cases there is also an auxiliary file called
99     <command>sbr.c which contains additional subroutines called from <command>.c
100     (which would contain not much else besides main()).
101
102
103 ---
104 git
105 ---
106
107 As of December 2010, nmh has switched to using git for revision control
108 instead of CVS.  While the topic of git is beyond the scope of this FAQ,
109 to get started with git & nmh, you can run the following command to checkout
110 the nmh repository:
111
112     % git clone git://git.savannah.nongnu.org/nmh.git
113
114 That will create a workspace call nmh.  To update that workspace
115 with changes to the master, cd to it and run:
116
117     % git pull
118
119
120 -------------------------------------------------------
121 nmh-local functions to use in preference to OS versions
122 -------------------------------------------------------
123
124 For some system functions whose availability or behavior varies from OS to OS,
125 nmh conditionally uses a local definition with the same name as the OS function
126 (e.g. snprintf()).  For other functions, developers need to avoid the OS
127 versions and always use the nmh-supplied function.  Here is a list of such
128 functions:
129
130 OS function  nmh-local version to use instead
131 ===========  ================================
132 getpass()    nmh_getpass()
133
134
135 -------------
136 releasing nmh
137 -------------
138
139 To make a public release of nmh (we'll use version 1.5 as the example
140 here; the convention for release candidates is to use something like
141 "1.5-RC1"):
142
143  1. % echo 1.5 > VERSION
144     % date +"%e %B %Y" > DATE
145     (DATE should contain something like "30 December 2000")
146
147  2. % git commit VERSION DATE; git push
148
149  3. % git tag -a 1.5 -m 'Releasing nmh-1.5.'
150
151     Note that the new convention for tagging is to simply tag with the
152     version number (tag formats in the past have varied).
153
154  4. % make distcheck
155
156     If you want to check the distribution build with some particular
157     configure options, set the DISTCHECK_CONFIGURE_FLAGS variable.
158     E.g.:
159
160     % make distcheck DISTCHECK_CONFIGURE_FLAGS=--with-cyrus-sasl
161
162  5. If all is well and your tarball is final, go back to your workspace and do:
163
164     % echo 1.5+dev > VERSION
165
166  6. % git commit VERSION; git push
167
168  7. Upload the distribution file to savannah.  You can automate this process
169     by doing:
170
171     % make upload SAVANNAH_USERNAME=username
172
173     This will automatically call gpg to sign the release.  You can bypass
174     this step by setting the SKIP_GPG_SIG variable.
175
176  8. Update the http://www.nongnu.org/nmh/ homepage. (It lives in the CVS
177     'webpages repository'; see https://savannah.nongnu.org/cvs/?group=nmh)
178
179  9. Add a news item to the savannah nmh page. You'll have to submit it first
180     and then separately approve it (under News->Manage).
181
182 10. Send the release announcement email to the following places:
183      nmh-workers@nongnu.org
184      nmh-announce@nongnu.org
185      exmh-users@redhat.com
186      exmh-workers@redhat.com
187      mh-e-users@lists.sourceforge.net
188
189     If the release fixes significant security holes, also send an announcement
190     to bugtraq@securityfocus.com.  The exmh lists require you to be subscribed
191     in order to post.  Note that you don't need to post separately to
192     comp.mail.mh, as the mh-users mailing list is apparently bidirectionally
193     gatewayed to it.
194
195     Preferably, the announcement should contain the MD5 hash generated above,
196     and should be PGP-signed.  It should include the URL for the tarball as
197     well as the URL of the website.  It should contain a brief summary of
198     visible changes, as well as the URL of the git diff page that would show
199     a detailed list of changes.  The changes between 1.5 and 1.4 would be
200     shown by [this is just a guess, I don't know anything about cgit, and
201     it assumes that we tag with nmh-x_x-release from now on]:
202
203         http://git.savannah.gnu.org/cgit/nmh.git/diff/?h=nmh-1_5-release?h=nmh-1_4-release