# Contributor: Milan P. Stanić <mps@arvanta.net>
# Maintainer: Milan P. Stanić <mps@arvanta.net>
pkgname=aprx
pkgver=2.9.1
pkgrel=1
pkgdesc="aprx digipeater and iGate"
url="https://thelifeofkenneth.com/aprx/"
arch="all"
license="BSD-3-Clause"
options="!check" # no tests
pkgusers="aprx"
pkggroups="aprx"
makedepends="libax25-dev perl"
install="$pkgname.pre-install $pkgname.post-install"
subpackages="$pkgname-doc $pkgname-openrc"
source="https://thelifeofkenneth.com/aprx/release/aprx-$pkgver.tar.gz
	aprx.initd
	aprx.confd
	"

build() {
	export CFLAGS="$CFLAGS -fcommon -O2 -DERLANGSTORAGE  -Wno-implicit-int"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--sbindir=/usr/sbin \
		--mandir=/usr/share/man \
		--with-pthread \
		--localstatedir=/var
	make
}

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

	install -m755 -D "$srcdir"/$pkgname.initd \
		"$pkgdir"/etc/init.d/$pkgname
	install -m644 -D "$srcdir"/$pkgname.confd \
		"$pkgdir"/etc/conf.d/$pkgname
	install -m770 -o aprx -g aprx -d "$pkgdir"/var/log/aprx
}

sha512sums="
469e007e06af9979ec1423c089ef7a9d3ec6c88202d298fd616abd3b18c62d43e43b585cb7dfd5bc056b727eb98d37187de97a9e0066e09e5370fa4dfd88b6da  aprx-2.9.1.tar.gz
d7d4327a9affe7fb7156c8dea468e18f6616819b5f214f94652845a2467b9776abc2f8c81783099c11bc0603257dcb87f7973f6326d645512af0478385168791  aprx.initd
2e743e64cceac6498c40701f43b7782b21be359dd2028b8463feb1542ef33c789b3a4c0dd4e29c17a633fcea543357a7bc4e8b5cb46abc7125ac2b7bf203cc7a  aprx.confd
"
