Simplify template files by removing run_stuff_<stage>_<phase> variables.

Now if a file "$pkgname-runstuff-<stage>-<phase>.sh" exists in
PKGFS_TEMPLATESDIR exists, it's executed automatically. Therefore
templates are simplified a lot.

--HG--
extra : convert_revision : 94f1da6424d3df70ef763d4339cf4d8e778ccbac
This commit is contained in:
Juan RP 2008-10-13 05:04:50 +02:00
parent 3e4a2a977c
commit 6575a051be
7 changed files with 15 additions and 67 deletions

View File

@ -250,10 +250,7 @@ reset_tmpl_vars()
make_build_args make_install_args build_style \ make_build_args make_install_args build_style \
short_desc maintainer long_desc checksum wrksrc \ short_desc maintainer long_desc checksum wrksrc \
patch_files configure_env make_cmd pkgconfig_override \ patch_files configure_env make_cmd pkgconfig_override \
configure_env make_env run_stuff_before run_stuff_after \ configure_env make_env make_build_target \
run_stuff_before_configure_file run_stuff_before_build_file \
run_stuff_before_install_file run_stuff_after_install \
run_stuff_after_install_file make_build_target \
run_stuff_before_configure_cmd run_stuff_before_build_cmd \ run_stuff_before_configure_cmd run_stuff_before_build_cmd \
run_stuff_before_install_cmd run_stuff_after_install_cmd \ run_stuff_before_install_cmd run_stuff_after_install_cmd \
make_install_target postinstall_helpers version \ make_install_target postinstall_helpers version \
@ -594,14 +591,10 @@ configure_src_phase()
[ ! -f $PKGFS_APPLYPATCHES_DONE ] && apply_tmpl_patches [ ! -f $PKGFS_APPLYPATCHES_DONE ] && apply_tmpl_patches
# Run stuff before configure. # Run stuff before configure.
for i in "$run_stuff_before"; do local rbcf="$PKGFS_TEMPLATESDIR/$pkgname-runstuff-before-configure.sh"
if [ "$i" = "configure" ]; then [ -f $rbcf ] && . $rbcf
[ -f $run_stuff_before_configure_file ] && \ [ -n "$run_stuff_before_configure_cmd" ] && \
. $run_stuff_before_configure_file ${run_stuff_before_configure_cmd}
[ -n "$run_stuff_before_configure_cmd" ] && \
${run_stuff_before_configure_cmd}
fi
done
# Export configure_env vars. # Export configure_env vars.
for f in ${configure_env}; do for f in ${configure_env}; do
@ -711,14 +704,10 @@ build_src_phase()
# #
# Run template stuff before building. # Run template stuff before building.
# #
for i in ${run_stuff_before}; do local rbbf="$PKGFS_TEMPLATESDIR/$pkgname-runstuff-before-build.sh"a
if [ "$i" = "build" ]; then [ -f $rbbf ] && . $rbbf
[ -f $run_stuff_before_build_file ] && \ [ -n "$run_stuff_before_build_cmd" ] && ${run_stuff_before_build_cmd}
. $run_stuff_before_build_file
[ -n "$run_stuff_before_build_cmd" ] && \
${run_stuff_before_build_cmd}
fi
done
[ -z "$make_build_target" ] && make_build_target= [ -z "$make_build_target" ] && make_build_target=
[ -n "$PKGFS_MAKEJOBS" ] && PKGFS_MAKEJOBS="-j$PKGFS_MAKEJOBS" [ -n "$PKGFS_MAKEJOBS" ] && PKGFS_MAKEJOBS="-j$PKGFS_MAKEJOBS"
@ -740,14 +729,9 @@ build_src_phase()
# #
# Run template stuff before installing. # Run template stuff before installing.
# #
for i in ${run_stuff_before}; do local rbif="$PKGFS_TEMPLATESDIR/$pkgname-runstuff-before-install.sh"
if [ "$i" = "install" ]; then [ -f $rbif ] && . $rbif
[ -f $run_stuff_before_install_file ] && \ [ -n "$run_stuff_before_install_cmd" ] && ${run_stuff_before_install_cmd}
. $run_stuff_before_install_file
[ -n "$run_stuff_before_install_cmd" ] && \
${run_stuff_before_install_cmd}
fi
done
$touch_cmd -f $PKGFS_BUILD_DONE $touch_cmd -f $PKGFS_BUILD_DONE
} }
@ -794,14 +778,9 @@ install_src_phase()
# #
# Run template stuff after installing. # Run template stuff after installing.
# #
for i in ${run_stuff_after}; do local raif="$PKGFS_TEMPLATESDIR/$pkgname-runstuff-after-install.sh"
if [ "$i" = "install" ]; then [ -f $raif ] && . $raif
[ -f $run_stuff_after_install_file ] && \ [ -n "$run_stuff_after_install_cmd" ] && ${run_stuff_after_install_cmd}
. $run_stuff_after_install_file
[ -n "$run_stuff_after_install_cmd" ] && \
${run_stuff_after_install_cmd}
fi
done
# #
# Transform pkg-config files if requested by template. # Transform pkg-config files if requested by template.

