# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Sören Tempel <soeren+alpine@soeren-tempel.net>
pkgname=picocom
pkgver=3.1
pkgrel=0
pkgdesc="Minimal dumb-terminal emulation program"
url="https://github.com/npat-efault/picocom"
arch="all"
license="GPL-2.0"
depends=""
makedepends="linux-headers"
install=""
options="!check" # upstream doesn't have a test suite.
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/npat-efault/${pkgname}/archive/${pkgver}.tar.gz"
builddir="$srcdir"/$pkgname-$pkgver

build() {
	make CFLAGS="$CFLAGS -DNO_CUSTOM_BAUD" LDFLAGS="$LDFLAGS" \
		-C "$builddir"
}

package() {
	install -Dm755 "$builddir"/$pkgname \
		"$pkgdir"/usr/bin/$pkgname
	install -Dm644 "$builddir"/$pkgname.1 \
		"$pkgdir"/usr/share/man/man1/$pkgname.1

	local file=
	for file in CONTRIBUTORS README.md TODO lowerrts.md; do
		install -Dm644 "$builddir"/$file \
			"$pkgdir"/usr/share/doc/$pkgname/$file
	done
}

sha512sums="ff1888494ae0e24a151e19ac3abcdbb499e42eb1abcea401a7c6c3b532be3d64ddd81a511641d1ce0119dc5da3d2804ce8eaff262a9d578bfe8e22fdf6e55ad1  picocom-3.1.tar.gz"
