# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=akms
pkgver=0.3.0
pkgrel=0
pkgdesc="Alpine Kernel Module Support"
url="https://github.com/jirutka/akms"
arch="noarch"
license="MIT"
depends="bubblewrap cmd:depmod kernel-hooks"
makedepends="asciidoctor"
triggers="$pkgname.trigger=/usr/src/*"
install="$pkgname.pre-install $pkgname.post-install $pkgname.pre-deinstall"
subpackages="$pkgname-doc"
source="https://github.com/jirutka/akms/archive/v$pkgver/akms-$pkgver.tar.gz
	modules-load.conf
	"
options="!check"  # no tests provided

build() {
	make build
}

package() {
	make install DESTDIR="$pkgdir" prefix=/usr

	# See https://github.com/jirutka/akms/issues/5
	install -Dm644 "$srcdir"/modules-load.conf "$pkgdir"/usr/lib/modules-load.d/$pkgname.conf
}

sha512sums="
4388530747ddece057d490ba9c77471967a35b1996a869ccbae86eb221b0b8529d6eaa877a2f6037530b734fdd089049ab1da431368d7c43bd168839e4fa1cbc  akms-0.3.0.tar.gz
e61ebacae17e4e6b9ec39c0673d46c7764cba7f1378208341688f201c396a1599f8a518ce0849f36da0de2710391014f45d90ab09f6b36a579970d1672b0d71d  modules-load.conf
"
