From 47e0dc43cd79f1d3e9e6ad23aed9312cd074093d Mon Sep 17 00:00:00 2001 From: Juan RP Date: Thu, 2 Oct 2008 18:39:26 +0200 Subject: [PATCH] Added $make_{build,install}_target, to be used in templates. Use them if package doesn't use defaults. While here always create $wrksrc/libtool if libtool is installed, sometimes it's not there and you might need it anyway. This fixes jpeg package. --HG-- extra : convert_revision : 6d846b82f44bc4b2e837c6cb6355b4d18bc7edfb --- pkgfs.sh | 14 ++++++++++---- templates/example.tmpl | 8 ++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/pkgfs.sh b/pkgfs.sh index be01125519f..0cdb20a1767 100755 --- a/pkgfs.sh +++ b/pkgfs.sh @@ -446,6 +446,8 @@ fixup_tmpl_libtool() $ln_cmd -s $PKGFS_MASTERDIR/bin/libtool $lt_file $ln_cmd -s $PKGFS_MASTERDIR/share/libtool/config/ltmain.sh \ $wrksrc/ltmain.sh + elif [ -f "$PKGFS_MASTERDIR/bin/libtool" ]; then + $ln_cmd -s $PKGFS_MASTERDIR/bin/libtool $lt_file fi } @@ -453,7 +455,7 @@ build_tmpl_sources() { [ -z "$pkgname" ] && return 1 - if [ -n "$distfiles" ]; then + if [ -n "$distfiles" -a -z "$wrksrc" ]; then wrksrc=$PKGFS_BUILDDIR/$distfiles elif [ -z "$wrksrc" ]; then wrksrc=$PKGFS_BUILDDIR/$pkgname @@ -553,10 +555,12 @@ build_tmpl_sources() fi done + [ -z "$make_build_target" ] && make_build_target= + # # Build package via make. # - ${MAKE_CMD} ${make_build_args} + ${MAKE_CMD} ${make_build_args} ${make_build_target} if [ "$?" -ne 0 ]; then echo "*** ERROR building (make stage) \`$pkgname' ***" exit 1 @@ -572,11 +576,13 @@ build_tmpl_sources() fi done + [ -z "$make_install_target" ] && make_install_target=install + # # Install package via make. # - ${MAKE_CMD} ${make_install_args} \ - install prefix="$PKGFS_DESTDIR/$pkgname" + ${MAKE_CMD} ${make_install_args} ${make_install_target} \ + prefix="$PKGFS_DESTDIR/$pkgname" if [ "$?" -ne 0 ]; then echo "*** ERROR instaling \`$pkgname' ***" exit 1 diff --git a/templates/example.tmpl b/templates/example.tmpl index 2467510f4f7..a98019a574d 100755 --- a/templates/example.tmpl +++ b/templates/example.tmpl @@ -37,9 +37,17 @@ # Passed flags to the 'make' command before building the package. #make_build_args="-j4" +# Target to be used for building. Use it if default is not the one +# that is needed. +#make_build_target="mytarget" + # Passed flags to the 'make' command before installing the package. #make_install_args="" +# Target to be used for installing. Use it if default is not the +# one that is needed. +#make_install_target="install-foo" + # Make command to be used while building, it needs a full path. # Uncomment the following line to use GNU make. #make_cmd="$PKGFS_MASTERDIR/bin/gmake"