# Maintainer:
pkgname=soapy-sdr-remote
pkgver=0.5.2
pkgrel=1
pkgdesc="Remote control for Soapy SDR"
url="https://github.com/pothosware/SoapyRemote"
options="!check" # no tests
arch="all"
license="BSL-1.0"
depends="avahi"
makedepends="
	avahi-dev
	cmake
	samurai
	soapy-sdr-dev
	"
subpackages="$pkgname-doc $pkgname-openrc"
source="https://github.com/pothosware/SoapyRemote/archive/refs/tags/soapy-remote-$pkgver.tar.gz
	soapy-sdr-remote.initd
	"
builddir="$srcdir/SoapyRemote-soapy-remote-$pkgver"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_BUILD_TYPE=MinSizeRel
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
	rm -rf "$pkgdir"/usr/lib/systemd

	install -Dm755 "$srcdir"/soapy-sdr-remote.initd \
		"$pkgdir"/etc/init.d/soapy-sdr-remote
}

sha512sums="
55841f248c796a870a81a508cec85962ed821c2abd40438eaee07135cb6dde0bd93e84a3ff709dfeaf26f7f79717197c80c3aad378d62b3e4b232f60c46b0151  soapy-remote-0.5.2.tar.gz
455839c05ce322d1120244447feb340cbc820fbe8789c0883f2dcac3b4b3f77065438b01d4daecb7b111576317b909de568af7be7bd4f7353b613c33e13008e5  soapy-sdr-remote.initd
"
