# Template file for 'ntfs-3g'
pkgname=ntfs-3g
version=2022.10.3
revision=1
build_style=gnu-configure
configure_args="--exec-prefix=/usr --disable-static --with-fuse=external
 --enable-posix-acls --enable-xattr-mappings --sbin=/usr/bin
 $(vopt_if extras --enable-extras)
 $(vopt_if crypto --enable-crypto)
 $(vopt_if quarantined --enable-quarantined)"
hostmakedepends="pkg-config"
makedepends="libuuid-devel fuse-devel
 $(vopt_if crypto 'libgcrypt-devel gnutls-devel')"
short_desc="Stable Read/Write NTFS Driver in userspace"
maintainer="Orphaned <orphan@voidlinux.org>"
license="GPL-2.0-or-later, LGPL-2.0-or-later"
homepage="https://github.com/tuxera/ntfs-3g"
changelog="https://raw.githubusercontent.com/wiki/tuxera/ntfs-3g/NTFS-3G-Release-History.md"
distfiles="https://tuxera.com/opensource/ntfs-3g_ntfsprogs-${version}.tgz"
checksum=f20e36ee68074b845e3629e6bced4706ad053804cbaf062fbae60738f854170c

build_options="crypto extras quarantined"
desc_option_crypto="Enable crypto related code and utilities"
desc_option_extras="Enable extra ntfsprogs utilities"
desc_option_quarantined="Enable quarantined ntfsprogs utilities"
build_options_default="crypto extras"

post_install() {
	mv ${DESTDIR}/sbin/* ${DESTDIR}/usr/bin
	ln -sf ntfs-3g ${DESTDIR}/usr/bin/mount.ntfs
	if [ -z "$build_option_quarantined" ]; then
		# Remove documentation for a non-existent executable file.
		rm "${DESTDIR}/usr/share/man/man8/ntfsfallocate.8"
	fi
}

ntfs-3g-devel_package() {
	depends="fuse-devel ${sourcepkg}>=${version}_${revision}"
	short_desc+=" - development files"
	pkg_install() {
		vmove usr/include
		vmove usr/lib/pkgconfig
		vmove "usr/lib/*.so"
	}
}
