chiark / gitweb /
Unlink lockfiles for old feeds
[innduct.git] / doc / pod / hacking.pod
1 =head1 Hacking INN
2
3 This file is for people who are interested in making modifications to INN.
4 Normal users can safely skip reading it.  It is intended primarily as a
5 guide, resource, and accumulation of tips for maintainers and
6 contributors, and secondarily as documentation of some of INN's internals.
7
8 This is $Revision: 7518 $ dated $Date: 2006-04-14 19:52:06 -0700 (Fri, 14 Apr 2006) $.
9
10 First of all, if you plan on working on INN source, please start from the
11 current development tree.  There may be significant changes from the
12 previous full release, so starting from development sources will make it
13 considerably easier to integrate your work.  You can get nightly snapshots
14 of the current development source from ftp.isc.org in /isc/inn/snapshots
15 (the snapshots named inn-CURRENT-*.tar.gz), or you can get the current CVS
16 tree by using CVSup (see L<"Using CVSup">).
17
18 =head1 Configuring and Portability
19
20 All INN code should be written expecting ANSI C and POSIX.  There is no
21 need to attempt to support pre-ANSI compilers, and ANSI-only features such
22 as <stdarg.h>, string concatenation, #elif, and token pasting may be used
23 freely.  So far as possible, INN is written to attempt to be portable to
24 any system new enough that someone is likely to want to run a news server
25 on it, but whenever possible this portability should be provided by
26 checking for standard behavior in configure and supplying replacements for
27 standard functions that are missing.
28
29 When there is a conflict between ANSI C and C99, INN code should be
30 written expecting C99 and autoconf used to patch up the differences.
31
32 Try to avoid using #ifdef and the like in the middle of code as much as
33 possible.  Instead, try to isolate the necessary portability bits and
34 include them in libinn or at least in conditional macros separate from the
35 code.  Trying to read code littered with conditional compilation
36 directives is much more difficult.
37
38 The shell script F<configure> at the top level of the source tree is
39 generated by autoconf from F<configure.in>, and F<include/config.h.in> is
40 generated by autoheader from F<configure.in> and F<include/acconfig.h>.
41 At configure time, configure generates F<include/config.h> and several
42 other files based on options it was given and what it discovers about the
43 target system.
44
45 All modifications to configure should instead be made to F<configure.in>.
46 Similarly, modifications to F<include/config.h.in> should instead be made
47 to F<include/acconfig.h>.  The autoconf manual (available using info
48 autoconf if you have autoconf and the GNU info utilities installed on your
49 system) is a valuable reference when making any modifications.
50
51 To regenerate configure, just run C<autoconf>.  To regenerate
52 F<include/config.h.in>, run:
53
54     autoheader -l include
55
56 to tell it where to find acconfig.h.  Please don't include patches to
57 either F<configure> or F<include/config.h.in> when sending patches to INN;
58 instead, note in your patch that those files must be regenerated.
59
60 The generated files are checked into the CVS repository so that people
61 working on INN don't have to have autoconf on their system, and to make
62 packaging easier.
63
64 At the time of this writing, autoconf 2.13 is required.
65
66 The supporting files for autoconf are in the F<support> subdirectory,
67 including the files F<config.guess> and F<config.sub> to determine the
68 system name and and F<ltmain.sh> for libtool support.  The latter file
69 comes from the libtool distribution; the canonical version of the former
70 two are available from ftp.gnu.org in /gnu/config.  In addition,
71 F<m4/libtool.m4> is just a copy of F<libtool.m4> from the libtool
72 distribution.  (Using libtool without using automake requires a few odd
73 hacks.)  These files used to be on a separate vendor branch so that we
74 could make local modifications, but local modifications have not been
75 necessary for some time.  Now, new versions can just be checked in like
76 any other file modifications.
77
78 INN should not compile with libtool by default, only when requested, since
79 otherwise normal compilations are quite slow.  (Using libtool is not
80 without some cost.)  Basic compilation with libtool works fine as of this
81 writing, with both static and shared compiles, but the dependencies aren't
82 quite right for make -j using libtool.
83
84 =head1 Documentation
85
86 INN's documentation is currently somewhat in a state of flux.  The vast
87 majority is still in the form of man pages written directly in nroff.
88 Some parts of the documentation have been rewritten in POD; that
89 documentation can be found in F<doc/pod>.  The canonical source for
90 F<README>, F<INSTALL>, F<NEWS>, F<doc/hook-perl>, F<doc/hook-python>, and
91 this file are also in POD.
92
93 If you're modifying some part of INN's documentation and see that it has a
94 POD version in F<doc/pod>, it's preferred if you can make the
95 modifications to the POD source and then regenerate the derived files.
96 For a quick introduction to POD, see the perlpod(1) man page on your
97 system (it should be installed if you have Perl installed).
98
99 When writing new documentation, write in whatever format you care to; if
100 necessary, we can always convert it to POD or whatever else we want to
101 use.  Having the documentation exist in I<some> form is more important
102 than what language you write it in.  If you really don't have any
103 particular preference, there's a slight preference currently for POD.
104
105 If you use POD or regenerate POD documentation, please install something
106 close to the latest versions of the POD processing utilities to avoid
107 changes to the documentation depending on who generated it last.  You can
108 find the latest version on CPAN (ftp.perl.org or another mirror) in
109 F<modules/by-module/Pod>.  You'll need PodParser (for versions of Perl
110 before 5.6.1; 5.6.1 and later come with a recent enough version) and the
111 latest version of podlators.  For versions of Perl earlier than 5.005,
112 you'll also need File::Spec in F<modules/by-module/File>.
113
114 podlators 1.25 or later will build INN's documentation without significant
115 changes from the versions that are checked into the repository.
116
117 There are Makefile rules in F<doc/pod/Makefile> to build all of the
118 documentation whose master form is POD; if you add additional
119 documentation, please add a rule there as well.  Documentation should be
120 generated by cd'ing to F<doc/pod> and typing C<make file> where C<file> is
121 the relative path to the documentation file.  This will get all of the
122 various flags right for pod2text or pod2man.
123
124 =head1 Error Handling
125
126 INN has a set of generic error handling routines that should be used as
127 much as possible so that the same syntax can be used for reporting errors
128 everywhere in INN.  The four basic functions are warn, syswarn, die, and
129 sysdie; warn prints or logs a warning, and die does the same and then
130 exits the current program.  The sys* versions add a colon, a space, and
131 the value of strerror(errno) to the end of the message, and should be used
132 to report failing system calls.
133
134 All of the actual error reporting is done via error handlers, and a
135 program can register its own handlers in addition to or instead of the
136 default one.  The default error handler (error_log_stderr) prints to
137 stderr, prepending the value of error_program_name if it's set to
138 something other than NULL.  Three other error handlers are available,
139 error_log_syslog_crit, error_log_syslog_err, and error_log_syslog_warning,
140 which log the message to syslog at LOG_CRIT, LOG_ERR, or LOG_WARNING
141 priority, respectively.
142
143 There is a different set of error handlers for warn/syswarn and
144 die/sysdie.  To set them, make calls like:
145
146     warn_set_handlers(2, error_log_stderr, error_log_syslog_warning);
147     die_set_handlers(2, error_log_stderr, error_log_syslog_err);
148
149 The first argument is the number of handlers, and the remaining arguments
150 are pointers to functions taking an int (the length of the formatted
151 message), a const char * (the format), a va_list (the arguments), and an
152 int that's 0 if warn or die was called and equal to the value of errno if
153 syswarn or sysdie was called.  The length of the formatted message is
154 obtained by calling vsnprintf with the provided format and arguments, and
155 therefore is reliable to use as the size of a buffer to malloc to hold the
156 result of formatting the message provided that vsnprintf is used to format
157 it (warning: the system vsprintf may produce more output under some
158 circumstances, so always use vsnprintf).
159
160 The error handler can do anything it wishes; each error handler is called
161 in the sequence given.  Error handlers shouldn't call warn or die unless
162 great caution is taken to prevent infinite recursion.  Also be aware that
163 sysdie is called if malloc fails in xmalloc, so if the error handler needs
164 to allocate memory, it must not use xmalloc or a related function to do
165 so and it shouldn't call die to report failure.  The default syslog
166 handlers report memory allocation failure to stderr and exit.
167
168 Finally, die and sysdie support an additional handler that's called
169 immediate before exiting, takes no arguments, and returns an int which is
170 used as the argument for exit.  It can do any necessary global cleanup,
171 call abort instead to generate a core dump or the like.
172
173 The advantage of using this system everywhere in INN is that library code
174 can use warn and die to report errors and each calling program can set up
175 the error handlers as appropriate to make sure the errors go to the right
176 place.  The default handler is fine for interactive programs; for programs
177 that run from interactive scripts, adding something like:
178
179     error_program_name = "program";
180
181 to the beginning of main (where program is the name of the program) will
182 make it easier to figure out which program the script calls is failing.
183 For programs that may also be called non-interactively, like inndstart,
184 one may want to set up handlers like:
185
186     warn_set_handlers(2, error_log_stderr, error_log_syslog_warning);
187     die_set_handlers(2, error_log_stderr, error_log_syslog_err);
188
189 Finally, for daemons and other non-interactive programs, one may want to
190 do:
191
192     warn_set_handlers(1, error_log_syslog_warning);
193     die_set_handlers(1, error_log_syslog_err);
194
195 to report errors only via syslog.  (Note that if you use syslog error
196 handlers, the program should call openlog first thing to make sure they
197 are logged with the right facility.)
198
199 For historical reasons, error messages that are fatal to the news
200 subsystem are logged at the LOG_CRIT priority, and therefore die in innd
201 should use error_log_syslog_crit.
202
203 =head1 Test Suite
204
205 The test suite for INN is located in the tests directory and is just
206 getting started.  The test suite consists of a set of programs listed in
207 F<tests/TESTS> and the scaffolding in the F<runtests> program.
208
209 Adding new tests is very straightforward and very flexible.  Just write a
210 program that tests some part of INN, put it in a directory under tests
211 named after the part of INN it's testing (all the tests so far are in lib
212 because they're testing libinn routines), and have it output first a line
213 containing the count of test cases in that file, and then for each test a
214 line saying "ok n" or "not ok n" where n is the test case number.  (If a
215 test is skipped for some reason, such as a test of an optional feature
216 that wasn't compiled into INN, the test program should output
217 S<"ok n # skip">.)  Add any rules necessary to build the test to
218 tests/Makefile (note that for simplicity it doesn't recurse into
219 subdirectories) and make sure it creates an executable ending in F<.t>.
220 Then add the name of the test to tests/TESTS, without the .t ending.
221
222 One naming convention:  to distinguish more easily between e.g.
223 lib/error.c (the implementation) and tests/lib/error-t.c (the test suite),
224 we add -t to the end of the test file names.  So tests/lib/error-t.c is
225 the source that compiles into an executable tests/lib/error.t which is run
226 by putting a line in tests/TESTS of just "lib/error".
227
228 Note that tests don't have to be written in C; in fact, lib/xmalloc.t is
229 just a shell script (that calls a supporting C program).  Tests can be
230 written in shell or Perl (but other languages should be avoided because
231 someone who wants to run the test suite may not have it) and just have to
232 follow the above output conventions.
233
234 Additions to the test suite, no matter how simple, are very welcome.
235
236 =head1 Makefiles
237
238 All INN makefiles include Makefile.global at the top level, and only that
239 makefile is a configure substitution target.  This has the disadvantage
240 that configure's normal support for building in a tree outside of the
241 source tree doesn't work, but it has the significant advantage of making
242 configure run much faster and allowing one to run make in any subdirectory
243 and pick up all the definitions and settings from the top level
244 configuration.
245
246 All INN makefiles should also set $(top) to be the path to the top of the
247 build directory (usually relative).  This path is used to find various
248 programs like fixscript and libtool so that the same macros (set in
249 Makefile.global) can be used all over INN.
250
251 The format of INN's makefiles is mostly standardized; the best examples of
252 the format are probably F<frontends/Makefile> and F<backends/Makefile>, at
253 least for directories with lots of separate programs.  The ALL variable
254 holds all the files that should be generated, EXTRA those additional files
255 that were generated by configure, and SOURCES the C source files for
256 generating tag information.
257
258 There are a set of standard installation commands defined in make
259 variables by Makefile.global, and these should be used for all file
260 installations.  See the comment blocks in Makefile.global.in for
261 information on what commands are available and when they should be used.
262 There are also variables set for each of the installation directories that
263 INN uses, for use in building the list of installed paths to files.
264
265 Each subdirectory makefile should have the targets all (the default),
266 clean, clobber, install, tags, and profiled.  The tags target generates vi
267 tags files, and the profiled target generates a profiling version of the
268 programs (although this hasn't been tested much recently).  These rules
269 should be present and empty in those directories where they don't apply.
270
271 Be sure to test compiling with both static and dynamic libraries and make
272 sure that all the libtool support works correctly.  All linking steps, and
273 the compile steps for all library source, should be done through
274 $(LIBTOOL) (which will be set to empty in Makefile.global if libtool
275 support isn't desired).
276
277 =head1 Scripts
278
279 INN comes with and installs a large number of different scripts, both
280 Bourne shell and Perl, and also comes with support for Tcl scripts
281 (although it doesn't come with any).  Shell variables containing both
282 configure-time information and configuration information from inn.conf are
283 set by the innshellvars support libraries, so the only system-specific
284 configuration that should have to be done is fixing the right path to the
285 interpretor and adding a line to load the appropriate innshellvars.
286
287 F<support/fixscript>, built by configure, does this.  It takes a .in file
288 and generates the final script (removing the .in) by fixing the path to
289 the interpretor on the first line and replacing the second line, whatever
290 it is, with code to load the innshellvars appropriate for that
291 interpretor.  (If invoked with -i, it just fixes the interpretor path.)
292
293 Scripts should use innshellvars (via fixscript) to get the right path and
294 the right variables whenever possible, rather than having configure
295 substitute values in them.  Any values needed at run-time should instead
296 be available from all of the different innshellvars.
297
298 See the existing scripts for examples of how this is done.
299
300 =head1 Include Files
301
302 Include files relevant to all of INN, or relevant to the two libraries
303 built as part of INN (the utility libinn library and the libstorage
304 library that contains all storage and overview functions) are found in the
305 include directory; other include files relevant only to a portion of INN
306 are found in the relevant directory.
307
308 Practically all INN source files will start with:
309
310     #include "config.h"
311     #include "clibrary.h"
312
313 The first picks up all defines generated by autoconf and is necessary for
314 types that may not be present on all systems (uid_t, pid_t, size_t,
315 int32_t, and the like).  It therefore should be included before any other
316 headers that use those types, as well as to get general configuration
317 information.
318
319 The second is portably equivalent to:
320
321     #include <sys/types.h>
322     #include <stdarg.h>
323     #include <stdio.h>
324     #include <stdlib.h>
325     #include <stddef.h>
326     #include <stdint.h>
327     #include <string.h>
328     #include <unistd.h>
329
330 except that it doesn't include headers that are missing on a given system,
331 replaces functions not found on the system with the INN equivalents,
332 provides macros that INN assumes are available but which weren't found,
333 and defines some additional portability things.  Even if this is more
334 headers than the source file actually needs, it's generally better to just
335 include F<clibrary.h> rather than trying to duplicate the autoconf-driven
336 hackery that it does to do things portably.  The primary exception is for
337 source files in lib that only define a single function and are used for
338 portability; those may want to include only F<config.h> so that they can
339 be easily used in other projects that use autoconf.  F<config.h> is a
340 fairly standard header name for this purpose.
341
342 F<clibrary.h> does also include F<config.h>, but it's somewhat poor form
343 to rely on this; it's better to explicitly list the header dependencies
344 for the benefit of someone else reading the code.
345
346 There are portable wrappers around several header files that have known
347 portability traps or that need some fixing up on some platforms.  Look in
348 include/portable and familiarize yourself with them and use them where
349 appropriate.
350
351 Another frequently included header file is F<libinn.h>, which among other
352 things defines xmalloc(), xrealloc(), xstrdup(), and xcalloc(), which are
353 checked versions of the standard memory allocation routines that terminate
354 the program if the memory allocation fails.  These should generally always
355 be used instead of the regular C versions.  F<libinn.h> also provides
356 various other utility functions that are frequently used.
357
358 F<paths.h> includes a wide variety of paths determined at configure time,
359 both default paths to various parts of INN and paths to programs.  Don't
360 just use the default paths, though, if they're also configurable in
361 F<inn.conf>; instead, call ReadInnConf() and use the global innconf
362 structure.
363
364 Other files in include are interfaces to particular bits of INN library
365 functionality or are used for other purposes; see the comments in each
366 file.
367
368 Eventually, the header files will be separated into installed header files
369 and uninstalled header files; the latter are those headers that are used
370 only for compiling INN and aren't useful for users of INN's libraries
371 (such as clibrary.h).  All of the installed headers will live in
372 include/inn and be installed in a subdirectory named inn in the configured
373 include directory.  This conversion is still in progress.
374
375 When writing header files, remember that C reserves all identifiers
376 beginning with two underscores and all identifiers beginning with an
377 underscore and a capital letter for the use of the implementation; don't
378 use any identifiers with names like that.  Additionally, any identifier
379 beginning with an underscore and a lower-case letter is reserved in file
380 scope, which means that such identifiers can only be used by INN for the
381 name of structure members or function arguments in function prototypes.
382
383 Try to pay attention to the impact of a header file on the program
384 namespace, particularly for installed header files in include/inn.  All
385 symbols defined by a header file should ideally begin with INN_, inn_, or
386 some other unique prefix indicating the subsystem that symbol is part of,
387 to avoid accidental conflicts with symbols defined by the program that
388 uses that header file.
389
390 =head1 Coding Style
391
392 INN has quite a variety of coding styles intermixed.  As with all
393 programs, it's preferrable when making minor modifications to keep the
394 coding style of the code you're modifying.  In INN, that will vary by
395 file.  (Over time we're trying to standardize on one coding style, so
396 changing the region you worked on to fit the general coding style is also
397 acceptable).
398
399 If you're writing a substantial new piece of code, the prevailing
400 "standard" INN coding style appears to be something like the following:
401
402 =over 3
403
404 =item *
405
406 Write in regular ANSI C whenever possible.  Use the normal ANSI and POSIX
407 constructs and use autoconf or portability wrappers to fix things up
408 beforehand so that the code itself can read like regular ANSI or POSIX
409 code.  Code should be written so that it works as expected on a modern
410 platform and is fixed up with portability tricks for older platforms, not
411 the other way around.  You may assume an ANSI C compiler.
412
413 Try to use const wherever appropriate.  Don't use register; modern
414 compilers will do as good of a job as you will in choosing what to put
415 into a register.  Don't bother with restrict (at least yet).
416
417 =item *
418
419 Use string handling functions that take counts for the size of the buffer
420 whenever possible.  This means using snprintf in preference to sprintf and
421 using strlcpy and strlcat in preference to strcpy and strcat.  Also, use
422 strlcpy and strlcat instead of strncpy and strncat unless the behavior of
423 the latter is specifically required, as it is much easier to audit uses of
424 the former than the latter.  (strlcpy is like strncpy except that it
425 always nul-terminates and doesn't fill the rest of the buffer with nuls,
426 making it more efficient.  strlcat is like strncat except that it always
427 nul-terminates and it takes the total size of the buffer as its third
428 argument rather than just the amount of space left.)  All of these
429 functions are guaranteed to be available; there are replacements in lib
430 for systems that don't have them.
431
432 =item *
433
434 Avoid #ifdef and friends whenever possible.  Particularly avoid using them
435 in the middle of code blocks.  Try to hide all portability preprocessor
436 magic in header files or in portability code in lib.  When something just
437 has to be done two completely different ways depending on the platform or
438 compile options or the like, try to abstract that functionality out into a
439 generic function and provide two separate implementations using #ifdef;
440 then the main code can just call that function.
441
442 If you do have to use preprocessor defines, note that if you always define
443 them to either 0 or 1 (never use #define without a second argument), you
444 can use the preprocessor define in a regular if statement rather than
445 using #if or #ifdef.  Make use of this instead of #ifdef when possible,
446 since that way the compiler will still syntax-check the other branch for
447 you and it makes it far easier to convert the code to use a run-time check
448 if necessary.  (Unfortunately, this trick can't be used if one branch may
449 call functions unavailable on a particular platform.)
450
451 =item *
452
453 Avoid uses of fixed-width buffers except in performance-critical code, as
454 it's harder to be sure that such code is correct and it tends to be less
455 flexible later on.  If you need a reusable, resizable memory buffer, one
456 is provided in lib/buffer.c.
457
458 =item *
459
460 Avoid uses of static variables whenever possible, particularly in
461 libraries, because it interferes with making the code re-entrant down the
462 road and makes it harder to follow what's going on.  Similarly, avoid
463 using global variables whenever possible, and if they are required, try to
464 wrap them into structures that could later be changed into arguments to
465 the affected functions.
466
467 =item *
468
469 Roughly BSD style but with four-space indents.  This means no space before
470 the parens around function arguments, open brace on the same line as
471 if/while/for, and close and open brace on the same line as else).
472
473 =item *
474
475 Introductory comments for functions or files are generally written as:
476
477     /*
478     **  Introductory comment.
479     */
480
481 Other multiline comments in the source are generally written as:
482
483     /* This is a
484        multiline comment. */
485
486 Comments before functions saying what they do are nice to have.  In
487 general, the RCS/CVS Id tag is on the first line of each source file since
488 it's useful to know when a file was last modified.
489
490 =item *
491
492 Checks for NULL pointers are preferrably written out explicitly; in other
493 words, use:
494
495     if (p != NULL)
496
497 rather than:
498
499     if (p)
500
501 to make it clearer what the code is assuming.
502
503 =item *
504
505 It's better to always put the body of an if statement on a separate line,
506 even if it's only a single line.  In other words, write:
507
508     if (p != NULL)
509         return p;
510
511 and not:
512
513     if (p != NULL) return p;
514
515 This is in part for a practical reason:  some code coverage analysis tools
516 like purecov will count the second example above as a single line and
517 won't notice if the condition always evaluates the same way.
518
519 =item *
520
521 Plain structs make perfectly reasonable abstract data types; it's not
522 necessary to typedef the struct to something else.  Structs are actually
523 very useful for opaque data structures, since you can predeclare them and
524 then manipulate pointers to them without ever having to know what the
525 contents look like.  Please try to avoid typedefs except for function
526 pointers or other extremely confusing data types, or for data types where
527 we really gain some significant data abstraction from hiding the
528 underlying data type.  Also avoid using the _t suffix for any type; all
529 types ending in _t are reserved by POSIX.  For typedefs of function
530 pointer types, a suffix of _func usually works.
531
532 This style point is currently widely violated inside of INN itself; INN
533 originally made extensive use of typedefs.
534
535 =item *
536
537 When noting something that should be improved later, add a comment
538 containing "FIXME:" so that one can easily grep for such comments.
539
540 =back
541
542 INN's indentation style roughly corresponds to that produced by GNU indent
543 2.2.6 with the following options:
544
545     -bad -bap -nsob -fca -lc78 -cd41 -cp1 -br -ce -cdw -cli0 -ss -npcs
546     -ncs -di1 -nbc -psl -brs -i4 -ci4 -lp -ts8 -nut -ip5 -lps -l78 -bbo
547     -hnl
548
549 Unfortunately, indent currently doesn't get everything right (it has
550 problems with spacing around struct pointer arguments in functions, wants
551 to put in a space between a dereference of a function pointer and the
552 arguments to the called function, misidentifies some macro calls as being
553 type declarations, and fouls up long but simple case statements).  It
554 would be excellent if someday we could just run all of INN's code through
555 indent routinely to enforce a consistant coding style, but indent isn't
556 quite ready for that.
557
558 For users of emacs cc-mode, use the "bsd" style but with:
559
560     (setq c-basic-offset 4)
561
562 Finally, if possible, please don't use tabs in source files, since they
563 can expand differently in different environments.  In particular, please
564 try not to use the mix of tabs and spaces that is the default in emacs.
565 If you use emacs to edit INN code, you may want to put:
566
567     ; Use only spaces when indenting or centering, no tabs.
568     (setq-default indent-tabs-mode nil)
569
570 in your ~/.emacs file.
571
572 Note that this is only a rough guideline and the maintainers aren't style
573 nazis; we're more interested in your code contribution than in how you
574 write it.
575
576 =head1 Using CVSup
577
578 If you want to get updated INN source more easily or more quickly than by
579 downloading nightly snapshots, or if you want to see the full CVS history,
580 you may want to use CVSup to download the source.  CVSup is a client and
581 server designed for replicating CVS repositories between sites.
582
583 Unfortunately, CVSup is written in Modula-3, so getting a working binary
584 can be somewhat difficult.  Binaries are available in the *BSD ports
585 collection or (for a wide variety of different platforms) available from
586 <ftp://ftp.freebsd.org/pub/FreeBSD/CVSup/binaries/> and its mirrors.
587 Alternately, you can get a compiler from <http://m3.polymtl.ca/m3/> (this
588 is more actively maintained than the DEC Modula-3 compiler) and the source
589 from <ftp://ftp.freebsd.org/pub/FreeBSD/CVSup/>.
590
591 After you have the CVSup client, you need to have space to download the
592 INN repository and space for CVSup to store its data files.  You also need
593 to write a configuration file (a supfile) for CVSup.  The following
594 supfile will download the latest versions from the mainline source:
595
596     *default host=inn-cvs.isc.org
597     *default base=<data-location>
598     *default prefix=<download-location>
599     *default release=cvs
600     *default tag=.
601     *default delete use-rel-suffix
602     inn
603
604 where <data-location> should be a directory where CVSup can put its data
605 files and <download-location> is where the downloaded source will go (it
606 will be put into a subdirectory named inn).  If you want to pull down the
607 entire CVS repository instead (warning: this is much larger than just the
608 latest versions of the source), delete the C<*default tag=.> line.  The
609 best way to download the CVS repository is to download it into a portion
610 of a locally-created CVS repository, so that then you can perform standard
611 CVS operations (like cvs log) against the downloaded repository.  Creating
612 your own local CVS repository is outside the scope of this document.
613
614 Note that only multiplexed mode is supported (this mode should be the
615 default).
616
617 For more general information on using CVSup, see the FreeBSD page on it at
618 <http://www.freebsd.org/handbook/mirrors-cvsup.html>.
619
620 =head1 Making a Release
621
622 This is a checklist that INN maintainers should go through when preparing
623 a new release of INN.
624
625 =over 4
626
627 =item 1.
628
629 If making a major release, branch the source tree and create a new STABLE
630 branch tag.  This branch will be used for minor releases based on that
631 major release and can be done a little while before the .0 release of that
632 major release.  At the same time as the branch is cut, tag the trunk with
633 a STABLE-<version>-branch marker tag so that it's easy to refer to the
634 trunk at the time of the branch.
635
636 =item 2.
637
638 Update doc/pod/news.pod and regenerate NEWS.  Be more detailed for a minor
639 release than for a major release.  For a major release, also add
640 information on how to upgrade from the last major release, including
641 anything special to be aware of.  (Minor releases shouldn't require any
642 special care when upgrading.)
643
644 =item 3.
645
646 Make sure that support/config.sub and support/config.guess are the latest
647 versions (from <ftp://ftp.gnu.org/gnu/config/>).  See the instructions in
648 L<"Configuring and Portability"> for details on how to update these files.
649
650 =item 4.
651
652 Make sure that samples/control.ctl is in sync with the master version at
653 <ftp://ftp.isc.org/pub/usenet/CONFIG/control.ctl>.
654
655 =item 5.
656
657 Check out a copy of the release branch.  It's currently necessary to run
658 configure to generate Makefile.global.  Then run C<make check-manifest>.
659 The only differences should be files that are generated by configure; if
660 there are any other differences, fix the MANIFEST.
661
662 =item 6.
663
664 Run C<make release>.  Note that you need to have a copy of svn2cl from
665 <http://ch.tudelft.nl/~arthur/svn2cl/> to do this; at least version 0.7
666 is required.  Start the ChangeLog at the time of the previous release.
667 (Eventually, the script will be smart enough to do this for you.)
668
669 =item 7.
670
671 Make the resulting tar file available for testing in a non-listable
672 directory on ftp.isc.org and announce its availability on inn-workers.
673 Install it on at least one system and make sure that system runs fine for
674 at least a few days.  This is also a good time to send out a draft of the
675 release announcement to inn-workers for proof-reading.
676
677 =item 8.
678
679 Generate a diff between this release and the previous release if feasible
680 (always for minor releases, possibly not a good idea due to the length of
681 the diff for major releases).
682
683 =item 9.
684
685 Move the release into the public area of the ftp site and update the
686 inn.tar.gz link.  Make an MD5 checksum of the release tarball and put it
687 on the ftp site as well, and update the inn.tar.gz.md5 link.  Put the diff
688 up on the ftp site as well.  Contact the ISC folks to get the release
689 PGP-signed.  Possibly move older releases off into the OLD directory.
690
691 =item 10.
692
693 Announce the new release on inn-announce and in news.software.nntp.
694
695 =item 11.
696
697 Tag the checked-out tree that was used for generating the release with a
698 release tag (INN-<version>).
699
700 =item 12.
701
702 Bump the revision number in Makefile.global.in.
703
704 =back
705
706 =head1 References
707
708 Some additional references that may be hard to find and may be of use to
709 people working on INN:
710
711 =over 4
712
713 =item <http://www.eyrie.org/~eagle/nntp/>
714
715 The home page for the IETF NNTP standardization effort, including links
716 to the IETF NNTP working group archives and copies of the latest drafts
717 of the new NNTP standard.  The old archived mailing list traffic contains
718 a lot of interesting discussion of why NNTP is the way it is.
719
720 =item <http://www.imc.org/ietf-usefor/>
721
722 The archives for the USEFOR IETF working group, the working group for the
723 RFC 1036 replacement (the format of Usenet articles).  Also contains a lot
724 of references to other relevant work, such as the RFC 822 replacement
725 work.
726
727 =item <http://www.mibsoftware.com/userkt/inn/dev/>
728
729 Forrest Cavalier provides several tools for following INN development at
730 this page and elsewhere in the Usenet RKT.  Under here is a web-accessible
731 checked-out copy of the current INN source tree and pointers to how to use
732 CVSup.
733
734 =item <http://www.sas.com/standards/large.file/>
735
736 The standards for large file support on Unix that are being generally
737 implemented by vendors.  INN sort of partially uses these, but a good full
738 audit of the code to check them should really be done and there are
739 occasional problems.
740
741 =item <http://v6web.litech.org/ipv6primer/>
742
743 A primer on IPv6 with pointers to the appropriate places for more
744 technical details as needed, useful when working on IPv6 support in INN.
745
746 =back