# Template file for 'inotify-tools'
pkgname=inotify-tools
version=4.25.9.0
revision=1
build_style=gnu-configure
hostmakedepends="automake libtool"
short_desc="Provides a simple interface to inotify"
maintainer="Enno Boland <gottox@voidlinux.org>"
license="GPL-2.0-or-later"
homepage="https://github.com/inotify-tools/inotify-tools"
distfiles="https://github.com/inotify-tools/inotify-tools/archive/${version}.tar.gz"
checksum=d33a4fd24c72c2d08893f129d724adf725b93dae96c359e4f4e9f32573cc853b

# we are still using musl1.1 on 32bit arm
case "$XBPS_TARGET_MACHINE" in
	armv[67]l-musl) configure_args+=" --enable-fanotify" ;;
esac

post_patch() {
	case "$XBPS_TARGET_MACHINE" in
		armv[67]l-musl) patch -Np1 < "${FILESDIR}/musl1.1.patch" ;;
	esac
}

pre_configure() {
	autoreconf -fi
}

libinotify-tools_package() {
	short_desc+=" - library files"
	pkg_install() {
		vmove "usr/lib/*.so.*"
	}
}

inotify-tools-devel_package() {
	depends="libinotify-tools>=${version}_${revision}"
	short_desc+=" - development files"
	pkg_install() {
		vmove usr/include
		vmove "usr/lib/*.a"
		vmove "usr/lib/*.so"
	}
}
