# All noprocesses
noprocess=
-# All pre, post pre-dist and post-dist hooks
+# All hooks
pre_hooks=
post_hooks=
pre_dist_hooks=
post_dist_hooks=
+pre_p_dist_hooks=
+post_p_dist_hooks=
# Distribution license and license header
license=
ad_fatal "The '$distribution' distribution cannot be packaged"
fi
+ # Run pre-dist-hooks
+ ad_run_dist_hooks "$pre_dist_hooks"
+
# Create distribution directory
ad_debug "Creating distribution directory $am_distdir"
$MAKE distdir || exit 1
ad_fatal "Distribution directory $am_distdir not created"
fi
- # Run pre-dist-hooks
- ad_run_dist_hooks "$pre_dist_hooks"
+ # Run pre-process-dist-hooks
+ ad_run_dist_hooks "$pre_p_dist_hooks"
# Run excludes
ad_dist_excludes "$excludes"
ad_debug "Process distribution tree"
ad_process_tree $am_distdir
- # Run post-dist-hooks
- ad_run_dist_hooks "$post_dist_hooks"
+ # Run post-process_dist-hooks
+ ad_run_dist_hooks "$post_p_dist_hooks"
# Make distribution sane
ad_makedist_makesane
fi
rm -f $am_distdir.tar
+ # Run post-dist-hooks
+ ad_run_dist_hooks "$post_dist_hooks"
+
# Cleanup
rm -rf $am_distdir
rm -f autodist.noprocess
| grep "pre-dist-hook " | sed 's/^[ ]*//' | cut -d' ' -f2-`
local podh=`cat $distdir/$1 | grep -v "^#" \
| grep "post-dist-hook " | sed 's/^[ ]*//' | cut -d' ' -f2-`
+ local prpdh=`cat $distdir/$1 | sed 's/^[ ]*//' | grep -v "^#" \
+ | grep "pre-process-dist-hook " | sed 's/^[ ]*//' | cut -d' ' -f2-`
+ local popdh=`cat $distdir/$1 | grep -v "^#" \
+ | grep "post-process-dist-hook " | sed 's/^[ ]*//' | cut -d' ' -f2-`
pre_hooks="$pre_hooks $prh"
post_hooks="$post_hooks $poh"
pre_dist_hooks="$pre_dist_hooks $prdh"
post_dist_hooks="$post_dist_hooks $podh"
+ pre_p_dist_hooks="$pre_p_dist_hooks $prpdh"
+ post_p_dist_hooks="$post_p_dist_hooks $popdh"
options="$options $opts"
ad_handle_options "$options"
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
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
@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
-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.
+The 'post-dist-hook' directive can be used define additional scripts that
+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 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
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
+pre-hook
+post-hook
+@end example
+
+Creating distribution:
+@example
+pre-dist-hook
+pre-process-dist-hook
+post-process-dist-hook
+post-dist-hook
+@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
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
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
+'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
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
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
@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:
'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.
@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:
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':