Added prereq directive.
[autodist.git] / apps / autodist / doc / autodist.texi
index 2d2cd57358ab6ce9234682930676d36f8a5a9fc3..aadb62fca86dad87e06d086aa9c9c8895298ef26 100644 (file)
@@ -80,6 +80,7 @@ Integrating Autodist
 * Makefile.ad files::           Makefile.ad for creating Makefile.am
 * Other .ad files::             Other files with .ad suffix
 * Distdefines::                 Using distdefs in files
+* Dependencies::                Autodist dependency support
 
 Invoking Autodist
 
@@ -240,6 +241,7 @@ as they may not exist yet.
 * Makefile.ad files::           Makefile.ad for creating Makefile.am
 * Other .ad files::             Other files with .ad suffix
 * Distdefines::                 Using distdefs in files
+* Dependencies::                Autodist dependency support
 @end menu
 
 
@@ -577,6 +579,20 @@ Note that, the current header must match exactly the header used in
 files.  Otherwise the replacement will not be complete.
 
 
+@section Directive: prereq <version>
+
+The 'prereq' may be used to enforce the Autodist version.  If the Autodist 
+version used to process the distribution is older than the version 
+specified with 'prereq' the Autodist will fail.
+
+Example:
+@example
+prereq 1.3.2
+@end example
+
+Will require Autodist 1.3.2 or newer for this distribution.
+
+
 @section Directive: inherit <distfile>
 
 The Autodist provides inheritance of distributions.  The 'inherit'
@@ -819,9 +835,11 @@ Zero or more 'pre-hook' directives may be set for distribution.  The
 'pre-hook' hook will be run immediately after invoking Autodist to start
 preparing the source tree for configuration and compilation (@pxref{Preparing source tree, , , , }).
 
-The scripts will get three (3) command line arguments when Autodist
-executes the script: distribution name, distribution version and package
-name of distribution.  The script may use these arguments if it needs them.
+The scripts will get at least three (3) command line arguments when 
+Autodist executes the script: distribution name, distribution version and 
+package name of distribution.  The script may use these arguments if it 
+needs them.  If user passed any extra parameters to autodist in the 
+command line they will also be passed to the script as last arguments.
 
 
 @section Directive: post-hook <filename> [...]
@@ -834,9 +852,11 @@ Zero or more 'post-hook' directives may be set for distribution.  The
 preparing the source three for configuration and compilation (@pxref{Preparing source tree, , , , }).  The Autodist will exit after it has run the
 'post-hook' scripts.
 
-The scripts will get three (3) command line arguments when Autodist
-executes the script: distribution name, distribution version and package
-name of distribution.  The script may use these arguments if it needs them.
+The scripts will get at least three (3) command line arguments when 
+Autodist executes the script: distribution name, distribution version and 
+package name of distribution.  The script may use these arguments if it 
+needs them.  If user passed any extra parameters to autodist in the 
+command line they will also be passed to the script as last arguments.
 
 
 @section Directive: pre-process-dist-hook <filename> [...]
@@ -849,10 +869,12 @@ 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.
+The scripts will get at least 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.  If user passed any 
+extra parameters to autodist in the command line they will also be passed 
+to the script as last arguments.
 
 
 @section Directive: post-process-dist-hook <filename> [...]
@@ -866,10 +888,12 @@ defined in one 'post-process-dist-hook' directive.  Zero or more
 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.
+The scripts will get at least 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.  If user passed any 
+extra parameters to autodist in the command line they will also be passed 
+to the script as last arguments.
 
 
 @section Directive: pre-dist-hook <filename> [...]
@@ -882,10 +906,12 @@ distribution.  The 'pre-dist-hook' hook will be run immediately after
 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
-name of distribution and destination distribution directory name.  The
-script may use these arguments if it needs them.
+The scripts will get at least 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.  If user passed any 
+extra parameters to autodist in the command line they will also be passed 
+to the script as last arguments.
 
 
 @section Directive: post-dist-hook <filename> [...]