View File

@ -11,8 +11,3 @@ short_desc="PCI Access from Modular X.org"
maintainer="Juan RP <xtraeme@gmail.com>" maintainer="Juan RP <xtraeme@gmail.com>"
checksum=5d972b5398f96bb94b2dab7f16613ad998887ece checksum=5d972b5398f96bb94b2dab7f16613ad998887ece
long_desc="..." long_desc="..."
# NetBSD support.
run_stuff_before="configure"
run_stuff_before_configure_file="
$PKGFS_TEMPLATESDIR/$pkgname-runstuff-before-configure.sh"

View File

@ -18,6 +18,3 @@ long_desc="
attempts were made to make it as complete as possible, while attempts were made to make it as complete as possible, while
keeping the code easy to understand. Currently, this library keeping the code easy to understand. Currently, this library
only supports C. Support for other languages is being considered." only supports C. Support for other languages is being considered."
run_stuff_before="build"
run_stuff_before_build_file="$PKGFS_TEMPLATESDIR/$pkgname-runstuff-before-build.sh"

View File

@ -15,7 +15,3 @@ long_desc="
uses the zlib(3) compression library, and optionally the JPEG library by the uses the zlib(3) compression library, and optionally the JPEG library by the
Independent JPEG Group (IJG) and/or lcms (little CMS), a color-management Independent JPEG Group (IJG) and/or lcms (little CMS), a color-management
library by Marti Maria Saguar." library by Marti Maria Saguar."
run_stuff_before="configure"
run_stuff_before_configure_file="
$PKGFS_TEMPLATESDIR/$pkgname-runstuff-before-configure.sh"

View File

@ -21,10 +21,3 @@ long_desc="
procedural and object-oriented (OO) programming, has powerful built-in procedural and object-oriented (OO) programming, has powerful built-in
support for text processing, and has one of the world's most impressive support for text processing, and has one of the world's most impressive
collections of third-party modules." collections of third-party modules."
# Perl needs to be handled specially and we have to transform some
# definitions to look at the correct directory.
run_stuff_before="build"
run_stuff_before_build_file="$PKGFS_TEMPLATESDIR/perl-runstuff-before-build.sh"
run_stuff_after="install"
run_stuff_after_install_file="$PKGFS_TEMPLATESDIR/perl-runstuff-after-install.sh"

View File

@ -24,9 +24,5 @@ long_desc="
This package contains the core database of common types and the This package contains the core database of common types and the
update-mime-database command used to extend it." update-mime-database command used to extend it."
# Fix hardcoded mime-info database PATH.
run_stuff_before="build"
run_stuff_before_build_file="$PKGFS_TEMPLATESDIR/$pkgname-runstuff-before-build.sh"
# Update shared-mime-info database file. # Update shared-mime-info database file.
postinstall_helpers="update-mimedb.sh" postinstall_helpers="update-mimedb.sh"

View File

@ -18,11 +18,3 @@ long_desc="
different entities. They can, for example, map public identifiers to different entities. They can, for example, map public identifiers to
local files or URIs. This allows you to tell the parser where to look local files or URIs. This allows you to tell the parser where to look
for entities without having to modify the original document source." for entities without having to modify the original document source."
# Prepare and install the catalogs.
run_stuff_after="install"
run_stuff_after_install_file="
$PKGFS_TEMPLATESDIR/$pkgname-runstuff-after-install.sh"
run_stuff_before="install"
run_stuff_before_install_file="
$PKGFS_TEMPLATESDIR/$pkgname-runstuff-before-install.sh"