# packages/udev/auxbuild
#

# download and unpack tarball
TARVERSION="164"
TARDIR="${BUILD_PACKAGE}-${TARVERSION}"
TARBALL="${TARDIR}.tar.bz2"
build_download "http://ftp.kernel.org/pub/linux/utils/kernel/hotplug/${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}-"

export CROSS_COMPILE="${ARCH_CC_PREFIX}"
export EXTRAS="extras/ata_id extras/cdrom_id extras/collect extras/edd_id extras/firmware extras/path_id extras/rule_generator extras/scsi_id extras/usb_id extras/volume_id"

# invoke configure (directory, prefix, extra arguments)
build_autoconf "${PKGDIR}" "" "--sbindir=/sbin --libdir=/lib \
	--with-rootlibdir=/lib --libexecdir=/lib/udev \
	--disable-introspection --disable-extras \
	--with-systemdsystemunitdir=/lib/systemd/system"


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

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

# for now, remove persistent rule generation, as it screws with eth0
rm -f "${BUILDROOT}/lib/udev/rules.d/"*-net-generator.rules

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