# packages/dosfstools/auxbuild
#

# download and unpack tarball
TARVERSION="3.0.11"
TARDIR="${BUILD_PACKAGE}-${TARVERSION}"
TARBALL="${TARDIR}.tar.gz"
build_download "http://www.daniel-baumann.ch/software/dosfstools/${TARBALL}"

build_unpack "${TARBALL}"

# Adjust the makefiles internal prefix
sed \
    -e "/^PREFIX *= */s,/local,," \
    -i "Distn/${TARDIR}/Makefile"

# apply patches matching pattern (repository, patch prefix)
build_patch "${TARDIR}" "${BUILD_PACKAGE}-ALL-"
build_patch "${TARDIR}" "${BUILD_PACKAGE}-${TARVERSION}-"

# invoke configure (directory, prefix, extra arguments)
#build_autoconf "${TARDIR}"

# run make, make install (directory, extra arguments)
build_make "${TARDIR}" "CFLAGS='-D_FILE_OFFSET_BITS=64'"
build_make "${TARDIR}" "install"

# clean up unwanted files
rm -rf "${BUILDROOT}/usr/usr"

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