updates.
[autodist.git] / apps / autodist / doc / autodist.texi
index 870cc91ff4539f042ff1c750fefd4bea85d9b557..9952271bc5a7cbab529f17131a4e9417fae5b136 100644 (file)
@@ -349,7 +349,7 @@ AUTOMAKE="automake -a -c"
 The 'AUTOMAKE' specifies the location of the 'automake' tool.  If
 Autodist should not run 'automake' this option may be removed or set
 to empty value.  User need to then run it manually.  By default, the
-'-a'  and '-c' options are given to 'automake' to add any missing required 
+'-a'  and '-c' options are given to 'automake' to add any missing required
 files.
 
 
@@ -556,7 +556,7 @@ In this example, if the text in the current header file is found in any
 file in the distribution it will be replaced with the new header file.
 Notice that, both header files has same amount of lines (8 lines).
 
-Note that, the current header must match exactly the header used in 
+Note that, the current header must match exactly the header used in
 files.  Otherwise the replacement will not be complete.
 
 
@@ -805,6 +805,39 @@ executes the script: distribution name, distribution version and package
 name of distribution.  The script may use these arguments if it needs them.
 
 
+@section Directive: pre-process-dist-hook <filename> [...]
+
+The 'pre-process-dist-hook' directive can be used define additional
+scripts that will be run when Autodist has started distribution creation.
+This directive is optional.  One or more scripts may be defined in one
+'pre-process-dist-hook' directive.  Zero or more 'pre-process-dist-hook'
+directives may be set for distribution.  The 'pre-process-dist-hook' hook
+will be run immediately after the Autodist has created the distribution
+directory but has not yet started any distribution processing.
+
+The scripts will get four (4) command line arguments when Autodist
+executes the script: distribution name, distribution version, package
+name of distribution and destination distribution directory name.  The
+script may use these arguments if it needs them.
+
+
+@section Directive: post-process-dist-hook <filename> [...]
+
+The 'post-process-dist-hook' directive can be used define additional
+scripts that will be run when Autodist has finished distribution
+processing.  This directive is optional.  One or more scripts may be
+defined in one 'post-process-dist-hook' directive.  Zero or more
+'post-process-dist-hook' directives may be set for distribution.  The
+'post-process-dist-hook' hook will be run immediately after the Autodist
+has finished processing the destination distribution directory but has not
+yet created the distribution package.
+
+The scripts will get four (4) command line arguments when Autodist
+executes the script: distribution name, distribution version, package
+name of distribution and destination distribution directory name.  The
+script may use these arguments if it needs them.
+
+
 @section Directive: pre-dist-hook <filename> [...]
 
 The 'pre-dist-hook' directive can be used define additional scripts that
@@ -812,8 +845,8 @@ will be run when Autodist has started distribution creation.  This directive
 is optional.  One or more scripts may be defined in one 'pre-dist-hook'
 directive.  Zero or more 'pre-dist-hook' directives may be set for
 distribution.  The 'pre-dist-hook' hook will be run immediately after
-the Autodist has created the distribution directory but has not yet
-started any distribution processing.
+the Autodist has started distribution creation, but has not yet created
+the distribution directory.  This hook is run before 'pre-process-dist-hook'.
 
 The scripts will get four (4) command line arguments when Autodist
 executes the script: distribution name, distribution version, package
@@ -824,12 +857,12 @@ script may use these arguments if it needs them.
 @section Directive: post-dist-hook <filename> [...]
 
 The 'post-dist-hook' directive can be used define additional scripts that
-will be run when Autodist has finished distribution processing.  This
+will be run when Autodist has finished distribution creation.  This
 directive is optional.  One or more scripts may be defined in one
 'post-dist-hook' directive.  Zero or more 'post-dist-hook' directives may
-be set for distribution.  The 'post-dist-hook' hook will be run immediately
-after the Autodist has finished processing the destination distribution
-directory but has not yet created the distribution package.
+be set for distribution.  The 'post-dist-hook' hook will be run
+immediately after the Autodist has finished creating the distribution
+package.  This is the last hook Autodist runs.
 
 The scripts will get four (4) command line arguments when Autodist
 executes the script: distribution name, distribution version, package
@@ -837,6 +870,37 @@ name of distribution and destination distribution directory name.  The
 script may use these arguments if it needs them.
 
 
+@section Running hooks
+
+The Autodist runs the hooks in the following order:
+
+Preparing source tree for configuration and compilation:
+
+@example
+<...Autodist started...>
+pre-hook
+<...preparation...>
+post-hook
+<...Autodist exits...>
+@end example
+
+Creating distribution:
+
+@example
+<...Autodist started...>
+pre-dist-hook
+<...distribution directory created...>
+pre-process-dist-hook
+<...processing all files, processing excludes and includes...>
+post-process-dist-hook
+<...creating distribution package...>
+post-dist-hook
+<...Autodist exits...>
+@end example
+
+When creating distribution the 'pre-hook' and 'post-hook' are not run.
+
+
 @section Example distfile
 
 The following is a simple distfile example.  The example assumes that the
