# packages/util-linux/auxbuild
#

# download and unpack tarball
TARVERSION="2.23.2"
TARDIR="${BUILD_PACKAGE}-${TARVERSION}"
TARBALL="${TARDIR}.tar.bz2"
build_download "http://www.kernel.org/pub/linux/utils/util-linux/v2.23/${TARBALL}"
build_unpack "${TARBALL}"
PKGDIR="${TARDIR}"

# invoke configure (directory, prefix, extra arguments)
build_autoconf "${PKGDIR}" /usr "--disable-makeinstall-chown --with-systemdsystemunitdir=/lib/systemd/TODO \
    --disable-mount --disable-losetup --disable-cytune --disable-fsck --disable-eject --disable-agetty \
    --disable-cramfs --disable-bfs --disable-fdformat --disable-hwclock --disable-kill"

# Libtool insists on adding -rpath /usr/lib, even though that means we can't
# crosscompile. We need to kill it in the Makefile, but that in turn trips up
# some pointless test within libtool that means it will only install a file
# into a destination whose suffix matches the rpath. So we make a nonsense rpath
# which we know will match where we want to install the file.
#build_make "${PKGDIR}" "clean"
sed -e 's, -rpath.*$, -rpath /Buildroot/'${BUILD_MACHINE}'/usr/lib,' -i "Distn/${TARDIR}/Makefile"

# run make, make install (directory, extra arguments)
build_make "${PKGDIR}"
build_make "${PKGDIR}" "install"

# copy across static content
cp -a static/* "${BUILDROOT}"

strip_files

true
# vim: ts=4:sw=4:expandtab:syntax=sh
