# Contributor: fossdd <fossdd@pwned.life>
# Maintainer: fossdd <fossdd@pwned.life>
pkgname=dump1090
pkgver=9.0
pkgrel=1
pkgdesc="Dump1090 is a simple Mode S decoder for RTLSDR devices"
arch="all"
url="https://github.com/flightaware/dump1090"
license="GPL-2.0-or-later"
depends="
	rtl-sdr
	bladerf
	"
makedepends="ncurses-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/flightaware/dump1090/archive/refs/tags/v$pkgver.tar.gz
	gcc14-werror-calloc.patch"

build() {
	make all faup1090 EXTRACFLAGS=-DHTMLPATH=\\\"/usr/share/dump1090/html\\\"
}

check() {
	make test
}

package() {
	install -D -m755 dump1090 "$pkgdir"/usr/bin/dump1090
	install -D -m755 view1090 "$pkgdir"/usr/bin/view1090
	install -D -m755 faup1090 "$pkgdir"/usr/lib/piaware/helpers/faup1090
	install -d -m755 "$pkgdir"/usr/share/dump1090/html
	cp -r public_html/* "$pkgdir"/usr/share/dump1090/html
}

sha512sums="
07408c5680e626eccd3f74d35a6e8a7538dfffd31675f036580003dbba2a78f2487e1980d72d3ec7e44d3f94880e3f231ab1c97bd99ba1ca6cdcfa0ebf198aff  dump1090-9.0.tar.gz
54970b9e25dc6963e81d1309f5f45abefbe875eb8be54ff3b825fcfd44121368525c57409207258d5af7f97454a888f875dc1dc6f1e6f5fdd33b70a7bd0bc963  gcc14-werror-calloc.patch
"
