Make it possible to use multiple stages in run_stuff_*, e.g:

run_stuff_before="configure build install"

while here, document them in example.tmpl.

--HG--
extra : convert_revision : acca2ad2aed2467b244037b60132cf5461057acc
This commit is contained in:
Juan RP 2008-10-02 03:19:27 +02:00
parent ea61d25a06
commit 7b9c3503fa
2 changed files with 40 additions and 16 deletions

View File

@ -478,10 +478,12 @@ build_tmpl_sources()
export PKG_CONFIG="$PKGFS_MASTERDIR/bin/pkg-config" export PKG_CONFIG="$PKGFS_MASTERDIR/bin/pkg-config"
# Run stuff before configure. # Run stuff before configure.
if [ "$run_stuff_before" = "configure" ]; then for i in "$run_stuff_before"; do
[ -f $PKGFS_TEMPLATESDIR/$run_stuff_before_configure_file ] && \ if [ "$i" = "configure" ]; then
. $PKGFS_TEMPLATESDIR/$run_stuff_before_configure_file local bcf="$PKGFS_TEMPLATESDIR/$run_stuff_before_configure_file"
[ -f $bcf ] && . $bcf
fi fi
done
# #
# Packages using GNU autoconf # Packages using GNU autoconf
@ -542,10 +544,12 @@ build_tmpl_sources()
# #
# Run template stuff before building. # Run template stuff before building.
# #
if [ "$run_stuff_before" = "build" ]; then for i in ${run_stuff_before}; do
[ -f $PKGFS_TEMPLATESDIR/$run_stuff_before_build_file ] && \ if [ "$i" = "build" ]; then
. $PKGFS_TEMPLATESDIR/$run_stuff_before_build_file local bbf="$PKGFS_TEMPLATESDIR/$run_stuff_before_build_file"
[ -f $bbf ] && . $bbf
fi fi
done
# #
# Build package via make. # Build package via make.
@ -559,10 +563,12 @@ build_tmpl_sources()
# #
# Run template stuff before installing. # Run template stuff before installing.
# #
if [ "$run_stuff_before" = "install" ]; then for i in ${run_stuff_before}; do
[ -f $PKGFS_TEMPLATESDIR/$run_stuff_before_install_file ] && \ if [ "$i" = "install" ]; then
. $PKGFS_TEMPLATESDIR/$run_stuff_before_install_file local bif="$PKGFS_TEMPLATESDIR/$run_stuff_before_install_file"
[ -f $bif ] && . $bif
fi fi
done
# #
# Install package via make. # Install package via make.
@ -577,10 +583,12 @@ build_tmpl_sources()
# #
# Run template stuff after installing. # Run template stuff after installing.
# #
if [ "$run_stuff_after" = "install" ]; then for i in ${run_stuff_after}; do
[ -f $PKGFS_TEMPLATESDIR/$run_stuff_after_install_file ] && \ if [ "$i" = "install" ]; then
. $PKGFS_TEMPLATESDIR/$run_stuff_after_install_file local aif="$PKGFS_TEMPLATESDIR/$run_stuff_after_install_file"
[ -f $aif ] && . $aif
fi fi
done
# #
# Transform pkg-config files if requested by template. # Transform pkg-config files if requested by template.

View File

@ -66,3 +66,19 @@
# Second Line........................................................... # Second Line...........................................................
# Third line... blah blah blah.......................................... # Third line... blah blah blah..........................................
# Nth line... blah blah ..............................................." # Nth line... blah blah ..............................................."
# Use the following vars to execute arbitrary stuff at some stage
# while installing a package.
#
# There are three stages: configure, build and install; and
# also two states when this are run: before or after.
#
# Please take a look at templates/perl-run-stuff-{before,after}.sh files
# to know what to do with them.
#
#run_stuff_before="configure build install"
#run_stuff_before_configure_file="example-before-configure.sh"
#run_stuff_before_build_file="example-before-build.sh"
#run_stuff_before_install_file="example-before-install.sh"
#run_stuff_after="install"
#run_stuff_after_install_file="example-after-install.sh"