@@ -856,8 +920,8 @@ define SILC_DIST_IRSSI
 undef SILC_DIST_MPI
 exclude doc/draft*
 pre-hook scripts/client-pre-run
-post-dist-hook scripts/client-post-dist-run
-post-dist-hook scripts/client-post-dist-kludge
+post-process-dist-hook scripts/client-post-process
+post-dist-hook scripts/client-post-dist-bin
 @end example
 
 @menu
@@ -969,6 +1033,9 @@ preparation.  They will be processed when creating the distribution package.
 If you need processed files during configuration or compilation then they
 need to have '.ad' suffix.
 
+Note that, the distdef format used in these files must be the non-source
+format.
+
 @menu
 * Distdefines::                 Using distdefs in files
 @end menu
@@ -995,7 +1062,7 @@ configuration and compilation (@pxref{Preparing source tree, , , , }).
 By default the distdefs are named '_DIST_XXX', where 'XXX' is the name of
 distdef.  However, many projects will want to define their own prefix
 for distdefs in the 'autodist.conf' configuration file (@pxref{autodist.conf, , , , }).
-In the following examples a prefix 'SILC' is used, hence the prefix for 
+In the following examples a prefix 'SILC' is used, hence the prefix for
 the distdefs are 'SILC_DIST_'.
 
 The basic format for the distdefs are as follows:
@@ -1037,12 +1104,13 @@ a compiler friendly format, defined below, should be used.
 @end example
 
 Note that, only the format defined above is supported.  Other more complex
-use of the preprocessor directives such as using '&&' and '||' in the '#ifdef'
-or '#ifndef' are not supported, and neither is '#elif'.  Also note, that in
-the compiler friendly format the name of the distdef in comments and the
-use of '!' character in the '#else' branch of '#ifdef' are mandatory.  Also
-note, that the distdef conditionals must be placed at the start of the line,
-they must not be indented.
+use of the preprocessor directives such as using '&&' and '||' in the
+'#ifdef' or '#ifndef' are not supported, and neither is '#elif'.  Also
+note, that the name of the distdef in '#else' and '#ifdef' directives in
+non-source format and in source format inside C comments (/* */), and the
+use of '!' character in the '#else' branch of '#ifdef'" are mandatory.
+Also note, that the distdef conditionals must be placed at the start of
+the line, they must not be indented.
 
 The following example shows the use of non-source format:
 
@@ -1115,21 +1183,21 @@ would be:
   real_foobar();
 @end example
 
-Even before processing the source files with Autodist, the preprocessor 
-will respect the preprocessor directives if the code use '#include' to 
-include the distdef header file created by the Autodist (see 
-'autodist.conf' (@pxref{autodist.conf, , , , })).  When the distribution 
-is packaged (@pxref{Creating distribution, , , , }) the Autodist will 
-process the files, and will remove any line not defined to be included.  
+Even before processing the source files with Autodist, the preprocessor
+will respect the preprocessor directives if the code use '#include' to
+include the distdef header file created by the Autodist (see
+'autodist.conf' (@pxref{autodist.conf, , , , })).  When the distribution
+is packaged (@pxref{Creating distribution, , , , }) the Autodist will
+process the files, and will remove any line not defined to be included.
 The preprocessor directives will also be removed.
 
-Because the software project includes the header file with '#include' the 
-distdef header file needs to be present in the distribution, unless it is 
+Because the software project includes the header file with '#include' the
+distdef header file needs to be present in the distribution, unless it is
 placed inside some other '#ifdef' conditional.  If the distribution is
 prepared but not compiled (it is packaged after preparation without
-compilation) then including the distdef header in the source is not 
+compilation) then including the distdef header in the source is not
 necessary.  Including it then in the distribution is not necessary either.
+
 The software project should not use the same name space that distdef
 conditionals use for other than distribution usage.  The Autodist will
 process any line that uses the formats above and has the specified prefix
@@ -1232,14 +1300,14 @@ not using Autodist, then you would do this by running perhaps 'aclocal',
 this process is performed by Autodist, and running these tools manually
 or using 'autogen.sh' script is not necessary.
 
