Otherwise, create your own functions and paste them in sparingly, e.g.
function install_dir()
{
src_dir_="${1%/}"
shift
dst_dir_="${1%/}"
shift
src_len_=${#src_dir_}
find "$src_dir_" -type f -print | while read path_
do
rel_path_="${path_:${src_len_}}"
install "$@" "$path_" "$dst_dir$rel_path_"
done
}
install_dir "$srcdir/$pkgname-$pkgver/foo/lib" "$pkgdir/lib" -Dm 644
I've used it in an Aur package that's now in community and it still has that command.
]]>My current PKGBUILD looks like this:
# Contributor: Trevor Turner <turn3r [dot] tr3v0r [at] gmail [dot] com>
_i686rpm=hpasm-7.7.0-115.sles9.i586.rpm
_x86_64rpm=hpasm-7.7.0-115.sles9.x86_64.rpm
pkgname=hpasm
pkgver=7.7.0_115
pkgrel=1
pkgdesc="HP Proliant Server Management Agents and Utilities"
arch=('i686' 'x86_64')
url="ftp://ftp.compaq.com/pub/products/servers/supportsoftware/linux/"
license=('custom')
makedepends=('rpmextract')
source=('hpasmd' 'hpasmd.service')
md5sums=('4efbcaf99d2ad688d5887dd28d48854f' '3249472c2ca273d8c348b8daf0ffd996')
if [ "${CARCH}" = "x86_64" ]; then
source+=(ftp://ftp.compaq.com/pub/products/servers/supportsoftware/linux/${_x86_64rpm})
md5sums+=('812416e7ee25690d55389b1df1b549bb')
noextract=("${_x86_64rpm}")
elif [ "${CARCH}" = "i686" ]; then
source+=(ftp://ftp.compaq.com/pub/products/servers/supportsoftware/linux/${_i686rpm})
md5sums+=('420e886d6a66eb6cb3fd0671635519ec')
noextract=("${_i686rpm}")
fi
package() {
cd "$srcdir"
msg2 "Extracting RPM..."
rpmextract.sh *.rpm
msg2 "Installing Files..."
install -dm 755 "${pkgdir}/usr/lib/systemd/system"
install -dm 755 "${pkgdir}/usr/sbin"
install -dm 755 "${pkgdir}/etc/rc.d"
install -Dm 755 "${srcdir}/hpasmd" "${pkgdir}/etc/rc.d/hpasmd"
install -Dm 755 "${srcdir}/hpasmd.service" "${pkgdir}/usr/lib/systemd/system/hpasmd.service"
install -Dm 755 "${srcdir}/sbin/bootcfg" "${pkgdir}/usr/sbin/bootcfg"
install -Dm 755 "${srcdir}/sbin/hpasmcli" "${pkgdir}/usr/sbin/hpasmcli"
install -Dm 755 "${srcdir}/sbin/hplog" "${pkgdir}/usr/sbin/hplog"
install -Dm 755 "${srcdir}/sbin/hpuid" "${pkgdir}/usr/sbin/hpuid"
cp -r "${srcdir}/opt" "${pkgdir}/"
ln -s "/opt/compaq/hpasmd/bin/hpasmd" "${pkgdir}/usr/sbin/hpasmd"
ln -s "/opt/compaq/hpasm/addon/libhpasmintrfc.so.1.0" "${pkgdir}/usr/lib/libhpasmintrfc.so.1.0"
ln -s "libhpasmintrfc.so.1.0" "${pkgdir}/usr/lib/libhpasmintrfc.so.1"
ln -s "/opt/compaq/hpasm/addon/libhpev.so.1.0" "${pkgdir}/usr/lib/libhpev.so.1.0"
ln -s "libhpev.so.1.0" "${pkgdir}/usr/lib/libhpev.so.1"
}