# Maintainer: Corentin Henry <corentinhenry@gmail.com>
# Contributor: Corentin Henry <corentinhenry@gmail.com>
pkgname=ostinato
pkgver=0.9
pkgrel=0
pkgdesc="Packet/Traffic Generator and Analyzer"
url="http://www.ostinato.org/"
arch="all"
license="GPL-3.0"
options="!check" # make test does nothing
makedepends="qt-dev protobuf-dev libpcap-dev paxmark"
subpackages="$pkgname-drone $pkgname-gui"
source="$pkgname-$pkgver.tar.gz::https://github.com/pstavirs/$pkgname/archive/v$pkgver.tar.gz"
builddir="$srcdir/$pkgname-$pkgver"

build() {
	cd "$builddir"

	qmake PREFIX=/usr
	make
}

package() {
	cd "$builddir"

	make INSTALL_ROOT="$pkgdir" install
	paxmark -m "$pkgdir"/usr/bin/drone
	paxmark -m "$pkgdir"/usr/bin/ostinato
}

drone() {
	pkgdesc="ostinato controller"

	install -d "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/drone "$subpkgdir"/usr/bin/drone
}

gui() {
	pkgdesc="graphical controller for ostinato"

	install -d "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/ostinato "$subpkgdir"/usr/bin/ostinato
}

sha512sums="a50f6e20d8a2a4d76ca43a89feaa774778981377ce1f4c731ad8b1a97aa658013082fb85cc3f4dfdd888d708c45c8093e55facaa7f02cecbd2ce5228f57e2e14  ostinato-0.9.tar.gz"
