# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=os-prober
pkgver=1.83
pkgrel=0
pkgdesc="Utility to detect other OSes on a set of drives"
url="https://joeyh.name/code/os-prober/"
arch="all !s390x" # grub-mount does not support s390x
depends="grub-mount blkid"
license="GPL-3.0-only"
source="https://deb.debian.org/debian/pool/main/o/os-prober/os-prober_$pkgver.tar.xz"
options="!check" # No tests
builddir="$srcdir/work"

build() {
	make newns
}

package() {
	install -Dm755 os-prober linux-boot-prober -t "$pkgdir"/usr/bin
	install -Dm755 newns "$pkgdir"/usr/lib/os-prober/newns
	install -Dm755 common.sh "$pkgdir"/usr/share/os-prober/common.sh

	for dir in os-probes os-probes/mounted os-probes/init linux-boot-probes linux-boot-probes/mounted; do
		install -Dm755 -t "$pkgdir"/usr/lib/"$dir" "$dir"/common/*
		if [ -d "$dir"/x86 ]; then
			cp -r "$dir"/x86/* "$pkgdir"/usr/lib/"$dir"
		fi
	done

	install -Dm655 os-probes/mounted/powerpc/20macosx "$pkgdir"/usr/lib/os-probes/mounted/20macosx
	install -dm755 "$pkgdir"/var/lib/os-prober
}

sha512sums="
b6a75cfa9cd71338e43597d3529a9f65cf210013f5b0e05a3e7aada6d33d391453b73dfc366e452538b13701be3e2eb00ad8e22da34ab108f60822c35ec46623  os-prober_1.83.tar.xz
"
