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

View file

@ -66,3 +66,19 @@
# Second Line...........................................................
# Third line... blah 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"