# Contributor: Valery Kartel <valery.kartel@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=fuse-exfat
_pkgreal=exfat
pkgver=1.2.7
pkgrel=0
pkgdesc="Free exFAT file system implementation"
url="https://github.com/relan/exfat"
arch="all"
license="GPL-2.0-or-later"
provides="$_pkgreal"
depends="fuse"
makedepends="autoconf automake fuse-dev"
subpackages="$pkgname-doc $pkgname-utils"
source="$_pkgreal-$pkgver.tar.gz::https://github.com/relan/$_pkgreal/archive/v$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"

build() {
	cd "$builddir"
	autoreconf --install
	./configure --prefix=/usr
	make
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
}

utils() {
	pkgdesc="$pkgdesc (utilities)"
	provides="$_pkgreal-utils"
	mkdir -p "$subpkgdir"/usr/sbin
	local file; for file in $(find "$pkgdir"/usr/sbin ! -name "mount*" -a ! -type d); do
		mv $file "$subpkgdir"/${file#$pkgdir}
	done
}

sha512sums="f90b1eff5c51ff93377f82f2838d214e0670a4a8c54fb7c0ec8ce743971b35867975568b8886e8fae8e320706419cf4e39d0852e68350c9b999cf0be4c5f88fc  exfat-1.2.7.tar.gz"