-By default the 'autodist.conf' (@pxref{autodist.conf, , , , }) has defined 
-the tools that will be run by the Autodist when preparing the source tree.  
-These are 'aclocal', 'autoheader', 'autoconf', 'automake' and 
-'libtoolize'.  If you do not whish that Autodist runs some or any of these 
-tools automatically, do not set them in the 'autodist.conf'.  You would 
-then need to run them manually. However, this is not recommended.  If you 
-need to run additional preparation scripts you may set your scripts either 
-in the 'pre-hook' and/or 'post-hook' where you can run what ever 
+By default the 'autodist.conf' (@pxref{autodist.conf, , , , }) has defined
+the tools that will be run by the Autodist when preparing the source tree.
+These are 'aclocal', 'autoheader', 'autoconf', 'automake' and
+'libtoolize'.  If you do not wish that Autodist runs some or any of these
+tools automatically, do not set them in the 'autodist.conf'.  You would
+then need to run them manually. However, this is not recommended.  If you
+need to run additional preparation scripts you may set your scripts either
+in the 'pre-hook' and/or 'post-hook' where you can run what ever
 additional processing you may need to prepare your source tree.
 
 By default the Autodist creates a 'default' distribution when you
@@ -1262,10 +1330,10 @@ distribution run Autodist without any arguments.
 The Autodist will prepare your source tree.  After that you may run
 './configure' and continue to compile with 'make'.
 
-If you do not whish to use the 'default' distribution, or you whish
+If you do not wish to use the 'default' distribution, or you wish
 to do the development in a tree specificly prepared for some specific
 distribution, or you are preparing to create a new distribution package,
-you will need to run the Autodist with the distribution you whish to
+you will need to run the Autodist with the distribution you wish to
 prepare.
 
 @example
@@ -1288,7 +1356,7 @@ distribution.
 However, the source files, or any other file (except files ending with
 '.ad' suffix) are not processed by the Autodist.  When compiling
 your sources the preprocessor, however, will respect your distdef
-conditionals inside your source files if you include the distdef header
+conditionals inside your source files if you '#include' the distdef header
 file.  This way, even the compiled binaries will be compiled for that
 distribution, even though the source files has not yet been processed
 by the Autodist.  Rest of the files in the distribution will be processed
@@ -1297,6 +1365,12 @@ the distribution you have prepared will behave in your source tree exactly
 the same way as if it was already packaged with Autodist (providing that
 you remember to include the distdef header file in your code).
 
+When preparing the source tree Autodist will create a file 'autodist.dist'
+which will contain information on the prepared distribution.  When
+Creating the distribution that file will be read by the Autodist
+automatically.  That file should not be removed or the distribution
+cannot be packaged.
+
 @menu
 * Creating distribution::       Creating distribution with Autodist
 @end menu
@@ -1309,18 +1383,18 @@ Before creating a new distribution package, you will need to prepare
 the source tree for the distribution you want to create.  After preparing
 your source tree you will be ready to create a new distribution.  The
 Autodist package provides a simple helper script 'makedist' that may
-be used to create the distribution.  However, if you whish, you may
+be used to create the distribution.  However, if you wish, you may
 run the Autodist yourself, as the 'makedist' will call Autodist anyway.
 
-To create a new distribution for the distribution you have prepared for
-run makedist.
+To create a new distribution for the distribution you have prepared for,
+run first './configure' and then 'makedist'.
 
 @example
   makedist
 @end example
 
 This will run the Autodist and create a new distribution package that
-is archived with 'tar' and compressed with 'gzip'.  If you whish to
+is archived with 'tar' and compressed with 'gzip'.  If you wish to
 create packages also compressed with 'bzip2', 'compress' and/or 'zip'
 you may give one or all of the following options:
 
@@ -1332,7 +1406,7 @@ This example would create, in addition of 'tar.gz' package, also a
 'tar.bz2', 'tar.Z' and '.zip' packages.  Current version of Autodist does
 not support archiving with 'shar'.
 
-If you whish to run additional processing for your distributions when
+If you wish to run additional processing for your distributions when
 they are being packaged you may set 'pre-dist-hook' and/or 'post-dist-hook'
 in your distribution file.  Also note that any hooks provided by Automake
 in Makefiles will be run in normal manner.
@@ -1356,7 +1430,7 @@ For additional help, you may give:
 @section Single distribution tree example, start to finish
 
 Lets suppose you have a simple source tree with one application,
-called 'foozbar' you whish to release.  While you would probably suffice
+called 'foozbar' you wish to release.  While you would probably suffice
 using Autoconf and Automake features you may still use Autodist.
 
 First, you create the default 'distdir' into your software package:
@@ -1387,7 +1461,7 @@ define _DIST_FOOZBAR
 This distribution file go into 'distdir/foozbar'.
 
 And there you go.  You have succesfully integrated Autodist into your
-source tree.  If you need to do development and you whish to use the
+source tree.  If you need to do development and you wish to use the
 'default' distribution for that, you should inherit the new 'foozbar'
 distribution in it.  Add the following line in 'distdir/default':
 
@@ -1484,6 +1558,7 @@ undef _DIST_CRYPTO
 
 @example
 # Common template
+option template
 define _DIST_DOC
 define _DIST_LIB
 define _DIST_MATH