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