# Contributor: Michał Polański <michal@polanski.me>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=btrfs-compsize
pkgver=1.5
pkgrel=2
pkgdesc="Calculate compression ratio of a set of files on Btrfs"
url="https://github.com/kilobyte/compsize"
arch="all"
license="GPL-2.0-or-later"
makedepends="btrfs-progs-dev"
options="!check" # no test suite
subpackages="$pkgname-doc"
source="https://github.com/kilobyte/compsize/archive/v$pkgver/compsize-$pkgver.tar.gz"
builddir="$srcdir/compsize-$pkgver"

build() {
	make CFLAGS="$CFLAGS -include kerncompat.h"
}

package() {
	install -d "$pkgdir"/usr/share/man/man8
	make DESTDIR="$pkgdir" PREFIX=/usr install

	# compsize requires root privileges
	install -d "$pkgdir"/usr/sbin
	mv "$pkgdir"/usr/bin/compsize "$pkgdir"/usr/sbin
}

sha512sums="25d6f1973e8a0a86bd857dc1e1ba99760451cf388f3bd3ede6a6ef35351ff63f100646d313010aff3de9e70b2c68866a31c4ea31d9c6df9254648cd1bd0272fa  compsize-1.5.tar.gz"
