# Contributor: Michael Lyngbol <michael@lyngbol.dk>
# Maintainer: Michael Lyngbol <michael@lyngbol.dk>
pkgname=owfs
pkgver=3.2_p4
_pkgver=${pkgver//_/}
pkgrel=1
pkgdesc="OWFS — the one-wire filesystem"
url="https://github.com/owfs/owfs-doc/wiki"
arch="all"
license="GPL-2.0-only"
makedepends="fuse-dev linux-headers"
subpackages="$pkgname-dev $pkgname-doc"
source="https://github.com/owfs/owfs/releases/download/v$_pkgver/owfs-$_pkgver.tar.gz"
options="!check" # no testsuite
builddir=$srcdir/owfs-$_pkgver

prepare() {
	default_prepare
	update_config_sub
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--with-fuseinclude=/usr/include \
		--with-fuselib=/usr/lib
	make
}

package() {
	make DESTDIR="$pkgdir" install

	# apk-tools compatible version
	sed -i 's/^\(Version: .*\)p/\1_p/' "$pkgdir"/usr/lib/pkgconfig/owcapi.pc
}

sha512sums="
c5326c5e4952dc0d47c1420a48184c31c10a502af04953838afdc8577b123cd2ae841c7bfe5aa4c1ae2804c0e00b7757e3eddf15fc90108f35a60042d175bb48  owfs-3.2p4.tar.gz
"
