common/hooks: new hook to generate 32bit pkgs for x86_64 (WIP).

This commit is contained in:
Juan RP 2014-03-02 12:26:24 +01:00
parent dd86f41ce0
commit 908af511f9
3 changed files with 97 additions and 1 deletions

View file

@ -1,12 +1,15 @@
# This hook registers a XBPS binary package into the specified local repository.
registerpkg() {
local repo="$1" pkg="$2"
local repo="$1" pkg="$2" arch="$3"
if [ ! -f ${repo}/${pkg} ]; then
msg_error "Unexistent binary package ${repo}/${pkg}!\n"
fi
if [ -n "${arch}" ]; then
export XBPS_TARGET_ARCH=${arch}
fi
msg_normal "Registering ${pkg} into ${repo} ...\n"
if [ -n "$XBPS_CROSS_BUILD" ]; then
@ -14,6 +17,7 @@ registerpkg() {
else
$XBPS_RINDEX_CMD ${XBPS_BUILD_FORCEMODE:+-f} -a ${repo}/${pkg}
fi
unset XBPS_TARGET_ARCH
}
hook() {
@ -35,6 +39,7 @@ hook() {
pkgdir=$XBPS_REPOSITORY
fi
binpkg=${pkgver}.${arch}.xbps
binpkg32=${pkgname}32-${version}_${revision}.x86_64.xbps
binpkg_dbg=${pkgname}-dbg-${version}_${revision}.${arch}.xbps
# Register binpkg.
@ -46,4 +51,9 @@ hook() {
if [ -f ${pkgdir}/${binpkg_dbg} ]; then
registerpkg ${pkgdir} ${binpkg_dbg}
fi
# Register 32bit binpkg if it exists.
if [ -f ${pkgdir}/${binpkg32} ]; then
registerpkg ${pkgdir} ${binpkg32} x86_64
fi
}