# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=gensio
pkgver=2.8.14
pkgrel=0
pkgdesc="General Stream I/O"
url="https://github.com/cminyard/gensio"
arch="all"
license="GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0"
makedepends="openssl-dev linux-headers libtool autoconf automake"
subpackages="$pkgname-dev $pkgname-doc $pkgname-libs"
source="https://github.com/cminyard/gensio/releases/download/v$pkgver/gensio-$pkgver.tar.gz
	gensio-install-dir.patch"
builddir="$srcdir/gensio-$pkgver"
options="!check" # tests appear to be broken or depend on internal trace

prepare() {
	default_prepare
	autoreconf -vif
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--without-go \
		--without-python \
		--without-all-gensios \
		--with-dgram=yes \
		--with-mux=yes \
		--with-net=yes \
		--with-pty=yes \
		--with-serialdev=yes \
		--with-stdio=yes \
		--with-telnet=yes
	make
}

check() {
	make check
}

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

sha512sums="
8255ce52832a601b657b3485b65b3f3ccbbc1059d6d63eb6796e24d5bb0ebd4bfa7a3d525a0309214351b1fc385887c5fa3dac74cbf790f5d250c8441a833e68  gensio-2.8.14.tar.gz
32f7fce19092b02b7e2b5b350072dc366ba097026930213e78a5f82ad5b38a9d3f1c536120fe60ba743b726cbe14a33c00e4380abd6e06d373602d986d81ce60  gensio-install-dir.patch
"
