# Template file for 'eudev'

_UDEV_VERSION="243" # compatible udev version provided

pkgname=eudev
version=3.2.11
revision=1
build_style=gnu-configure
configure_args="--enable-hwdb --enable-manpages --disable-introspection"
hostmakedepends="pkg-config gperf"
makedepends="libblkid-devel libkmod-devel"
checkdepends="xz tar perl"
short_desc="Fork of systemd-udev (enhanced userland device daemon)"
maintainer="Enno Boland <gottox@voidlinux.org>"
license="GPL-2.0-or-later"
homepage="https://github.com/eudev-project"
distfiles="https://github.com/eudev-project/eudev/releases/download/v${version}/eudev-${version}.tar.gz"
checksum=19847cafec67897da855fde56f9dc7d92e21c50e450aa79068a7e704ed44558b
conf_files="/etc/udev/udev.conf"

post_install() {
	mv "${DESTDIR}/etc/udev/hwdb.d" "${DESTDIR}/usr/lib/udev"
	vsv udevd
}

do_check() {
	# requires unshare(2) which is not available in chroot
	if [ ! "$XBPS_ALLOW_CHROOT_BREAKOUT" ]; then
		make check
	fi
}

eudev-libudev-devel_package() {
	provides="libudev-devel-${_UDEV_VERSION}_${revision}"
	depends="eudev-libudev>=${version}_${revision}"
	short_desc+=" - development files"
	pkg_install() {
		vmove usr/include
		vmove usr/lib/pkgconfig
		vmove "usr/lib/*.a"
		vmove "usr/lib/*.so"
		vmove usr/share/pkgconfig
	}
}

eudev-libudev_package() {
	provides="libudev-${_UDEV_VERSION}_${revision}"
	short_desc+=" - runtime library"
	pkg_install() {
		vmove "usr/lib/*.so.*"
	}
}
