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