# Contributor: Milan P. Stanić <mps@arvanta.net>
# Maintainer: Milan P. Stanić <mps@arvanta.net>
pkgname=setserial
pkgver=2.17
pkgrel=2
pkgdesc="tool for change various attributes of a serial device"
url="https://setserial.sourceforge.net/"
arch="all"
license="GPL-2.0-only"
makedepends="groff linux-headers autoconf"
subpackages="$pkgname-doc"
source="https://downloads.sourceforge.net/sourceforge/setserial/setserial-$pkgver.tar.gz
	gcc14.patch
	setserial.patch
	"

prepare() {
	default_prepare
	# regenerate configure script to work with gcc 14
	autoconf -f
}

build() {
	./configure \
		--prefix=/usr \
		--mandir=/usr/share/man \
		--bindir=/bin
	make
}

package() {
	install -d $pkgdir/bin
	install -d $pkgdir/usr/share/man/man8
	make DESTDIR=$pkgdir install
}

sha512sums="
27b4918d303302dfdbca2f8c4fe500685068cfbf3de70b4907bac5a9cdb2e643656c1d821e714c08723abcfbaf99129866002117450bef731a0a09cd38138645  setserial-2.17.tar.gz
8a45f4db12bbed7851e5398f04bfeba78ae67f540f54a95621b0954bc9b017e0b545ccd997b8fba4c801cc5e9d75716b0dd92696425b332d69dab14bebbf3b66  gcc14.patch
4c5f5bddb3f66aac51c1550d85726930221e995dd695f628bec37cf2f05c1db0c7b1c59ba745c32a9d8a91374a4491479f7786a58cfd0096157b2b22c764ac7f  setserial.patch
"
