# Template file for 'dateutils'
pkgname=dateutils
version=0.4.11
revision=1
build_style=gnu-configure
configure_args="ax_cv_zoneinfo_tzdir=/usr/share/zoneinfo"
checkdepends="tzdata"
short_desc="Nifty command line date and time utilities"
maintainer="Duncaen <duncaen@voidlinux.org>"
license="BSD-3-Clause"
homepage="http://www.fresse.org/dateutils/"
changelog="http://www.fresse.org/dateutils/changelog.html"
distfiles="https://bitbucket.org/hroptatyr/dateutils/downloads/dateutils-${version}.tar.xz"
checksum=b8fea0b09714bbadf202b9b3434cce6b59c282e7869268d0c08b85880fdbb446

post_extract() {
	vsed -i '/sysctl\.h/d' build-aux/yuck.c
}

pre_configure() {
	# date wrapper / SOURCE_DATE_EPOCH interferes with some tests
	rm "${XBPS_WRAPPERDIR}"/date

	if [ "$XBPS_TARGET_LIBC" != "glibc" ]; then
		# disable failing test
		# $ echo 1900-01-01 | strptime -i '%F'
		# strptime: cannot make sense of `1900-01-01' using the given input formats
		vsed -i test/Makefile.am \
			-e '/strptime.003.ctst/d'
		vsed -i test/Makefile.in \
			-e 's/strptime.003.ctst//'
	fi
}

post_install() {
	vlicense LICENSE
	rm -f "${DESTDIR}/usr/share/doc/dateutils/LICENSE"
}
