# packages/libusb/auxbuild
#

# download and unpack tarball
TARVERSION="1.0.8"
TARDIR="libusb-${TARVERSION}"
TARBALL="${TARDIR}.tar.bz2"
build_download "http://downloads.sourceforge.net/project/libusb/libusb-1.0/libusb-${TARVERSION}/${TARBALL}"
build_unpack "${TARBALL}"
PKGDIR="${TARDIR}"

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

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

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

# Add a library config script with the -1.0- name.
sed -e "s|@CROSSLIB@|$CROSSLIB|" -e "s|@VERSION@|$TARVERSION|" \
	< config-script > $CROSSLIB/bin/libusb-1.0-config
chmod +x $CROSSLIB/bin/libusb-1.0-config

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