@@ -898,10 +924,12 @@ 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
-name of distribution and destination distribution directory name.  The
-script may use these arguments if it needs them.
+The scripts will get at least 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.  If user passed any 
+extra parameters to autodist in the command line they will also be passed 
+to the script as last arguments.
 
 
 @section Running hooks
@@ -1025,18 +1053,16 @@ configure scripts.  They must not use 'AD_INIT', 'AD_INCLUDE_CONFIGURE',
 
 @defmac AD_DISABLE_DEPENDENCIES
 
-This macro is used to disable Autodist dependencies in 'Makefile.ad' 
-files.  If this macro is used, then after editing 'Makefile.ad' file the 
-Autodist must be run manually.  When dependencies are enabled editing 
-Autodist is run automatically when source is compiled with 'make'. 
-Dependencies make the development easier.  This macro has no arguments.
+This macro is used to disable Autodist dependencies.  If this macro is
+used, then after editing 'Makefile.ad' and 'configure.ad' files the
+Autodist must be run manually.  When dependencies are enabled Autodist is
+run automatically when source is compiled with 'make'.  Dependencies make
+the development easier.  This macro has no arguments.
 
 Note that, the dependencies are enabled only in the prepared source tree.  
 Depedencies are not delivered to distribution, as they would require the 
-presence of 'Makefile.ad' files, which are not delivered to distribution. 
-
-Current Autodist version does not support dependencies in 'configure.ad' 
-files, only in 'Makefile.ad' files.
+presence of 'Makefile.ad' and 'configure.ad' files, which are not 
+delivered to distribution.
 @end defmac
 
 @menu
@@ -1289,6 +1315,28 @@ Example:
 In this example, in both of the files the source code format is used.
 
 
+@node Dependencies
+@section Autodist dependency support
+
+Autodist support dependencies for 'Makefile.ad' and 'configure.ad' files.  
+When these files are edited, they are processed by Autodist automatically 
+when the source tree is compiled with 'make'.  This makes development in 
+the source tree easier, when Autodist does not have to be run manually.
+The dependencies can be disabled by using 'AD_DISABLE_DEPENDENCIES' macro 
+in the 'configure.ad' file.
+
+When editing 'configure.ad' fragments the modifcation is detected when the 
+source tree is compiled with 'make' from the top source directory.  
+Giving 'make' in a subdirectory will not detect a change in 'configure.ad' 
+fragment.
+
+Dependencies are present only in the prepared source tree.  They are not 
+delivered to created distribution, as they depend on 'Makefile.ad' and 
+'configure.ad' files which are not present in the created distribution.  
+Autodist automatically removes the dependencies when the distribution is 
+created.
+
+
 @node Invoking Autodist
 @chapter Invoking Autodist
 
@@ -1632,6 +1680,7 @@ include doc/nomad
 define _DIST_NOMAD
 define _DIST_NOMAD_LIB
 undef _DIST_CRYPTO
+pre-dist-hook nomad-pre-dist-hook
 @end example
 
 @example
@@ -1745,11 +1794,18 @@ Then you continue with libfoozbar and Nomad:
 autodist libfoozbar 1.0.5
 makedist
 
-autodist nomad 2.0
+Nomad has also an RPM .spec file that you have written and a pre-dist-hook 
+that will replace the RPM release version with sed tool with the one you 
+give as extra parameter to autodist:
+
+autodist nomad 2.0 0.fc7
 makedist
 @end example
 
-The end results are: 'libfoozbar-1.0.5.tar.gz' and 'nomad-2.0.tar.gz'.
+The end results are: 'libfoozbar-1.0.5.tar.gz' and 'nomad-2.0.tar.gz', and 
+the RPM will have a release version '0.fc7' when you compile the RPM.  Any 
+extra parameter that you pass to autodist will be delivered to your hook 
+scripts.
 
 @page
 @contents